Main goal was to fix undefined behaviour, but it's also 50x faster...
cppcheck:
[renderdoc/driver/shaders/dxbc/dxbc_debug.cpp:1163]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
* fflush is a no-op wrapper but nice to have for consistency.
* ftruncateat will take a file read-write handle and truncate it at a
given length. Useful if re-writing a file and the new data ends up
being shorter than the oldd ata.
* Move in addition to Copy, and success/fail bool return on both.
* We remove the now unneeded name fields in buffer/texture descriptions
and some of the pipeline state structs.
* A single function will give the human-readable name for a resource id.
This will look up a custom set of renames, on top of the names from
the resource descriptions.
* For Vulkan and D3D12, we now create a dummy command buffer to ensure
that there's actually a chunk available to correspond to the command
buffer that gets submitted or recorded to.
* This provides a way to find the name of any resource besides 'special'
resources like textures and buffers. In a follow-up commit, the names
will be removed from their descriptors.
* It also allows us to list which chunks in the structured file were
used to initialise the resource, giving the ability to look up and
display the initialisation parameters.
* At the same time we also list the derived/parent resources to better
allow the user to browse between related resources.
The EGL function pointer loading was scattered
in two files thus it is hard to keep track where
the symbols were loaded.
Introduced a class which holds all internally used
EGL function pointers with a helper method to
load the required pointers. Not all EGL pointers
are loaded just the used ones (just like before).
In some cases a few GL wrapper methods are called
with incorrect gl_CurChunk during serialization.
This can happen if the capturing application calls
a GL method - for which the gl_CurChunk will be set correctly -
and the wrapped method calls another wrapped GL method
but for that the gl_CurChunk will be incorrect.
Also during the ActivateContext call the gl_CurChunk
was not set.
For now do a hotfix for glDrawArrays and initial context.
* For now, resource replacement implicitly means shader edits, but other
replacements could also affect the results of PostVS (e.g. buffer or
state changes). Trying to capture all this state in the cache key is
not very useful.
* The PostVS cache will be re-filled immediately after, as any
replacement does a force-refresh of the current event.
* If the external code has a NULL pointer and doesn't want to allocate
but we are exporting buffer data, we still need to read the data
somewhere so make a temporary allocation to read it into.
* AMD reports image required sizes with some variation even for the same
creation parameters. This can mean the same image is reported with
less required size during capture compared to replay, meaning memory
binds won't work.
* To get around this, we pad up the requirements to alignment * 4 and
fudge to try and encompass any possible variation.