Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Chris B 37ed613864
[NFC] Clang-format DXC sources (#5602)
This change applies clang-format to all of the sources added in DXC that
were not part of the original LLVM/Clang 3.7 release when DXC forked.
This provides consistent code formatting across the codebase.

Fixes #5591.
2023-09-19 07:49:22 -05:00
Jeff Noyle 3693755da6
PIX: Updates to shader debugging pass to support DXR hit groups/miss shaders (#5499)
Two main themes:
-Add instrumentation to the DXR hit group and miss shader types
-Return a bit more info to the caller (PIX) via output text
2023-08-10 12:49:36 -07:00
Jeff Noyle ccea7c23c1
PIX: Fix instrumentation of libraries; instruction numbering reports (#4817)
* PIX: A few fixes for instrumentation of libraries; instruction numbering reporting

* Fix for tests: don't debug-instrument the patch constant fn
2022-11-28 09:31:41 -08:00
Nathan Gauër d6eb722516
build: fix include in header files. (#4652)
Building DXC with another build system revealed that some includes
were dependent on headers only available by chance. Adding missing
headers.

Signed-off-by: Nathan Gauër <brioche@google.com>

Signed-off-by: Nathan Gauër <brioche@google.com>
2022-09-15 16:00:29 +02:00
Jeff Noyle d23ede6fc5
PIX: Changes to run PIX passes on libraries. Also add raygen shader debugging prolog (#3985)
These changes are a result of prototype work in PIX to support shader debugging for DXR,, which was an exercise to figure out how to support libraries in general in PIX. These changes are the result. It's all about iterating over all the library functions, rather than "the" entry point function.
In addition, to have something concrete to submit to a driver, there's the addition of codegen for the shader debugging "prolog", which chooses at runtime whether or not to emit instrumentation data for a given shader invocation based on its (in this case) thread id. This last is not yet ready for production in PIX, in that it is necessary but not sufficient to enable DXR shader debugging.
2021-10-04 15:37:50 -07:00
Jeff Noyle 5d63d48f44
PIX: Add thread ID to amplification shader payload (#3904)
This change is required to enable PIX to reconstruct mesh shader output data correctly. Without knowing the thread id of the AS thread that launched the mesh shader threads, we don't know which probably-a-mesh to attribute each MS's output to.
2021-08-13 14:04:46 -07:00
Jeff Noyle ad4a3ea924
PIX: Entry point can be null for DXBC->DXIL hull shader (#3805)
This is a bit of a corner-case, but PIX tripped up on it while capturing an app under d3d11on12.
PIX is probably the only client who cares about this case, since it's only relevant when DXBC->DXIL has been run (e.g. 11on12), and then examined via reflection and/or the PIX-specific passes.

Here's the entry-point metadata provided by DXBC->DXIL for a representative case. It has a null entry point, but a non-null patch-constant function:

!dx.entryPoints = !{!7}
!7 = !{null, !"", !8, !2, !24}
!24 = !{i32 0, i64 256, i32 3, !25}
!25 = !{void ()* @pc_main, i32 3, i32 3, i32 2, i32 3, i32 3, float 0.000000e+00}
(Documentation of DXBC->DXIL's operation in this case is here: https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst#hull-shader-representation)

(PIX bug #32030124)
2021-05-28 14:23:24 -07:00
Jeff Noyle e46fa6b4f3
PIX: Find correct type of struct members, add instructions only after phi nodes, add logging (#3786)
This fixes two issues found in a very large shader from a partner ISV.

Some background: PIX runs this value-to-declare pass that turns dbg.value into dbg.declare plus a "fake" store to an alloca that PIX can later note as part of its debug instrumentation. This requires building up a map of struct members to these allocas.

First issue: during this pass, any dbg.value that referred to a type tagged with DW_TAG_member was assuming that the type's base type was actually the base type. It's not: it's the containing type, together with an offset and bit-size. So this change adds code to go find the actual type at that offset in the containing type. Previously, the pass was breaking in the validator because it was creating bit-pieces (in the newly-added dbg.declares) that overlapped the end of the containing type.

Second issue: a previous PR (#3746) fixed a bug wherein the new fake stores were being inserted before the values were actually defined. That PR failed to maintain the convention that phi instructions must always be listed in a contiguous section at the start of any basic block. While this convention is not enforced by the validator, the nvidia driver has a hard dependency on this convention and will crash if it is violated.

Lastly, figuring out these sorts of things always takes days and days of staring at 680k instructions (as in the shader that provoked these bugs) trying to find the wrong one. I know I'll be doing this all again, so I've added some in-but-off logging and struct dumping that is much easier to follow and to use than calling .dump() from the immediate window in VS.
2021-05-21 16:33:37 -07:00
Jeff Noyle ea1efe96ba
PIX passes: Centralize handle-generation code and update for 6.6 (#3628)
This is little more than a move of the "create-uav" code in lib/DxilPIXPasses/DxilShaderAccessTracking.cpp to PixPassHelpers.cpp, followed by a factoring-out of the parts that create a handle (either pre-SM6.6 fashion, or with the newer create-from-binding etc.).
All the other passes' near-identical code was then deleted and made to call the centralized function.
2021-03-26 12:55:08 -07:00
Jeff Noyle ade0e24792
PIX: Shader debug: don't instrument ray query handles (#3434)
* checkpoint

* Move helper to new file

Co-authored-by: Jeff Noyle <jeffno@ntdev.microsoft.com>
2021-02-10 13:35:06 -08:00