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

20 Коммитов

Автор SHA1 Сообщение Дата
Jeff Noyle 1fefbc429b
Fix a PIX pass's attempt to set the validator version (#6707)
This pass was attempting to compare different things. The return values
of GetDxilVersion are not shader models, but... dxil version. Since the
code is trying to upgrade the validator version, I changed this to
GetValidatorVersion, to pair with SetValidatorVersion.
The previous code was breaking the nvidia driver on workgraphs.
2024-07-01 12:58:55 -07:00
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 1598cd8bd2
Pix: Shader debug speedup (#5666)
Two related things:
-Move value/store annotations before instruction number annotations so
that we can avoid giving instruction numbers to the allocas that the
value-to-declare pass adds, since they are only there to implement PIX
shader debugging and do not need to be debugged by the PIX end-user.
And, otherwise, adding them messes up the instruction numbering for the
next part:
-Add parameters that allow PIX to limit instrumentation to a smaller
range of instruction numbers. This is a crude way to make
instrumentation workable for very large (>100k or so instructions)
shaders which otherwise will break the GPU driver either via out of
memory or via TDRs when the instrumentation is run.
2023-09-07 11:01:44 -07: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 f98f8d6c59
PIX:Descend Type Hierarchy for Alloca'd structs (#5028)
In some cases structs like the RayDesc built-in type (one of the arguments to TraceRays) will be placed in an alloca.
The PIX annotation code wasn't properly counting all the leaf-node values of aggregates within such structs when determining offsets for later members.
The result of this was erroneous attribution of writes to those members during PIX shader debugging.

* PIX:Descend Type Hierarchy for Alloca'd structs

* Add test, vectors are scalar-only

* New file-check for metadata nodes
2023-02-15 16:52:23 -08:00
Jeff Noyle d7ce4e5399
PIX: Remove per-instruction disassembly in annotation pass output 2023-01-10 13:45:32 -08: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
Adam Yang c0676c7ca1
Handling dbg.value pointer case in O1. (#4375) 2022-04-05 12:07:07 -07: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 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
Minmin Gong 7e0f44fa6f
Cleanup part of compiling warnings (#2903)
Try to fix some compiler warnings produced by clang when building the dxc compiler
2020-06-25 02:57:41 -06:00
Jeff Noyle ed3d0ee0bf
Missed a commit from previous PR: Check for not-an-int (#2844)
Protect against null for subroutine params (dwarf type deref)
Fix pixtest build
2020-04-22 14:40:08 -07:00
Jeff Noyle 625c98fba3
PIX: Annotate structs for shader debugging of MS->AS payloads (#2826)
Three classes of fixes:

First a couple of trivial fixes in the DxcPix storage class, for >1-d arrays and embedded types.

Second, the addition of a new fragment iterator (now renamed "member iterator") that knows how to traverse the full structure of a struct, enabling the DxcPix* code to know bit offset and size for contained types.

Third, fixes to the numbering pass to know how to find alloca offsets via the various GetElementPtr statements that result when addressing struct members.

Lastly, a whole bunch of unit tests. Cuz this was really hard.

Remaining to do, as noted in the tests: the presence of a pointer-to-pointer type like floatNxM results in dbg.declare instructions not being emitted for structs. These tests (and perhaps some of the code) will need to be revisited if/when this is fixed.
2020-04-22 10:00:21 -07:00
John Porto 63a3b45067
Adds the DxcPixDxilDebugInfo interface and friends. (#2715)
* Adds the DxcPixDxilDebugInfo interface and friends.

* Modifies the entrypoints to require InParam/OutParam for pointers, as well as CheckNotNull them

* Removes S_FALSE for happier Jeff

* Fixes broken test

* returns E_POINTER for nullptrs

* Returns S_FALSE from UnAlias for non-aliasing types.

* fails GetName for arrays

* Addresses CR comments
2020-02-25 17:50:23 -08:00
Jeff Noyle d4c31404c3
Just run clang format on PIX passes (#2611)
Zero code change here, except moving the #include for DxilOperations.h to be on its own in a few files, in order to cope with our clang-format's habit of ordering includes alphabetically.
This is in preparation for a real change coming next.
2019-12-02 11:22:54 -08:00
Jeff Noyle 4c0075162b
Optimize SlotTracker usage, remove printing of disasm (not needed) and add an instruction count report 2019-04-19 13:40:27 -07:00
John Porto d432a02f77
Implements DIA Interfaces for HLSL variable-value mapping. (#2050) 2019-03-19 11:46:10 -07:00
John Porto 0595b86237
[DxilPIXPasses] Assigns unique ID to each instruction. (#1888)
This PR modifies the DxilAnnotateWithVirtualRegister pass to also annotate
each instruction in the DXIL module with a unique ID. This ID can then be
used by trace debuggers to uniquely identify an instruction in DXIL module.

This PR also modifies the DxilDebugInstrumentation pass to output this
unique ID on each entry in the debug trace. The debug trace is also expanded
to include the Value Ordinal (i.e., the virtual register modified by the
instruction).

Finally, this PR bundles a small bugfix to the dxassembler. The bug prevented
the DxcAssembler to add the debug DXIL to the container it assembles.
2019-01-29 05:42:54 -08:00
John Porto a746531b86
Instrument alloca register write (#1831)
* instruments alloca register writes
2019-01-10 12:48:29 -08:00
John Porto 0b192a0aa0
Adds a PIX pass for assigning register IDs to dxil values. (#1827)
* Adds a PIX pass for assigning register IDs to dxil values.
2019-01-10 08:09:43 -08:00