* In extreme cases a program can create lots and lots of unique short-
lived state objects, we cache them all and run out of the 4096 state
objects that can be around, then further creates fail out.
* To handle this, if we have 4000 total state objects, we release any
that are purely being held by us (not the program). This isn't an
ideal solution but it's quite simple and non-invasive, and only has
a slight impact on rare Create calls.
* Most programs will either create a few up-front (as intended), or at
worst create a few dozen or even few hundred then re-use them as they
are cached.
* D3D11 you query for interface with UUID of
{A7AA6116-9C8D-4BBA-9083-B4D816B71B78}. It's just IUnknown*
* GL implements GL_EXT_debug_tool with spec here:
https://renderdoc.org/debug_tool.txt
with DEBUG_TOOL_EXT #define'd to 0x6789, DEBUG_TOOL_NAME_EXT to 0x678A
and DEBUG_TOOL_PURPOSE_EXT to 0x678B. For now, reporting this ext is
enough to identify RenderDoc.
* To align a buffer inside a chunk to a wider boundary like 32-bytes in
this case, the chunk needs to be aligned and the buffer within it also
needs to be aligned.
* The utility function accounts for the buffer serialised having a
uint32 length in front of it, so it pads out until that will be at
the desired boundary. This is a bit of a messy solution, but the
easiest way to ensure the padding is there while being easily
backwards compatible with old logs without the padding.
* D3D11 and GL serialise versions are bumped, D3D11 version is backwards
compatible, GL breaks compatibility.
* Fixes a reported crash.
* This function was only core in 4.2 so it's perfectly valid for it to
be missing - if so then we just skip using it to determine the size of
a format and default to 8-bit colour or 32-bit depth/stencil formats.
* The core class is now responsible for tracking the active window and
cycling through, so it can cycle through multiple APIs.
* For GL we only set up associations for capturable windows, and only
those that present (since helper windows are often created). Since
GL doesn't really have a 'this window is done rendering' call, we just
decay old windows that haven't presented in >5 seconds.
* Also on GL, legacy/uncapturable windows aren't associated so they will
not cycle to at all.
* The embedding API now expects a device pointer and window handle to
set active window or start/end a capture. You can still pass NULLs if
there is only one API active.
* This means that the timeline bar will show use as read/write/clear etc
and that right clicking on textures in the texture viewer will show
the events where that texture is used for rendering, for reading, and
so on.
* This is a concession towards non-core capturing, as it's fairly easy
to support this fallback case without having a negative effect on the
proper path.
* We serialise out whether an index buffer was bound, and if it wasn't
we serialise the array passed as a parameter, and upload it into a
temporary index buffer we generate (so that the replay is correct at
least).
* I think technically the indirect parameter for glDrawElementsIndirect
can point to client memory, and the elements array-of-arrays in
glMultiDrawElements can definitely point to client memory, but I'm
assuming that no-one would do that. I certainly hope they wouldn't!
* If CreateContextAttribs is not used to create the context, the overlay
will run in super-duper old mode using immediate mode calls and fixed
function pipeline. This way it should display on (in theory) any GL
app. Capturing will be prevented.
* Compatibility profile contexts are still allowed, but a warning is
displayed in the overlay.
* If CreateContextAttribs is used to create a < 3.2 version context, we
go down the same path as for legacy contexts, except with an accurate
overlay message (just that the version isn't supported).
* This prevents the app requesting an ID3D11Debug, getting the *real*
one, and then escaping our little jail of QueryInterface interfaces.
In particular, an app is likely to ask for ID3D11Debug then ask for
ID3D11InfoQueue and we want to control use of that ourselves,
particularly when we're tracking debug device messages.
* We handle them mostly as a series of rows, adding only the first row
as a varying name, but incrementing the stride for each to account for
the space taken up by a matrix.
* For everything but vertex shaders to make a separable program we need
to redeclare gl_in and gl_out. If both of these end up in the same
string the second insertion was trampling the first one - now they
will both go in properly.
* SetDst called into a scalar destination operand expect the source to
be in .x of the parameter, regardless of mask. So in a couple of cases
where we're assigning from a vector we need to do the mask apply
by hand. Bit messy, but there are only a couple of exceptions
* ld_structured was just looking for UAVs before, but this opcode is
also used for SRVs and we need to find the right declaration to get
the stride correctly (otherwise we'll either get 0 if there are no
UAVs, or pick a UAV incorrectly!)
* Note at the time of committing there are still some warnings in MS
headers that you might need to suppress in a couple of files.
* 3rd party code just has the warnings suppressed for ease of merging.
* The majority of warning fixes were for local variables shadowing
other locals, function parameters, or members. In most cases they
weren't a problem, but in some cases it was potentially dangerous!
* What gets listed as a 'drawcall' is a bit fuzzy - previously it was
drawing calls, dispatches and clears, but you could make a good
argument for these to be included as well. As a semi-experiment, these
calls are now included and will be listed in the event browser.
* Other calls can change resources like direct buffer or texture uploads
and Map() type calls, but these remain as API calls listed between
draw calls. Again this is mostly an arbitrary distinction.
* D3D11 logs are backwards compatible, GL logs are not (although it'd
be relatively simple, GL logs will likely break backwards compat soon
anyway, so not worth supporting it now only to break it soon).
* Previously for post VS data we could maintain the index buffer by just
doing the stream-out/transform feedback for a point list with each
unique index. To maintain the index buffer we padded out any gaps in
the indices with a single value, so that we could just shift the
indices. This causes severe problems though if the indices start at 0
and contain an invalid value like 0xcccccccc - we'd allocate a huge
array and perform a massively wasteful streamout.
* Instead, we just stream out on the tightly packed list of unique
indices, then remap each 'real' index to where it is in the tightly
packed output buffer.
* This prevents arrays or cubemaps from having the slice or face index
be incorrectly modified by the mip being displayed. Thanks Xavyiy on
twitter for the report.
https://twitter.com/Xavyiy/status/574352181190594560
* This shader is necessary for the MSAA-to-array copying functionality
used, and without it we bind a NULL vertex shader and can end up with
driver crashes.
* This means the redeclarations are a bit more flexible if a shader
(like a geometry shader) redeclares one already, but not the other,
we'll only substitute in the missing one.
* Note this code is still a bit flakey e.g. in edge cases like if
someone puts "in gl_PerVertex" in a comment, then it will fail.
I want to avoid putting a full parser in, but perhaps stripping the
source of any comments is a reasonable future step.