Commit Graph

902 Commits

Author SHA1 Message Date
baldurk 652f3529a3 Track if a context is core or not, re-check vendor checks on core
* When a compatibility context is created (via the old CreateContext, or
  via an appropriate CreateContextAttribs call), we can still do the vendor
  checks but we want to make sure we perform them again if we ever create a
  core profile context. Note that actually *using* a compatibility context
  isn't supported at the moment, but this won't explicitly break that.
2014-12-14 12:17:41 +00:00
baldurk 86c110184a Only query depth stencil texture mode for depth-stencil textures 2014-12-14 12:17:39 +00:00
baldurk a984352b74 Add a vendor check to avoid querying GL_POLYGON_MODE on AMD 2014-12-14 12:17:38 +00:00
baldurk e1d01970c6 Add fetching of Indirect params, and stepping through MultiDraw calls
* This means glMultiDrawIndirect is fetched, decomposed into child draw
  calls and you can step through them individually
2014-12-14 12:17:38 +00:00
baldurk 071663dd7e Make sure last draw data is set every time, not just when reading
* These values are used to show the current pipeline state (as it's
  convenient to show this data with the rest of the 'state', even if it's
  not state. That means they need to be set every time when executing, not
  just once when reading.
2014-12-14 02:16:15 +00:00
baldurk 644a493f5b Fix enums being wrong when added to even tlist 2014-12-14 02:12:50 +00:00
baldurk 378ef162b5 When replaying don't use VertexAttribPointer functions (or DSA equiv)
* It seems like there's some buggy behaviour when mixing and matching 'old'
  style vertex attrib pointer/offset functions, and the new attrib/vertex
  buffer binding style (which we use in VAO initial state since it's a
  superset of functionality).
* Fortunately, the spec defines exactly how VertexAttribPointer is defined
  in terms of the new system, so just do the replacement ourselves.
2014-12-14 01:48:13 +00:00
baldurk 2c12423975 Return some WGL extensions that we can easily support. 2014-12-14 00:29:16 +00:00
baldurk d433869e3c Make sure bind-to-create chunks don't affect object state
* e.g. if the 'wrong' VAO was bound at the time we replayed a
  bind-to-create chunk, then we'd trample that VAO state (and it might not
  ever be restored). So when reading, not executing, save and restore the
  buffer binding.
2014-12-13 23:43:51 +00:00
baldurk 6ca8fc0c1b Propagate resource dirtiness over copies 2014-12-13 23:42:18 +00:00
baldurk 881e513f59 Replay glTexBuffer commands in-frame 2014-12-13 21:16:15 +00:00
baldurk 8db4095b09 Don't call into real glFlushMappedBuffer unless it was really mapped 2014-12-13 21:15:58 +00:00
baldurk 35a13fe160 Make sure all arrays preserve 'depth' when calculating mip dims 2014-12-13 21:15:42 +00:00
baldurk f55e8cdd37 Only mark resources as referenced while capturing a frame 2014-12-12 20:23:16 +00:00
baldurk ce514d12ad Fix last vertex not highlighting 2014-12-12 19:18:03 +00:00
baldurk c207391b54 Linux compile fixes. 2014-12-12 00:15:45 +00:00
baldurk 15e7764b89 Ignore lack of initial state for VAOs 2014-12-11 23:18:32 +00:00
baldurk 9860d8bba8 Mark buffers referenced so they're kept alive even if deleted in-frame
* We need to have more comprehensive frame references for several reasons
  but this will handle the case where a buffer is created, bound, deleted
  before the frame ends.
2014-12-11 23:18:06 +00:00
baldurk a3d374c103 Check component type AFTER constructing the format 2014-12-11 22:54:38 +00:00
baldurk 3d99c14c9f Handle cubemap face targets in GetSizedFormat 2014-12-11 22:49:34 +00:00
baldurk 5fe0354ce4 Drop use of CONTEXT_FORWARD_COMPATIBLE_BIT, add CORE_PROFILE_BIT 2014-12-11 22:41:11 +00:00
baldurk 12af78d535 Print out the attribs a context is created with 2014-12-11 22:39:35 +00:00
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