Commit Graph

15524 Commits

Author SHA1 Message Date
baldurk e692c30a05 Handle 16-bit types not being supported in demos project 2025-01-14 12:07:24 +00:00
baldurk 3c5ce8a84a Remove unused API function
* Headless windows are used as immutable in tests so allowing resizing is
  unnecessary complication
2025-01-13 11:09:10 +00:00
baldurk f3f0617b37 Do extremely stupid version checking to workaround dxc nonsense in tests
* On a new enough dxc we can pass a flag to tell it to ignore dxil.dll
* This allows the tests to run on the test machine with an old windows SDK
  (where the demos project copies the dxcompiler.dll + dxil.dll from) but still
  pull in a new dxcompiler.dll without having it break on an old dxil.dll
2025-01-13 11:02:22 +00:00
baldurk cd84566b1c Fix case where PreprocessLineDirectives could eat preamble before #line
* This would happen if a #line referenced the file it was already in - we would
  only start outputting lines starting from the first one. Normally in this case
  there's a #line before any text, but that's not guaranteed.
2025-01-10 15:51:26 +00:00
baldurk 2e3a54b9d0 Fix 64-bit type casts on linux 2025-01-10 14:21:26 +00:00
baldurk b46b8d96cf Prefer using custom D3D12/ local dxcompiler.dll in demos project 2025-01-10 11:29:28 +00:00
baldurk f6c016245e Fix indexing and dimension calculation for non-square matrices in DXIL 2025-01-10 11:20:32 +00:00
baldurk 7f294a7e68 Handle anonymous structs in DXIL 2025-01-10 11:20:18 +00:00
baldurk d526a1a076 Don't re-cache same types if AddDebugType is called again 2025-01-10 11:20:00 +00:00
baldurk d4ecc62684 Update GPUVA tracker API to only take address & ID for removal
* Size is not always set on removal and we were accidentally relying on it in
  the implementation.
2025-01-09 17:01:26 +00:00
baldurk 9582c1b624 Update GPUVA tracker to keep a list of overlaps
* This allows us to better return a valid mapped resource for an address even in
  the case of overlaps/aliasing which might otherwise 'hide' a larger buffer.
2025-01-09 17:01:26 +00:00
baldurk 14f238247b Add unit tests to GPUVA tracker and keep implementation private 2025-01-09 17:01:26 +00:00
baldurk 91e69bb0dd Improve assert on invalid nested chunk serialisation 2025-01-09 17:01:26 +00:00
Jake Turner 6b1b2fb7da Document DXIL Debugger memory allocation and pointer implementation
Renamed some containers to distinguish between real memory allocations and pointers to within an existing memory allocation

Replace some asserts with if's as part of defensive coding
2025-01-08 15:58:57 +00:00
Jake Turner 4b35fbcc96 Rationalise DXIL debugger instruction indexes
Use m_ActiveGlobalInstructionIdx instead of m_GlobalInstructionIdx
Removed m_GlobalInstructionIdx
2025-01-08 12:17:43 +00:00
Jake Turner a98d0a403f Improve DXIL callstack generation
Resolve debug scopes in a separate pass before callstacks
Walk callstacks using DILocation (DebugLocation) data (dwarf scopes and inlinedAt data)

For each DILocation
Walk scope upwards to fill in the callstack (always a dwarf scope)
Make new DILocation from inlinedAt and walk that DILocation
2025-01-08 10:29:10 +00:00
Jake Turner 1c7deb7df7 Extend handling in GetFunctionScopeName()
Now supports passing in:
DISubprogram
DILexicalBlock

In addition to existing support for:
DILocalVariable
DIGlobalVariable
2025-01-08 10:29:10 +00:00
Jake Turner 1c8766bd85 Expand out DXIL Debugger RDCASSERT's which were using ^ 2025-01-08 10:29:10 +00:00
Jake Turner 10500d0327 Use the baseEventID for checking if a glMultiDraw* is valid
Prevents driver crash is invalid data is passed to glMultiDraw* i.e. no vertex buffers.
2025-01-08 10:29:10 +00:00
baldurk 898e4e0028 Fix missing queue use in FlushLists call 2025-01-08 10:25:50 +00:00
Elliot Saba e6b4de8138 Android: Automaticaly add MANAGE_EXTERNAL_STORAGE permission to apps
This prevents the user from needing to click through a permission
granting screen on their device before the agent is able to run on the
device, but only does so if the API level is >= 30 (where this
permission has effect at all [0]) and if a particular property is set on
the device (`debug.renderdoc.autograntpermissions`) so as to avoid
potential pitfalls on unusual Android devices.

[0] https://developer.android.com/reference/android/Manifest.permission#MANAGE_EXTERNAL_STORAGE
2025-01-07 20:28:26 +00:00
baldurk 64c77e917e Be more consistent and conservative with GPU syncing on D3D12
* In some cases we were only syncing one queue when we needed to flush and sync
  the whole GPU. Rename functions to be more clear about what is being synced,
  and only sync one queue/our internal queue when we know that's the only work
  we need to wait on.
2025-01-07 16:54:52 +00:00
baldurk 74a6e28f5a Improve ability to redeclare buffer formats from struct definitions 2025-01-07 16:11:32 +00:00
baldurk 7edcbfbdbc Fix bitfields not being resolved before structure uses 2025-01-07 15:10:44 +00:00
baldurk 79be74a8ec Only modify bitfield properties if bitfields are active 2025-01-07 14:43:19 +00:00
baldurk 980b6a8bf0 Add test of SM6.7 bitfield reflection 2025-01-07 13:43:45 +00:00
baldurk 2d86fe6b12 Ensure log output is clean when listing available demos 2025-01-07 13:43:45 +00:00
baldurk 4d4fbdcaa3 Demos project loads D3D12.dll relative to exe not CWD 2025-01-07 13:43:45 +00:00
baldurk f04e574cda Recalculate offsets for structured buffers on DXIL
* The offsets provided in the reflection data are garbage :(
2025-01-07 13:19:28 +00:00
baldurk 73b52dafb8 Resolve pending bitfield packing before applying specified field offsets 2025-01-07 13:19:28 +00:00
baldurk 55d939cdd8 Respect bitfield packing when generating format string for struct 2025-01-07 13:19:28 +00:00
baldurk 6261cb42d3 Fix missing indent for declared buffer structures 2025-01-07 13:19:28 +00:00
baldurk 49b2d16616 Reflect bitfield information out from DXIL data 2025-01-07 13:19:28 +00:00
baldurk ada407ca56 Fix breakpad compilation on recent VS2022 2025-01-07 11:49:18 +00:00
Jake Turner 233f7d1b97 DXIL Disassembly include DebugValue, DebugDeclare parsing 2025-01-06 19:53:29 +00:00
Jake Turner ab9db02608 Make unsupported DXIL Constant Op be an error instead of log 2025-01-06 14:44:13 +00:00
Jake Turner b370ba10d6 Ignore source mapping for LLVM debug, lifetime, invariant instructions 2025-01-06 14:44:13 +00:00
Jake Turner 80e4d5e1a6 Support for DXIL Constants created using GetElementPtr
Stop ignoring DXIL global variables which start with "dx.nothing."
Do not process constants from instructions which are counted as a nop by the simulation
2025-01-06 07:35:29 +00:00
Jake Turner 853097d554 Ignore member tags that are not DW_TAG_member
Defensive code for in case member->name is NULL
2025-01-03 15:20:41 +00:00
Jake Turner 03826a748b Fix wrong format specifier in DXIL debugger error message 2025-01-02 16:35:48 +00:00
Jake Turner 8ba666f0a9 Improve DXIL BufferStore/TextureStore out of bounds handling
For texture data the maximum number of components to store comes from the format
For non-texture data the maximum number of components is four which is then clamped to stop buffer overrun (by data size or offset)
2025-01-02 13:09:24 +00:00
Jake Turner 75aeb4820a Add a D3D12 Shader Debug Zoo test for writing to an int[1] buffer
Extends debugger coverage for handling read/write buffer bounds
2025-01-02 13:09:24 +00:00
Jake Turner f3bb7523b5 Reset the controlType current index to 0 in the BufferViewer constructor
This keeps the UI display in sync with the code internal settings for camera choice i.e. FlyCam/ArcBall. During the constructor, the UI setup for the different axis mappings will call on_resetCamera_clicked() and that can change the controlType current index value to be different from the expected/desired default value of 0.

Closes#3509
2025-01-02 09:44:54 +00:00
Jake Turner 5cda9752e0 Display the D3D12 IA indexStripCutValue in UI control "Restart Idx"
Previously "Restart Idx" was hardcoded to 0xFFFFFFFF
Show "Disabled" if the indexStripCutValue is D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED (0)

Similar UI behaviour to the GL pipeline state viewer

Closes#3508
2025-01-02 09:44:10 +00:00
Jake Turner 71b6ed09e5 Improve DXIL ControlFlow detection of loop blocks
Now handles finding all loop blocks in a loop where a block (2) in the loop is only in a single path:

0 -> 1 -> 3 - 1
0 -> 1 -> 2 -> 3
3 -> 4 -> END
2024-12-30 12:07:24 +00:00
Jake Turner da9207bc13 DXIL ControlFlow Unit Test for specific loop construction
A loop where a block (2) in a loop is only in a single path
0 -> 1 -> 3 - 1
0 -> 1 -> 2 -> 3
3 -> 4 -> END
2024-12-30 12:07:23 +00:00
Jake Turner 06cf587041 Defensive code fix to prevent out of bounds memory during DXIL debugging
GetElementPtr and UpdateMemoryVariableFromBackingMemory
2024-12-30 12:07:23 +00:00
baldurk 3bafceb97e Bump version to v1.37 2024-12-20 17:23:33 +00:00
baldurk e690587683 Update docs for D3D12 shader debugging v1.36 2024-12-20 12:03:34 +00:00
baldurk 47dcef3062 Remove spammy debug log 2024-12-20 10:45:15 +00:00