* If we return back (accurate) replaced IDs in current pipeline state, the UI
won't recognise them since the list of resources is cached and fixed at load
time.
* The replaced ID is still present in the shader reflection info as we return
the replaced shader's reflection and not the original's.
* We also change how we replace a programshader (glCreateShaderProgramv) on GL.
Instead of creating a program and a shader - resulting in two objects
replacing one - we instead replace the shader that got built with a program.
We can do this safely since we know the shader won't be used as an actual real
shader (since it was a program in the original capture too).
* This is a very big blunt hammer for fixing the problem of multithreaded
submission from GL. Every GL call checks to see if the context changed (which
would only happen from a thread switch to a different context) and if detected
it inserts a manual MakeCurrent call equivalent.
* It's slow to capture (when this happens - checking is not particularly slow)
and slow to replay, but it's functional which is an improvement.
Renderdoc seems to somewhat require time units to be in float to be
able to present prettyfied results (ms/us/ns).
We were assuming that but a couple of errors slipped in :
* we were asserting that KHR time units are floats
* we didn't describe the renderdoc units as double (even though we
forced the conversion later on)
* The SPIR-V spec doesn't state what will happen, only that it's undefined. For
the sake of something sensible (and because it has a good chance of matching
at least some hardware) we use D3D's behaviour and set the value to 0xFFFFFFFF
- Add config to enable pixel history
- Fix several validation errors
- Fix primitive ID reporting when depth test is OFF
- Patch primitive ID and fixed color shader to output to the correct
framebuffer location when there are multiple color attachments
* On some GPUs (ARM Mali in particular it seems) when postponed resources are
prepared then immediately serialised the readback doesn't get the correct
data.
Renderdoc doesn't support TiledResource, as WrappedID3D12Device::CreateReservedResource returns E_NOINTERFACE. This commit reflects the lack of support in WrappedID3D12Device::CheckFeatureSupport.
This allows the application to behave as if the gpu doesn't support
tiled resources.
- Refactor to use common funcs
- Add per fragment depth data
- Rename pixelhistory.frag to pixelhistory_primid.frag
- Fix how some per fragment pipelines are created
For per fragment data we create 3 pipelines
1) Post modification pipeline
changes the stencil state and scissors around the target pixel
2) Shader output pipeline
in addition to above, disables rasterization discard, depth bounds test,
culling and turns off blending
3) Primitive ID pipe
in addition to above, disables depth test and depth write, and changes
the fragment shader to only output primitive ID
* Using a 32-bit integer, signed, gives only 2 billion chunks before it wraps.
With Vulkan/D3D12 creating new chunks even while in the background for
recording commands this is feasible to hit.
* Instead of reserving maxDrawCount number of draws then deleting the ones we
don't have, reserve only one and then duplicate it to patch up as needed. This
makes things much better in the case where maxDrawCount is significantly
higher than the actual draw count (when maxDrawCount is close to the real draw
count, this makes little difference).