microsoft / microsoft/DirectXShaderCompiler
DXC Validation Error: TGSM pointers must originate from an unambiguous TGSM global variable
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
In commit cf044cc960419c5e08cc8a5d7366bc8df760013c (from 23 days ago) I get the following error when enabling optimization;
error: validation errors
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:152:22: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%137 = phi float addrspace(3)* [ %133, %126 ], [ %166, %135 ]' in block '#25' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:152:22: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%138 = phi float addrspace(3)* [ %130, %126 ], [ %163, %135 ]' in block '#25' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:156:21: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%141 = phi float addrspace(3)* [ %166, %155 ], [ %133, %134 ]' in block '#26' of function 'main'.
D:\local\Temp\c325567c-e0cd-4acd-95cc-d9f5a824c9ee.hlsl:156:21: error: TGSM pointers must originate from an unambiguous TGSM global variable.
note: at '%142 = phi float addrspace(3)* [ %163, %155 ], [ %130, %134 ]' in block '#26' of function 'main'.
Validation failed.
This happens because I have the WaveIsFirstLane write to a groupshared float2 array. I can't publish the code, but I will send a DM on Discord.
When disabling optimization it works, so it seems like some optimization might change the generated DXIL.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the optimized DXIL validation failure involving WaveIsFirstLane writing to a groupshared float2 array; the original HLSL code is not published, though the reporter offered to provide it privately. Compare optimized and non-optimized output and investigate the reported TGSM pointer phi values. Done means optimized compilation no longer produces the validation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100