microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.11k stars 697 forks source link

PIX: split vector alloca writes to enable debug instrumentation #6990

Open jeffnn opened 3 weeks ago

jeffnn commented 3 weeks ago

Bit of background: PIX's debug passes add new allocas, stores to which tie debug info to DXIL Values. In the case of a preexisting alloca, PIX will still add its debug writes, but the codegen may have emitted vector-valued stores. Concretely, this happens for the ray payload and RayDesc structs in DXR. Those vector-values stores were being treated incorrectly, resulting in missing values in the PIX shader debugger.

This change splits vector-valued stores to such allocas into extractelement/scalar-stores, which enables the rest of the PIX instrumentation to function as expected.

(Worth noting that this change only applies to the PIX shader debugging pass.)

jeffnn commented 5 days ago

LGTM, but we should get a review from someone more familiar with all of this. @adam-yang perhaps?

Is there a reason that the testing for this isn't filecheck based?

Yes: you can't get the textual pass "printf" output via filecheck.