Commit Graph

862 Commits

Author SHA1 Message Date
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
baldurk 670c0ef7e7 Handle BGRA vertex attributes 2014-12-03 23:22:24 +00:00
baldurk 13c613d757 Handle binding 0 imagetexture 2014-12-03 23:13:38 +00:00
baldurk 850410b1a3 Vertex buffer functions also need to bind the VAO when reading 2014-12-03 21:21:57 +00:00
baldurk a4e6f0f1d1 Only explicitly bind vertex array object when reading, not executing 2014-12-03 21:20:26 +00:00
baldurk a5e019d143 Fix glBufferData re-creating, preserve chunk ordering 2014-12-03 20:23:49 +00:00
baldurk 2a43d0d4bf glCopyBufferSubData should contribute to record update count 2014-12-03 20:19:14 +00:00
baldurk 4bd1f940d6 only use CUBE_POSITIVE_X as a query target for CUBE_MAP
* GL_TEXTURE_CUBE_MAP_ARRAY can be used directly as a query target
2014-12-03 20:18:33 +00:00
baldurk c7576d8a7f Add resource record parent for VAO when binding buffer 2014-12-03 18:16:50 +00:00
baldurk d30ce5d6b2 Fixes for replay, and populating hooks (call through hooked func) 2014-12-03 18:16:06 +00:00
baldurk cb7dd8fa6d Check that functions are available before doing anything 2014-12-03 16:52:54 +00:00
baldurk 185df924dc Use proper wglGetProcAddress hook 2014-12-03 16:52:37 +00:00
baldurk 2f48158a89 Add some extensions that we already support, and ARB func aliases 2014-12-03 16:03:19 +00:00
baldurk 907361c4bb Add glBindMultiTextureEXT - still need to add rest of EXT_dsa funcs 2014-12-03 16:02:40 +00:00
baldurk 431eef4e6d 64-bit compile fixes 2014-12-03 14:10:57 +00:00
baldurk 46a29c7d14 As a slight concession, create a 'fake' VAO to use when 0 is bound
* I think this is invalid in the core profile, but it's a simple workaround
  and this might be a common problem.
2014-12-03 14:00:23 +00:00
baldurk 8397aa1f28 Handle glBufferData being used to rename/orphan to a new size 2014-12-03 13:57:03 +00:00
baldurk 34b39d79d2 Respect program settings for depth/stencil tests
* This means we don't e.g. enable the depth test when it was originally
  disabled, and show incorrect 'failure' of the draw to pass the depth test
2014-12-03 13:15:48 +00:00
baldurk 3cac0c339d Only set readbuffer to GL_BACK after default FBO is bound 2014-12-03 13:08:19 +00:00