Commit Graph

973 Commits

Author SHA1 Message Date
baldurk ea5d17989c Compile fix 2014-12-28 20:11:16 +00:00
baldurk efdffaef6e Support all the crazy different pixel store unpack parameters
* If the pixel store parameters are relatively simple we go through a
  fast path that's about the same as it was before, otherwise we manually
  unpack to a tightly packed buffer for serialising. Hopefully this should
  rarely happen.
* glPixelStore parameters are only serialised when capturing a frame, and
  the pixel store parameters at frame start form part of the initial state
  vector.
2014-12-27 01:07:03 +00:00
baldurk f73a7a4a0c Support ARB_map_buffer_alignment on 64byte boundaries
* The real implementation can do more if it wants, and align to a larger
  alignment, but we just return 64 to the program and align to that, which
  satisfies the extension minimum requirements (and chances are no program
  takes advantage of wider alignment anyway).
2014-12-26 16:04:22 +00:00
baldurk cd53d97418 Fix using wrong pointer as 'window' handle for frame capturer 2014-12-26 16:02:26 +00:00
baldurk 1c53c4a3e6 Support ARB_indirect_parameters properly. Bump GL serialise version 2014-12-26 15:44:51 +00:00
baldurk 2788069f4a Add an optional context when debug messages are logged
* Many debug messages are completely useless without context, so to track
  down bugs in crashdumps with logs, etc, it would be very useful to add
  a little snippet to show what function call the message was fired from
  and what the parameters were.
* I'll just add these as/when necessary for tracking bugs.
2014-12-26 12:54:48 +00:00
baldurk fd9d49f13e Add a print of current GL vendor/renderer/version when doing checks 2014-12-26 12:50:59 +00:00
baldurk 23fd72b6ef Fail in a friendly way (ie. not crash) if EXT_dsa isn't present
* Eventually I'll add a wrapper layer so that if EXT_dsa isn't present then
  it just gets emulated, but for now we require it to be present even if
  the captured program didn't use it.
2014-12-26 12:35:27 +00:00
baldurk 4647eee9f2 Handle repeated re-specifying of buffer textures by marking dirty
* Also added handling for dirty buffer textures - there are no contents to
  copy, those are handled with the buffer, so instead we just grab the few
  parameters that are valid to re-specify the buffer texture.
2014-12-26 12:25:41 +00:00
baldurk aec7af04e4 If we're retyping in BindBuffer(), remove any redundant BindBuffer()s 2014-12-26 12:21:43 +00:00
baldurk 3cec05c3d9 Support VAO 0 being used, by creating fake resource record for it
* We pick up the properties of VAO 0 on frame capture as dirty state, and
  then replay it into the fake VAO we were already creating for VAO 0.
* Eventually this record will be entirely trimmed/ignored for programs that
  don't use VAO 0 by frame references, but for now we fetch it needlessly.
  It doesn't seem to fire any errors.
2014-12-26 12:04:19 +00:00
baldurk 47005da118 Attempt to emulate luminance textures as they're quite common still.
* I emulate luminance textures as either GL_RED or GL_RG textures of
  appropriate size, and use the built-in texture swizzling to shunt the
  channels around.
* At the moment, I don't handle further swizzling of the textures (which
  would break the fake layer) as I assume legacy code using luminance texs
  wouldn't use swizzling also, but instead would just update and use the
  appropriate formats themselves.
* The same applies for render buffers, texture views, texture buffers and
  glTexStorage* calls - not handled at the moment, but wouldn't be hard to.
2014-12-25 21:16:33 +00:00
baldurk a9092dd199 Fix case where tex UAV bound could 'hide' out-of-bounds GSM access 2014-12-24 14:02:07 +00:00
baldurk 73100ef681 Protect against crashes by verifying that all resources created 2014-12-24 13:32:10 +00:00
baldurk 0d79a1737f Handle stranger render target formats in pixel history 2014-12-24 13:12:24 +00:00
baldurk fff6cba6db Fix 3D texture visualisation for GL 2014-12-23 23:24:58 +00:00
baldurk ed3c50db87 Leave enum alone for passing to glGetProgramStageiv
* We can't pass GL_COMPUTE_SHADER to glGetProgramPipelineiv in some cases,
  but if we have a program (not pipeline) and want to query, we need the
  enum intact even if the AMD bug workaround is active.
2014-12-23 23:11:25 +00:00
baldurk 3caef1cb8e Handle matrices as GLSL program input/output variables 2014-12-23 00:25:06 +00:00
baldurk 517e3480c4 Don't switch to GL context to fetch VAO/FBO if it's NULL!
* If the 'context shared' VAOs/FBOs hack is on, their context is set to
  NULL (so any context will match the resource), but this also means we
  shouldn't try and bind that context to fetch data.
2014-12-23 00:00:24 +00:00
baldurk e17a543e96 Split texture display shaders into precompiled variants
* GL won't let you define too many texture uniforms, and currently the tex
  sampling code blows it for the texture display shader. So we split it
  by float/uint/sint and pick the right compiled version.
2014-12-22 23:21:15 +00:00
baldurk f9191df92a Add some unhandled sampler types in uniform serialising 2014-12-22 22:18:20 +00:00
baldurk a8422b940a Support StartFrameCapture(NULL) and EndFrameCapture(NULL). Refs #117
* If there's only one device/equivalent around, then allow specifying a
  NULL window for frame capturing and that lone device is the one used.
* This allows for capturing completely headless applications, perhaps doing
  compute or something offline. It also allows capturing applications where
  the rendering happens by sharing textures off to some other API that
  isn't hooked.
2014-12-22 19:09:21 +00:00
baldurk 741e7ab60c Handle no VAO being bound without crashing
* Binding VAO 0 is invalid in core GL, but it's common for programs to do
  so we want to support it - we can show an API error/warning to indicate
  that it's wrong.
2014-12-21 16:58:10 +00:00
baldurk 924270b3b0 Fix cases where setting NULL was being incorrectly completely ignored
* Fixes a fairly serious regression where any capture relying on setting
  NULL as one of several state objects would instead just get the previous
  state left over.
* This was a bug introduced with 7aee40f7a4
  where we checked for whether resources were present in the replay - but
  it didn't account for ResourceIds being 0 in some cases - which is valid
  and corresponds ot setting NULL, but returns false from HasLiveResource.
2014-12-21 13:40:39 +00:00
baldurk 97afe6816a Fixes for mesh viewing on output stages 2014-12-21 13:02:47 +00:00
baldurk fafa036c37 Fix wchar_t to char conversion in renderdoccmd on win32 2014-12-21 12:48:03 +00:00
baldurk f1f72ec8ff Add process for programs to voluntarily remove renderdoc. Refs #115
* To remove renderdoc (e.g. if the API version doesn't match what is
  expected), user code can call RENDERDOC_Shutdown() to remove the running
  thread and undo any library hooks, then unload the dynamic library.
* This still isn't recommended as there could be unexpected side-effects,
  and it will definitely break if this happens after any APIs have been
  initialised, but it's an option.
2014-12-21 11:30:29 +00:00
baldurk 0df6e36ff5 Allow displaying any semantics as 'position' on mesh output view
* This means you can visualise the UVs directly, not just as a colour
  on the regular mesh.
2014-12-20 19:54:52 +00:00
baldurk 3dd6d7d296 Add a note about vendor-specific extensions not being supported 2014-12-20 19:54:52 +00:00
baldurk 3be08dbb71 Add a few more extensions we support, and some more we never will
* There are a handful of ARB and EXT extensions left that aren't in either
  the list of supported, or will-never support. These are ones that I want
  to support but haven't written the code for.
2014-12-20 19:54:51 +00:00
baldurk a1e3d80a6d Add a list of extensions that I never plan to support. 2014-12-20 19:54:51 +00:00
baldurk 9da77952e2 Add some EXT aliases and then report more supported EXT extensions 2014-12-20 19:54:51 +00:00
baldurk 44cdab44b4 Add some more easily-implemented extensions 2014-12-20 19:54:50 +00:00
baldurk da93a4e0a0 Implement KHR advanced blend equation extensions 2014-12-20 19:54:50 +00:00
baldurk c02a8d7786 Implement GREMEDY string marker and frame terminator extensions
* We don't try and detect duplicate markers between GREMEDY and KHR_debug,
  just assume the program is smart enough to detect that both are available
  and pick only one to use.
2014-12-20 19:54:50 +00:00
baldurk 00ee02eabc Implement EXT_polygon_offset_clamp 2014-12-20 19:54:49 +00:00
baldurk af4b0c1114 Update to latest Khronos headers. 2014-12-20 19:54:49 +00:00
baldurk 81a09a7323 Fix a few typos, mostly using #define enum values not typed enum 2014-12-20 19:54:49 +00:00
baldurk ee55bb43a3 Intersect renderdoc supported exts against driver supported exts
* For each context on first activation we fetch the extensions supported by
  the implementation, and intersect that with the list of extensions that
  renderdoc itself supports, so we return to the application the subset
  of 'real' supported extensions that we can support ourselves.
2014-12-20 19:54:48 +00:00
baldurk 7f133d4b33 Update master list of GL extensions our code currently handles
* This list includes all extensions that we support all the entry points,
  tokens, etc for. It still needs to be unioned with the extensions that
  the implementation supports to determine what to return to the program.
* A couple of extensions are a little hazy as we implement everything in
  them that 'modern' GL includes, but the extension itself also specifies
  some old/outdated functions. Any extensions that are entirely old
  functions are omitted from this list.
2014-12-20 19:54:48 +00:00
baldurk 3e9c178c8b Add some other aliases of functions we already implement 2014-12-20 19:54:48 +00:00
baldurk 45a3dba237 Handle ETC2/EAC in case, for GL_ARB_ES3_compatibility 2014-12-20 19:54:47 +00:00
baldurk dc8e865301 Track and restore per-texture seamless cubemap state
* This is for the ARB_seamless_cubemap_per_texture extension. We already
  track the global state that isn't specific to a texture.
2014-12-20 19:54:47 +00:00
baldurk b08592f502 Add EXT alias of glBlitFramebuffer for EXT_framebuffer_blit 2014-12-20 19:54:47 +00:00
baldurk a18b7505b8 Make sure to return 'real' debug callback/param, not our own 2014-12-20 19:54:47 +00:00
baldurk de702ac1d9 Stop filtering wgl extensions, just return all we don't hook as-is
* I will assume for now that any wgl functions I don't explicitly hook have
  no effect on the captured frame and we can safely just let them straight
  through to the real function.
2014-12-20 19:54:46 +00:00
baldurk 3298905d1d Optimise/improve hookset.pl, return dummy function pointers
* Now instead of returning NULL for entry points that we don't support and
  hoping the application will handle that or error out, instead we return
  a function that will log an error if it is ever called, and then pass
  through to the real function. In most cases, the capture will probably be
  broken as whichever function isn't saved.
* hookset.pl is much faster too, it outputs the whole gl_hookset_defs.h
  file and doesn't do multiple searches over the whole set of headers in
  official/ for each function.
2014-12-20 19:54:46 +00:00
baldurk fe3be81c94 Don't error about textures that aren't complete anyway 2014-12-20 19:54:46 +00:00
Baldur Karlsson 91f85838c5 Merge pull request #116 from loosche/show_normalized_uvs
Add normalized UV coordinates to the TextureViewer window.
2014-12-19 08:35:06 +00:00
loosche 9ef5080302 Change the normalized UV formatting to use Formatter.Format() instead of
doing it myself.
2014-12-19 00:31:17 -08:00