Commit Graph

15925 Commits

Author SHA1 Message Date
Jake Turner 72ff41656f Fix incorrect assert for result.type in DXIL SetResult
Want to assert if members.empty() && type == Unknown
2025-05-18 09:25:34 +01:00
Jake Turner 3f8df6b589 Spirv Debugger GroupShared simulation changes
On the active thread
* GSM reads come from the local GSM cache (not the global GSM data)
* GSM writes go to the local GSM cache and the global GSM data
* Workgroup Memory barrier populates the local GSM cache with the data from the global GSM data

On the non-active threads:
* GSM reads/write always operate on the global GSM data
* Workgroup Memory barrier is ignored
2025-05-16 17:54:44 +01:00
baldurk 0fb918909e Fix ordered list editor to look up row instead of caching
* The widget was persistent so caching the row in the callback could lead to an
  invalid (or wrong) row being used.
2025-05-16 16:01:28 +01:00
baldurk ea19a5d20b Update build-shaderc to properly build on VS2022 with x64
* Add a helper script to build demos with VS2022 in release for shipping that
  link to shaderc. By default VS2015 won't link to it.
2025-05-16 16:00:56 +01:00
baldurk 1564c7f44e Handled typed pointers with bare scalar types not structs 2025-05-16 16:00:55 +01:00
baldurk 16ab38abde Set up array stride for BDA pointers in push space 2025-05-16 16:00:55 +01:00
Jake Turner 0ee04850c1 Spirv debugger ShaderViewer UI consistency fixes
* use a NULL before value when variables are recreated after going out of scope i.e. in a loop
* only add to the live list if m_State is not NULL (m_State can be NULL in EnterFunction() if HasDebugInfo() is false i.e. when called from EnterEntryPoint())

When generating variable changes from pointers:
* only include variables which are live
* do not include the base variable change in the list of extra changes
2025-05-14 18:11:05 +01:00
Jake Turner 8dcf051d99 Fine grained ShaderVariable comparison for ShaderViewer UI consistency 2025-05-14 18:11:05 +01:00
Jake Turner 47c64f607d ShaderVariable UI consistency check for duplicated variable change
Detect if a ShaderVariable has multiple changes per step
2025-05-14 16:28:37 +01:00
Jake Turner b53bd38828 Use correct nextInstruction value when generating callstack for inlines 2025-05-14 13:45:51 +01:00
baldurk b19c5b9f73 Prevent crash if programmatic capture happens after deleting swapchain 2025-05-13 15:16:42 +01:00
baldurk 2665c1f65c Add decoding of V2 pix markers 2025-05-13 14:11:42 +01:00
baldurk 71e607cf0e Use internal printf for decoding PIX event formats. Closes #3607
* The internal printf was already used for all numeric types but PIX of course
  has special encoding for strings so this was manually handled. Instead use the
  callback-based formatter and decode strings for there, so that varargs string
  length and string padding formatters are supported.
2025-05-13 14:11:42 +01:00
baldurk fc9999d67c Add support for varargs length in utf8 printf 2025-05-13 14:11:42 +01:00
zllangty 9fab650555 Add LoongArch64 support
With addition macros project able to build and run on LoongArch64 machine
2025-05-13 12:18:06 +01:00
Jake Turner 0e2cfde411 D3D11 GroupShared simulation changes
* On the active thread GSM reads come from the local GSM cache (not the global GSM data)
* This brings consistency in debugger UI when seeing the GSM data as variables (which is populated from the local GSM cache) and seeing the results of reading from the GSM data

GSM writes already populated the local GSM cache and the global GSM data
GSM Sync populates the local GSM cache with the data from the global GSM data
2025-05-10 12:00:05 +01:00
Jake Turner fc956fee61 Improvements to *_Groupshared tests
More checking of GSM local/global cache behaviour when debugging
One test is not GPU stable and its results are verified against hard coded expectation (this is to test the expected behaviour of the local GSM cache on the active thread)
2025-05-10 11:49:43 +01:00
Jake Turner 370334ca6e Do not do ShaderViewer UI consistency checks in RELEASE builds 2025-05-09 13:27:10 +01:00
Jake Turner 3408a3be86 Null out "before" change completely not just clear the name 2025-05-08 16:08:25 +01:00
Jake Turner 6b39f8de88 ShaderViewer UI error checks for consistency in ShaderVariableChanges
Step Forwards: first appearance of a variable must have "before" = {}
Step Forwards: not-first appearance of a variable "before" must equal currently known value

Step Backwards: first appearance of a variable must have "after" = {}
Step Backwards: not-first appearance of a variable "after" must equal currently known value
2025-05-08 16:06:35 +01:00
Jake Turner 1598abfa3b Manually record ShaderVariableChange's for Load/Store/Atomic operations 2025-05-08 16:06:35 +01:00
Jake Turner 28a5ae4b01 Do not record ShaderVariableChanges or any results from DXC nop's 2025-05-08 16:06:35 +01:00
Jake Turner 4940451e4b Make sure all SSA lifetimes extend to a uniform block (not a loop block)
* Update any SSA max points which are inside a loop to the next uniform block
* This covers the case of SSA IDs that are assigned to but never accessed
2025-05-08 16:06:35 +01:00
Jake Turner d48f217119 Tweak D3D12_Resource_Mapping_Zoo sig_resourceAccess UAV entries
Use UAV handles (20, 21) for the UAVs instead of SRV handles (56, 57)
2025-05-08 16:06:35 +01:00
Jake Turner a55884043a Simplify MarkResourceAccess() to give consistent ShaderVariableChange 2025-05-08 16:06:35 +01:00
Jake Turner 41eb7483cc Match disassembly SSA ID names for annotated resource handles 2025-05-08 10:25:00 +01:00
Jake Turner dbe2d9dd2e Fix D3D12_Shader_Debug_Zoo CS failing test 2025-05-08 10:21:27 +01:00
Jake Turner 5169d808bc DXIL Debugger support for partial convergence blocks
Example HLSL construct that is correct after this change (and incorrect before this change)

if (id >= 2 && id <= 20)
{
...
}
else
{
... <THE CORRECT THREADS MERGE HERE INTO A SINGLE TANGLE>
}
2025-05-07 12:17:18 +01:00
Jake Turner ecc4fcc8d5 DXIL ControlFlow support for generating points of partial convergence
Also tweaked DXIL ControlFlow GraphVis output

Generate the graph in a string for use with RDCLOG or writing to a file
Changed (full) convergence nodes to be blue rectangles
Partial convergence nodes are rounded green rectangles
Partial convergence edges are green dashed lines

FIXUP GENERATE PARTIAL CONVERGENCE
2025-05-07 12:16:37 +01:00
Jake Turner a6f47d3061 Shader ControlFlow only add new merge points
Previously it would only test against the head of the existing merge points, now checks the whole array
2025-05-07 12:15:24 +01:00
Jake Turner 033a4d1e5a First version of python for *_Groupshared tests
Verify outval shader debugger variable matches the real generated data in outBuf
2025-05-07 12:12:57 +01:00
Jake Turner bd2061c21c Fix DXBC Debugger writes to GSM structured data 2025-05-07 11:56:25 +01:00
Jake Turner fbb39b21a6 Extend D3D12 Shader Debug Zoo GSM tests
struct TestStruct
{
  uint3 a;
  uint3 b;
};

groupshared int gsmInt;
groupshared TestStruct gsmStruct[8];
groupshared int gsmIntArray[128];
2025-05-07 11:18:14 +01:00
Jake Turner 7d35635844 Only default activate lane zero for SPIRV single threaded compute debug
Workgroup and Subgroup compute debug will set lane Active/SubgroupId properties for all threads
2025-05-07 11:15:05 +01:00
Jake Turner 2fbf85fad1 Divide up tests between Workgroup_Zoo and Subgroup_Zoo
Subgroup_Zoo : unit tests, non-trivial convergence tests moved to Workgroup_Zoo
Workgroup_Zoo : convergence tests, small number of unit tests (not full coverage)

Added checks for workgroup convergence in Workgroup_Zoo tests
* Vulkan uses barrier()
* D3D12 uses AllMemoryBarrierWithGroupSync()
* dispatches workgroup of 2x1x1
* test debug results for workgroup 1,0,0
2025-05-07 11:05:55 +01:00
Jake Turner 79e80c8337 Added assert for Op::ControlBarrier that the workgroup is converged
New helper method ThreadState::WorkgroupIsDiverged()
2025-05-07 11:03:20 +01:00
baldurk c945293b3e Add sanity checking strict mode to build scripts 2025-05-06 12:42:23 +01:00
baldurk 4dbcfca343 Fix reflection of structs containing 16-bit types. Closes #3605
* It is impossible to emit a true 16-bit type on fxc, the minXX types we round
  up internally to a 32-bit type since that's how they are defined to appear in
  external resources like cbuffers and SRV/UAVs.
* The new 16-bit type enums that are shared between fxc/dxc structs are not
  actually ever emitted by fxc for RDEF types.
2025-05-05 14:49:24 +01:00
baldurk 62be3340a5 Check more carefully if DX11 maps are intercepted properly. Closes #3603
* Maps are recorded as open whenever we intercept them, usually only falling off
  for high traffic resources or direct maps like WRITE_NO_OVERWRITE.
* Unmaps can be successful any time as long as they're intercepted as reads (no-
  op) or write discard (since we just need to intercept these).
* Unmaps from other write types require a map during an active capture to ensure
  we properly set up shadow pointers.
2025-05-05 12:42:28 +01:00
baldurk 2288237723 Early detect and error when launching reserved filenames for capture
* This is a safety measure to ensure we never add hooks to system processes, so
  we should detect this case earlier and error for the user.
2025-05-05 10:49:42 +01:00
baldurk 9673a5571c Don't silently drop working directory, print error if it doesn't exist 2025-05-05 10:49:01 +01:00
baldurk f9c1ae7944 Fix installer script referencing missing entry 2025-05-03 22:03:21 +01:00
Camden Mannett 7a551bcfc2 Add AS descriptor handling in vkCmdPushDescriptorSetKHR
Closes #3598
2025-05-03 15:45:49 +01:00
baldurk bb10ae25bb Bump version to v1.39 2025-05-02 15:07:38 +01:00
baldurk 34c3c40787 Document the PDB search priority/algorithm
* This follows PIX's algorithm in most places which although undocumented is
  something many people expect to work. It deviates only when there would be
  significant performance penalties for little gain.
v1.38
2025-05-02 10:48:10 +01:00
baldurk a8a14bc317 When possible reject aliased pdb names using HASH 2025-05-01 15:40:23 +01:00
baldurk f5506fcec3 Workaround of pixel history crash with depth-only UAV writes 2025-05-01 10:36:07 +01:00
Jake Turner df08881ef2 Add asserts to check for out of bounds GSM variable access 2025-04-30 11:59:03 +01:00
Jake Turner 35f91b2575 Compute GSM raw variable declaration element count from byte count 2025-04-30 11:59:03 +01:00
Jake Turner cf879397bd Fix incorrect indexing when getting GSM Register Index 2025-04-30 11:59:02 +01:00