Commit Graph

880 Commits

Author SHA1 Message Date
baldurk c8e29488ef Fix proxy target checks, make sure real function is called
* If the target is a proxy target or the internal format is invalid, make
  sure we still call the real GL function, but don't do anything ourselves.
2014-12-11 22:22:33 +00:00
baldurk 95e3f01686 Handle attachment ID being 0 (unbind attachment) 2014-12-11 22:05:04 +00:00
baldurk 6523dfde31 Add ARB function aliases for vertex functions 2014-12-11 22:04:49 +00:00
baldurk 050b5d4840 Add EXT function aliases for EXT_framebuffer_object 2014-12-11 21:10:43 +00:00
baldurk 11df77cdff Return wglGetSwapIntervalEXT straight 2014-12-11 21:08:19 +00:00
baldurk 9be802082f Add a vendor check to detect if FBOs or VAOs are actually shared
* This lets us detect if the FBO/VAO behaviour is different from the main
  spec, and so we won't miss deletes or other events if the context is
  different since we'll treat them as shared like any other object.
2014-12-11 20:30:34 +00:00
baldurk a777a13021 Custom shaders should not blend, make channel buttons visible
* The RGBA channel enable buttons were applying anyway, they were just
  being hidden.
2014-12-11 19:49:03 +00:00
baldurk 6152332e36 Demote error to warning when failing to open a logfile
* This means you don't hit a debugbreak and fire an exception in profile if
  you load an image file (which tries to load as a logfile first, and
  fails).
2014-12-11 19:18:25 +00:00
baldurk 31d81147af Put glTexBuffer into frame record to preserve ordering
* Important buffer chunks like the first glBindBuffer and glBufferStorage
  could happen in the frame, so need to preserve order between those and
  glTexBuffer.
* It is only replayed in READING, so once at startup - not once per frame
  replay.
2014-12-10 20:56:42 +00:00
baldurk 231cd31b0c Remove deleted objects from the GPU dirty resource list 2014-12-10 19:52:13 +00:00
baldurk ddb272c126 Implement other EXT_dsa functions relevant to GL3.2 and above core
* None of these require extra serialisation functions, but some upgraded
  to DSA style serialise instead of selector serialise functions.
* There's a lot of duplication here now (expecially for MultiTex calls).
  This could really do with cleanup soon.
2014-12-10 08:18:07 +00:00
baldurk 37700b3945 Use resource IDs not handles to mark high traffic resources
* In OpenGL and D3D11, resource handles (pointers or namespace/uint pairs
  respectively) could be reused, so we can't use these to denote resources
  that are getting updated regularly and should have updates ignored.
* I don't know how I got away with this for so long, or why I used pointers
  in the first place. It could have predated resource IDs maybe.
2014-12-07 16:34:36 +00:00
baldurk 563c9e88a5 Don't assume screenshot jpg buffer will always be <128kB 2014-12-07 16:12:06 +00:00
baldurk ec4c8bca9a Track update count and mark textures as high traffic in glTexSubImage* 2014-12-07 15:43:49 +00:00
baldurk 0b482301e7 Add RENDERDOC_TEMP override environment variable on linux
* Until I have a proper UI this is convenient when capturing, especially if
  you point the folder at a samba share on windows so you can load the
  capture up directly.
2014-12-07 15:24:53 +00:00
baldurk f6ab677156 Explicitly initialised global ID counter 2014-12-07 15:24:52 +00:00
baldurk cd1de6e180 Fix semantics for atomic operations on linux (return result of op) 2014-12-07 15:24:51 +00:00
baldurk 43add19704 Store resource in record, since it's frequently accessed 2014-12-07 15:24:51 +00:00
baldurk 723faec986 Cubemap array 'depth' is the same for all mips, it's the array size 2014-12-07 15:24:50 +00:00
baldurk af0b869dee Fetch compute shader tex resources if it's a compute drawcall 2014-12-07 15:24:49 +00:00
baldurk 02fb0ce003 Make sure GL pipeline state is cleared up before we make a new one 2014-12-07 15:24:49 +00:00
baldurk 9b15527a84 Don't leak memory if re-creating an existing array 2014-12-07 15:24:48 +00:00
baldurk 7131d39a6d Compile-time assert that GLenum is consistent size for serialising 2014-12-07 15:24:47 +00:00
baldurk 1cff12ee87 Store read/draw buffers for FBOs in initial data
* This avoids spamming of glReadBuffer/glDrawBuffer calls pointlessly into
  the pre-frame chunk stream.
* The default FBO stores its ReadBuffer and DrawBuffers in the initial
  frame state vector.
2014-12-07 15:24:46 +00:00
baldurk acb66bf626 Check that resource is available before setting object label 2014-12-07 15:24:46 +00:00
baldurk 043dc09d30 Improve handling of pixel unpack buffers and glTex*Image*
* When an unpack buffer is bound, don't serialise out any data for any
  function. For glTexImage* style creation functions we still need the
  create to be serialised, but we can immediately mark it dirty and fetch
  the real data later. We just pass NULL for the data pointer.
* For glCompresssedTexImage*, we can't pass a NULL data pointer, so we
  create a scratch buffer that's big enough to create the image of the
  correct size, and allow the initial data from it being marked as dirty
  to then overwrite it later.
* glTexSubImage style functions should be replayed even when executing, in
  case new data is uploaded mid-frame.
2014-12-07 15:24:45 +00:00
baldurk fb8e6ac382 Output signature readwrite mask denotes unused, not used elements
* Credit to unbird from
  http://www.gamedev.net/topic/663475-renderdoc-weird-output-signatures/
  for identifying this :).
2014-12-06 20:58:37 +00:00
baldurk 1cf2a41cd7 Fix display of mips, GL_NEAREST_MIPMAP_NEAREST is required
* If GL_NEAREST is specified it means the whole mip chain is locked off,
  even if we do textureLod in the shader.
* Instead, go back to using GL_NEAREST_MIPMAP_NEAREST and clamp the
  MAX_LEVEL to make the texture mipmap complete when necessary.
2014-12-06 20:52:51 +00:00
baldurk e3374c74c2 Switch to the proper context to fetch VAO/feedback initial data 2014-12-06 20:27:09 +00:00
baldurk bda809f9dc Allow GL driver to switch current contexts when really necessary 2014-12-06 20:25:48 +00:00
baldurk 233808b8f0 glVertexAttrib*Pointer and glBindVertexBuffer add parent dependency 2014-12-06 19:02:30 +00:00
baldurk e9bd9ef497 Serialise out calls to MakeCurrent mid-frame-capture.
* We need to serialise out the new state vector that's applied when we
  change context.
* Note we still have very hacky incomplete support of contexts, and no
  support of true threading. We currently assume all contexts share with
  all others, and if any actual parallel rendering happened it would break.
2014-12-06 18:41:52 +00:00
baldurk 06dd044ed3 Fetch render state after making replay context current 2014-12-06 18:40:24 +00:00
baldurk 1d0ba67331 Fix for fetching "dll export" functions via getprocaddress on linux 2014-12-05 23:49:50 +00:00
baldurk 1cef745534 linux compile fixes 2014-12-05 17:17:03 +00:00
baldurk 95a70bf0fc Ditch explicit linear or point sampling in gl tex display shader
* It's handled already on the C++ side by binding a point or linear sampler
  to that slot, but also it seems that it's not well defined (that I can
  see) if texelFetch should sRGB decode or not. On nvidia it seems to, but
  on AMD it seems like it doesn't do the decode.
2014-12-05 10:00:28 +00:00
baldurk 9561f88fd5 As a hack for now, don't save/restore D32F_S8 texture data
* On nvidia it seems that doing glCopyImageSubData() on a D32F_S8 texture
  can cause serious problems, so ignore it for now. We can generally get
  away with it, as usually the only depth buffer in this format is the
  'main' depth buffer, which isn't used frame-to-frame.
2014-12-05 09:28:34 +00:00
baldurk 637232af14 Use existing texture to fetch number of mips, not copy texture! 2014-12-05 00:51:07 +00:00
baldurk 7b4a8d1c11 Warn about hitting MAP_PERSISTENT sooner
* If a buffer gets marked as dirty before being mapped as persistent (e.g.
  mapped for write & not invalidate), we won't hit this warning and then if
  the buffer map is truly persistent forever, we'll never see the map again
  to warn during frame capture!
2014-12-04 23:18:27 +00:00
baldurk 664f0f4d67 Make sure when rendering overlay, only enable indexed enums we need. 2014-12-04 21:56:58 +00:00
baldurk d7d879f29a Track if depth bounds test is enabled 2014-12-04 21:29:52 +00:00
baldurk 34b554d0bf Make sure initial state structures are properly zeroed out. 2014-12-04 21:29:42 +00:00
baldurk 5002d29415 glDepthRange needs to come from the dll hooks for windows 2014-12-04 21:26:48 +00:00
baldurk b3cf3719ea Fix for map/unmap to capture properly while idle 2014-12-04 14:59:46 +00:00
baldurk 315f190c49 Calculate the right size (including padding) for D32S8 2014-12-04 14:47:47 +00:00
baldurk 00c9515fbd Mark SSBOs and atomic counter buffers as dirty when bound 2014-12-04 14:36:02 +00:00
baldurk 99c6719928 Make sure unmap chunk isn't lost and goes in buffer record
* If we're ignoring a map it's marked correctly as dirty, but otherwise a
  buffer could be mapped once then not touched, not become dirty, and so
  we need the unmap chunk in its record.
2014-12-04 14:35:31 +00:00
baldurk d90f8f0d41 Provide index to SV_VertexID when using index buffer. Refs #113 2014-12-04 14:10:16 +00:00
baldurk 3c05059529 Track our minimal shadow state on a per-context basis
* We track as little state as possible - basically only objects bound to
  binding points that we need to identify for old-style non-DSA functions.
  This is mostly for convenience - the best balance between tracking GL's
  _insane_ state vector and having to query everything we want every time.
* Although we don't properly handle multiple contexts, we need to make sure
  this state is tracked per context otherwise we can get weird mismatches
  and get crashes with e.g. invalid VAOs.
2014-12-03 23:40:03 +00:00
baldurk efac062cdd Make sure to apply initial contents before first replay of frame 2014-12-03 23:24:40 +00:00