microsoft / microsoft/DirectXShaderCompiler
DXC hangs when writing a bitfield in groupshared memory, indexed by a numeric literal
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
I have a struct that includes bitfields. There is an array of these structs in groupshared memory. Indexing the array with an integer literal to write the bitfield causes DXC to hang.
Steps to Reproduce
dxc.exe /Zi -Qembed_debug /Tcs_6_6
struct MyStruct
{
uint32_t token : 32;
};
groupshared MyStruct gs_array[1];
[numthreads(32, 1, 1)]
void main(uint GI : SV_GroupIndex)
{
// literal index into local array to write a bitfield
MyStruct array[1];
array[0].token = 3; // <-- FINE
// variable index into groupshared memory to write a bitfield
uint i = 0;
gs_array[i].token = 3; // <-- FINE
// literal index into groupshared memory to write a bitfield
gs_array[0].token = 3; // <-- HANG
}
Actual Behavior
DXC hangs
Environment
- DXC version (dxcompiler.dll: 1.8 - 1.8.2407.7 (416fab6b5); dxil.dll: 1.8(101.8.2407.12))
- Host Operating System "Windows 11 24H2"
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 with the supplied dxc.exe /Zi -Qembed_debug /Tcs_6_6 command and minimal shader, comparing the local-array, variable-index groupshared, and literal-index groupshared assignments. Done means the literal groupshared bitfield write compiles without hanging, with a regression test for this reproducer if the project’s test location is identified.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100