* Undefined values are still 0xccccccccc, since that value can propagate through
operations. But source variables mapped directly to an OpUndef are displayed
in a more semantically clear way.
* In a previous update in 2021 many copyright ranges were truncated
accidentally, and some files have been copy-pasted with wrong years. These
dates have been fixed based on git history and original copyright messages.
* This shifts from reporting from the old style bindset/bind to the new system
of only referencing by shader interface and index (independent of binding
model).
* The vulkan shader debugger re-uses the replay interface to cache descriptor
access and descriptor contents in a fashion friendly to interface-index
lookup.
* We store the compiler used (when known) in shader debug info and use that to
select the compiler for editing as even higher priority than the default for a
given language/encoding combination.
* We also ensure that for known tools we add the input and output parameters
last, after any custom parameters, so that they are always present regardless
of what the user puts in.
* This allows us to more accurately display those that have been modified since
the last step, when a source-level step covers multiple instruction-level
steps.
* We also do our own sorting of source variables based on how recently they were
updated. This applies in both directions, so stepping backwards and
'reversing' a variable change will also count as a recent update.
* Since the source vars data doesn't change for a given instruction, we can pre-
calculate it and save time on re-calculating per-state.
* Note callstack *can* change per-state on SPIR-V where the same instruction can
be reached by different flow paths, so the callstack remains part of the per-
state data.
* We entirely skip over any instructions that don't have a source mapping. These
are assumed to be filler instructions or others that don't correspond usefully
to anything in the source.
* Newly written shaders and any updated shaders can now use pre-defined macros
to abstract away binding differences between APIs, so custom shaders will be
more portable in particular shaders written in HLSL for D3D or GLSL on OpenGL
won't break on vulkan because they refer to incorrect binds.
* 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 split stepping for source debugging into step over/into/out depending on
how it handles function calls. Step Into is the same behaviour as before - it
steps to the next source line executed regardless of if it's inside a function
call. Step Over is similar but will not enter function calls. We define that
as the callstack growing (so staying the same or shrinking - returning from a
function - is OK), and this is as accurate as the underlying debug
information. Step Out will run until the callstack shrinks, i.e. returning
from a function.
* This is a slight behaviour change of keyboard shortcuts - F10 was effectively
doing step into and will now step over. F11 will step into which is the old
behaviour.
* All these variants have backwards versions, and to remain consistent we keep
the shift modifier as forwards/backwards. This differs from visal studio where
step out is shift-F10.
* The seems like the best balance - using any other variant would likely confuse
muscle memory of anyone used to visual studio (where these shortcuts are
intended to mimick), if only because F10 would be step into whether or not F11
is used for step over or some other key which would likely be even more
confusing either way. Trying to twist to use Shift-F10 for step out would be
inconsistent with the other backwards running operations and likely cause more
confusion than it saves in matching VS's shortcuts exactly. Also an accidental
Shift-F10 is not too destructive, the user can realise it didn't Step Out
forwards, and press Ctrl-F10 or look up the button.
* The hope is that most likely people doing source debugging and familiar with
these keys expect F10 to step over, so the previous behaviour was unexpected
but easy to work around, and that changing the meaning of the key won't
disrupt them. Or at least the disruption is less than other alternatives.
* Also added a script that can run as part of CI to verify that the docstring
matches, by generating a regex from the docstring documented parameter types
and return type and making sure we find a match within the C headers. This
ensures all parameters are documented with the right types, no extra
parameters are documented, and the return type is correct.
* The script also checks proper scoping so that if qrenderdoc docstrings
mention a renderdoc type, they need to scope it properly.
* For vulkan debugging where high-level variables are not scattered amongst
vectors, there's no point in having the whole tree expanded for source mapping
struct-to-struct or array-to-array.
Previously this data was a reference to the current pipeline state, so
when the selected event changed, the ShaderViewer's bindpoint mappings
would be inaccurate.
When a resource is accessed, it is now tracked by the debug step. The
shader viewer has a new panel to display resources accessed up to the
current step, with context menus to go to previous/next access of a
specific resource.
* We standardise on definitions: source variable names contain the full path,
and identify debug variable by full path. Debug variable members only contain
the child element - so foo doesn't contain members foo[0] or foo.bar, it
contains [0] or bar. Path walking happens when mapping source variable to
debug variable.
* This works just as well for DXBC but works much better for SPIR-V where debug
variables can be more complex.
* The ShaderDebugTrace now only sets up the initial state of an opaque
ShaderDebugger handle.
* This handle can then be passed to a new function - ContinueDebug - to
iteratively return N more states. The number of states is implementation
defined and may be a fixed number or it may run for a fixed time.
* The states themselves no longer contain a complete snapshot of all variables,
but instead only the changed variables for that iteration. The changes are
stored as before and after value to make it easier to step forwards and
backwards (only the ShaderDebugState is needed to move forward or backwards,
you don't have to search back for the last set value of a variable to 'undo' a
change).
* The shader viewer shouldn't handle specifics of D3D bytecode, instead it now
works generally with whatever the debug and source variables are.
* VarType::Unknown is used for D3D registers which are typeless.
* cbuffer and input registers no longer have any names elided into them, they
are 'raw' registers. The source mapping provides the information of where they
come from as best as possible.
* Since we're now using source-mapping for constants, fix some source mapping
issues with arrays, nested structs/arrays, and matrix major-ness.