Commit Graph

10228 Commits

Author SHA1 Message Date
Steve Karolewics c56373ed94 Add impls of GetBuffer/ResourceInfo for D3D12 shader debugging 2020-02-21 17:56:33 +00:00
baldurk 9d3e4dc5e7 Add a deny flag when necessary on tier 1 heap devices 2020-02-20 23:32:33 +00:00
baldurk cf3153f238 Use isinf() instead of finite() 2020-02-20 20:02:49 +00:00
baldurk 6b28d14089 Add source variables for named IDs where possible 2020-02-20 19:07:30 +00:00
baldurk 5ae8fc1ed7 Implement load/store through access chains and composite swizzles
* This is enough for very simple shaders. We add a utility function for setting
  values and handling pointer changes.
2020-02-20 19:07:30 +00:00
baldurk 5fee776a52 Allocate function variables in stack frame, and copy function parameters 2020-02-20 19:07:29 +00:00
baldurk d0ff4f27aa Start iteration of SPIR-V opcodes
* Currently the only flow control we handle is function calls and returns,
  ending the thread when we return from the entry point.
2020-02-20 19:07:29 +00:00
baldurk ffbb9a353a Set up instruction list when parsing SPIR-V 2020-02-20 19:07:29 +00:00
baldurk 013ea145d4 Populate constants in global state for vulkan debugging 2020-02-20 19:07:29 +00:00
baldurk 7f38c690d8 Populate input and output variables in SPIR-V debugging 2020-02-20 19:07:29 +00:00
baldurk b4b100004f Support SPIR-V pointers with our own pointers
* When we need a SPIR-V pointer we box up a real pointer to a ShaderVariable,
  and optionally column/scalar selectors if it's a pointer to a scalar within a
  vector or matrix.
* For globals in opaque storage classes we'll allocate our own ShaderVariables
  so that we can safely keep pointers to them. Otherwise IDs of temporary
  pointers (from OpAccessChain) should always be a strict subset of the lifetime
  of the ID it's pointing to, so we can keep the pointer around. The variables
  don't move and are persistently allocated so they won't be relocated from
  under us (we pre-allocate space for the IDs).
* Before passing back a ShaderVariable to the outside world, we evaluate its
  current value. Thus pointers are presented as if they are just variables that
  happen to update when their parent does.
2020-02-20 19:07:29 +00:00
baldurk c4037e9246 Enable vulkan shader debugging on a hidden config setting 2020-02-20 19:07:29 +00:00
baldurk 5ef3a25f7f Add skeleton of SPIR-V shader debugging class 2020-02-20 19:07:29 +00:00
baldurk c23825292d Remove redundant instOffset/vertOffset parameters from DebugVertex() 2020-02-20 19:07:29 +00:00
baldurk de7f9d8e1c Remove hasSourceMapping from ShaderDebugTrace
* We expect to always have source mapping, from reflection data if nothing else.
2020-02-20 19:07:29 +00:00
baldurk 08e9d9b594 Fix typo - don't apply debug variables expansion to source vars 2020-02-20 19:07:29 +00:00
baldurk 3baedb966e Don't add a value representation for matrix/struct/array debug variables 2020-02-20 19:07:29 +00:00
baldurk b0e4cd6235 Handle matrix registers in shader viewer 2020-02-20 19:07:28 +00:00
baldurk d58691bc16 Standardise debug and source variable naming conventions
* 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.
2020-02-20 19:07:28 +00:00
baldurk 04c335a9ff Move reflection helper functions to spirv_common.h 2020-02-20 19:07:28 +00:00
baldurk 49ad6ddaf6 Move EvaluateConstant to rdcspv::Processor so it can be shared 2020-02-20 19:07:28 +00:00
baldurk 19cb3c7cb3 Move SpecConstant to a common header for re-use 2020-02-20 19:07:28 +00:00
baldurk 18e10457df Store mapping from SPIR-V offset to disassembly line
* This will be used in debugging, but it's easier to store it at the same time
  as we disassemble.
2020-02-20 19:07:28 +00:00
baldurk 44e0269672 Force shader recompile to patch gl_DrawID in GL vertex output fetch 2020-02-20 19:07:28 +00:00
baldurk 2a348c3309 Identify gl_BaseVertex/Instance and gl_DrawID as builtin parameters 2020-02-20 19:06:32 +00:00
Steve Karolewics dfbe7fb6bf Remove primitive ID usage from pixel shader debugging when invalid
SV_PrimitiveID is only valid as a pixel shader input if there's either
no geometry shader, or the geometry shader emits SV_PrimitiveID. With
D3D11, the debug layer will complain but rendering will proceed. With
D3D12, the PSO fails to compile. For both APIs, pixel shader debugging
now checks whether this is true, and disables its usage if it isn't.
Added tests for various valid scenarios with SV_PrimitiveID.
2020-02-20 19:06:22 +00:00
baldurk 6f1818e91c Completely disable buggy Rivatuner layer 2020-02-19 21:55:35 +00:00
baldurk 083aeb063a Don't add drawcalls for glCopyBufferSubData from before frame capture 2020-02-19 21:03:51 +00:00
baldurk 1e8c24fa56 Remove debug print 2020-02-19 11:33:51 +00:00
baldurk 579b1893c7 Make sure out-of-order resume replies are processed in JDWP 2020-02-18 23:49:26 +00:00
baldurk 454d03a28e Fix tautological compare 2020-02-18 20:47:57 +00:00
baldurk e7d1d5a3a1 Fix bad index in comparison 2020-02-18 19:34:49 +00:00
baldurk b377d70b1d Add helper function to compare resource/sampler operands by identifier 2020-02-18 19:18:51 +00:00
baldurk 83d77ea543 Improve formatting of Iter_Test output 2020-02-18 19:18:51 +00:00
baldurk f2c401a255 Check that all states are present before allowing any stepping 2020-02-18 19:18:51 +00:00
baldurk 21b7168d5c Use pixel size not point size for global font scaling 2020-02-18 19:18:51 +00:00
baldurk 295d3958dd Refactor D3D11 pixel history to use buffer output instead of texture
* This removes the requirement that the colour output format be UAV-compatible.
* It also makes addressing simpler and removes the requirement for
2020-02-18 19:18:51 +00:00
baldurk 90d0f747fe Delete GPUPerfAPI table if GPA_GetFuncTable fails 2020-02-18 19:18:51 +00:00
baldurk d7c728fcad Add more error logging when GCN DXBC ISA generation fails 2020-02-18 19:18:51 +00:00
Steve Karolewics 905aacafd0 Migrate DebugAPIWrapper resource info functions to binding slots
With SM5.1, the operand for instructions like resinfo provide two
indices - the logical identifier and the shader register. Lookup the
identifier to convert to binding slot.
2020-02-18 19:18:31 +00:00
baldurk 12844b9213 Add support for VK_KHR_shader_non_semantic_info 2020-02-17 15:19:45 +00:00
baldurk 7dd38b49d7 Update vulkan headers to 1.2.133, SPIR-V metadata to latest 2020-02-17 15:17:52 +00:00
baldurk dd87b9c48a Handle out-of-order JDWP reply packets when resuming 2020-02-17 15:11:51 +00:00
baldurk 7303c54870 Set quality to 0 when making array equivalent of MSAA texture 2020-02-15 00:33:06 +00:00
baldurk f7cb742a4c Display capture file size in capture connection window. Closes #1723 2020-02-14 19:31:59 +00:00
baldurk 4241e0ec55 Batch up calls to GetBuffers/Textures to be more replay proxy friendly 2020-02-14 19:31:59 +00:00
Steve Karolewics 58b1186362 Fix resource bindings when reflection info is stripped
The logical identifiers, rather than shader registers, were used to
populate reflection info, causing the wrong slots in large descriptor
tables to be referenced for the pipeline state.
2020-02-14 10:39:28 +00:00
baldurk 5977c2ef37 Fix compilation 2020-02-13 12:45:51 +00:00
baldurk 7d4685fc17 Fix exception catch-and-rethrow in extension BlockInvoke. Closes #1721 2020-02-13 11:01:45 +00:00
baldurk 5e6ec417c1 Add a global font scale option in settings window
* This lets the user override the default application font.
* Unfortunately Qt seems to behave inconsistently with font scaling from the
  system, so we take the font size initially from QApplication::font() (which
  doesn't always pick up the font size) and scale from there. While this might
  cause some font scaling to be lost it does mean at least we have a consistent
  scale, as otherwise you get some text scaling and others not.
2020-02-13 11:01:45 +00:00