microsoft / microsoft/DirectXShaderCompiler

DXC Validation Error: TGSM pointers must originate from an unambiguous TGSM global variable

Open
#3,429 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.