* We also add the ability to toggle on/off the replacement being active without
needing to intentionally add a compile error (and this also makes it more
explicitly clear when the shader replacement is enabled or not. This could be
useful for quick A/B testing between the edited version and the original.
* We also add some extra debug asserts after the fixup path to ensure that all
pointers are in the correct array (if we miss passing the old/new function for
a value fixup like this, it could point to the old function and be silently
ignored since that's conditional).
* A unit test harness is added too for convenience of iterating on a single
shader's annotation.
* Previously the vertex picking was always being done in NDC space, but now for
perspective projections we unproject into world space and raycast there for
more reliable results with unsual projections.
* If we're replaying state set before a pipeline is bound we don't know which
values are dynamic so conservatively we set them all. This means the state can
be anything by default as long as it's legal - if it doesn't come from a
previous dynamic state set its value is irrelevant.
* MSVC gives each variable in the switch/case its own stack space, which means
this function needs a bunch and if we serialise a long pNext chain (like
device features) we can easily overflow the stack.
* I didn't check release, my suspicion is that this isn't an issue there, but
the workaround is small so it's still useful to do.
* This is a stupid requirement as the quad overdraw shader doesn't use any
interpolators, but the D3D12 runtime complains and refuses to create a PSO
unless the PS has a matching signature. This works as long as the position was
the first output from the previous stage, but if it isn't the PSO fails to
create.
* To fix this, we take the existing shader and patch it by grafting the output
signature from the last stage over onto the input signature, and patching up
where the position is.
In some cases it is easier to know the dispatch thread ID you want to
debug rather than the group/thread IDs. This change adds a new window
when the debug button is clicked, to allow you to specify which thread
to debug in the most convenient way.
* Historically we always expected a live resource, but with descriptors that can
be stale we can have a lot of queries where it's fine to just get NULL back if
the resource doesn't exist.