Commit Graph
45 Commits
Author SHA1 Message Date
baldurk 15e9b58317 Linux fixes for switch to UTF-8 strings. 2014-12-01 21:40:43 +00:00
baldurk 50d6b62adf Proper SRGB handling in opengl. See gl-320-fbo-srgb
* We create fake backbuffer as SRGB if the original default backbuffer was
  SRGB in the program.
* All of our output backbuffers are also SRGB, and we enable
  GL_FRAMEBUFFER_SRGB when writing to them.
* Add the 'fake' srgb curve applied to linear data to display it as if it
  were srgb, which tends to look intuitively correct even if it's not 100%
  accurate. See the behaviour existing in D3D11 already.
2014-12-01 17:13:30 +00:00
baldurk 2484bc8bc7 Use UTF-8 everywhere possible and only use wchar_t where required.
* This means that all APIs pass byte string types. ALL strings everywhere
  in the entire codebase must be assumed to be and treated as UTF-8 content
  not ASCII.
* Gets rid of all the horrible %hs specifiers that caused warnings on
  linux! Hooray.
* We convert to wide strings, or use wide characters, only when necessary
  to use the Win32 API. Some windows specific code will stay in wide chars
  just for convenience.
* Files are already serialised as UTF-8 strings for linux/windows binary
  compatibility, so this change doesn't break backwards compatibility.
2014-11-23 14:45:16 +00:00
baldurk 6afe7b7cd1 Speculative change to prevent infinite loop of renderdoccmd.exe
* There was a report of renderdoccmd.exe doing --cap32for64 in an infinite
  loop on itself (each process trying to inject the previous). I'm not sure
  how this could get started, but assuming this was happening automatically
  for 'hook into children', try to break the infinite loop by refusing to
  inject into our own exes.
2014-11-16 16:38:48 +00:00
baldurk 643447f521 Fix for hook fetching/populating on capture and replay 2014-11-16 12:34:55 +00:00
baldurk 92d77e32b3 Add missing \s 2014-11-15 00:33:11 +00:00
baldurk 29b4c65162 Work around issue where application 'exports' gl symbols
* This is a bit complex. If an application has a global symbol e.g.
  GLENABLE glEnable; as their function pointers that they fill out from
  glXGetProcAddress, then OUR glEnable global function gets replaced with
  that symbol. It's weird. But it means crashes if we try and return the
  address of that symbol as a function pointer.
* However it's also possible to get the reverse problem - if an application
  has a shared library that has those symbols expecting them to be function
  pointers, those symbols will get overridden with our global functions
  and it will mean an instant crash when they try to assign to those func
  ptrs.
* I'm not sure if there is an ideal fix to this Catch-22, as we also need
  to export these bare functions in case someone just plain links against
  libGL and expects them to be there, with no GetProcAddress/dlsym funny
  business.
2014-11-15 00:13:44 +00:00
baldurk 0f34fbd29a Check that for each new context we populate hooks to get func ptrs 2014-11-14 23:26:18 +00:00
baldurk c5e53f7473 pick up libGL dlsym handle when dlopen() is called 2014-11-14 23:25:15 +00:00
baldurk 65cee274eb Wrap/handle as appropriate new DXGI 1.2 & 1.3 ifaces. Refs #104 2014-11-12 22:55:58 +00:00
baldurk 67e5b28f3b Debug log for which extension functions the app is requesting 2014-11-11 22:54:54 +00:00
baldurk 1fc1e632b3 Just pass-through wglSwapIntervalEXT as we don't care about it 2014-11-11 17:47:55 +00:00
baldurk c406804d24 Bump D3D11 serialise version for ce0a67e8, and add backwards compat
* This is the first attempt at backwards logfile compatibility. Since most
  captures are fairly ephemeral I don't know to what degree I'll go in
  future to support old captures, but since this was a fairly trivial
  example (just skip serialising a bit of data if it's an old version
  without it), I'll test this out.
2014-11-10 17:53:31 +00:00
baldurk ea9054b752 Hack for crash in D3DGear if ppDevice pointer is NULL. 2014-11-09 11:28:48 +00:00
baldurk d3650cc73d Remove wgl/glx from hookset.pl - unused. Also skip blank lines 2014-11-08 13:48:39 +00:00
baldurk 6308d78cd4 Implement debug device/debug api message tracking for GL 2014-11-02 10:52:24 +00:00
baldurk bf46a3fd54 linux compile fixes 2014-11-01 17:04:53 +00:00
baldurk 8d8c8a7c47 Hook into platform delete context function 2014-11-01 17:04:51 +00:00
baldurk 5954f1a406 [Refs #87: Static Analysis] Handle paranoid case of dll not existing 2014-10-05 19:01:22 +01:00
baldurk efbc27909c [Refs #87: Static Analysis] Couple of cases that confused the analyser 2014-10-05 19:01:21 +01:00
baldurk a0d6d771f2 Pass through child processes via remote access to UI. Refs #78 2014-09-28 13:58:18 +01:00
baldurk 8d685de609 Reorganise 3rdparty, include breakpad with sln, drop mhook. Closes #84 2014-09-24 20:24:35 +01:00
baldurk 6fbb247efd Re-organise external-facing headers to be more easily used
* renderdoc/api/replay/ contains all the headers for using the replay and
  analysis side of renderdoc (like in a UI or auto-testing tool)
* renderdoc/api/app/ contains the headers if you wanted to write a
  renderdoc-aware application.
2014-09-13 12:52:25 +01:00
baldurk a60e21a351 USE_MHOOK/USE_IATH_HOOK defines were moved to win32_specific.h 2014-09-05 18:12:57 +01:00
baldurk 620067ec6b Fix %s to %hs usage 2014-08-25 17:23:03 +01:00
Baldur Karlsson 12a30a7b97 Add IAT based hooking to allow hooking 64bit opengl32.dll
* Needs vigorous testing in as many situations as I can think of, not least
  32bit, 64bit, D3D11, D3D9, OpenGL, managed apps, different windows SDKs,
  delay loading dlls (not sure if these will work), statically linked libs,
  LoadLibrary + GetProcAddress
* Credit goes to jslutter for originally bringing it to my attention &
  suggesting it.
* References:
  http://msdn.microsoft.com/en-us/magazine/bb985992.aspx
  http://msdn.microsoft.com/en-us/magazine/cc301808.aspx
  http://www.codeproject.com/Articles/6265/Process-wide-API-spying-an-ultimate-hack
2014-08-06 15:43:16 +01:00
Baldur Karlsson e5664a0838 Add global lock on all GL hook entry points
* This could be improved and moved further down, not all functions would
  need a lock (only things modifying shared resources), but it suffices
  for now.
2014-06-27 13:06:59 +01:00
Baldur Karlsson de9fb483f0 Also pass-through glXChooseFBConfig (for SDL contexts > 3.0) 2014-06-27 11:59:01 +01:00
Baldur Karlsson b30314e644 fixes for hooking programs that use SDL
* Pass-through a few functions in glXGetProcAddress
* Hook dlopen() and redirect any attempts to open libGL.so
2014-06-26 15:19:20 +01:00
Baldur Karlsson b9dd24e950 Also export glXGetProcAddressARB() 2014-06-26 11:42:30 +01:00
Baldur Karlsson 6e1d976a48 Return pixel format WGL extensions and add do-nothing hooks 2014-06-24 15:45:04 +01:00
Baldur Karlsson 90ffbf6537 populate GL extensions on linux too :) 2014-06-19 16:31:44 +01:00
Baldur Karlsson 07e9855f0e Call GetRealFunctions on MakeCurrent to populate extensions.
* Even if the app only queries some subset of extensions, we may need
  more (e.g. need the DSA extensions). GetRealFunctions does a
  PopulateHooks which will fill out the extensions that we need.
2014-06-19 15:23:01 +01:00
Baldur Karlsson c9d8ab2dcf Add a few last buffer related hooks 2014-06-19 13:00:33 +01:00
Baldur Karlsson b345b9ceb7 Hook the EXT_direct_state_access functions.
* Normal selector functions are implemented via these, which requires
  EXT_direct_state_access to be available, but this isn't hard to work
  around with some wrapper functions should that become necessary.
2014-06-19 12:05:49 +01:00
baldurk cb67ae894a Demote some hook errors as they don't seem to succeed on win64 currently 2014-06-17 18:27:29 +01:00
baldurk 4822322509 Compile error fixes 2014-06-17 18:26:30 +01:00
baldurk 71cd654523 Add a macro (that is default on) to include win8 sdk dependency
* Disabling the macro means that the DirectX SDK (June 2010) should be the
  only dependency and you can compile as normal, just without d3d11.1
  support.
* This won't be massively supported and official releases will not use this
* It might break in future as I won't be testing, it might even be deleted
  to tidy up, but until then it might come in handy for some.
2014-06-16 22:05:19 +01:00
baldurk a9df1e4ef2 Don't try and hook OpenGL functions if the dll isn't even loaded on win32 2014-06-16 00:00:00 +01:00
baldurk a92a240227 Fix typo 2014-06-03 21:12:07 +01:00
baldurk 4d59116a2d Add 1D/3D versions of glTexStorage and glTexSubImage 2014-06-01 15:58:06 +01:00
baldurk 2a9b7962ce Hook into wglCreateLayerContext 2014-05-31 00:51:21 +01:00
baldurk 05da325796 Print an error for each dll function that fails to hook. 2014-05-31 00:04:24 +01:00
baldurk b30fe86658 check for vshost exe as well as other exes to detect replay app 2014-05-08 22:20:48 +01:00
baldurk c38affcded Initial commit of existing code.
* All renderdoc code up to this point was written by me, history is available by request
2014-05-02 08:33:01 +01:00