microsoft / microsoft/DirectXShaderCompiler
DXC does not correctly handle local editable resource arrays
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
DXC does not handle local resource arrays correctly.
Steps to Reproduce
RWBuffer<int> X : register(u0);
RWBuffer<int> Y : register(u1);
void SomeFn(RWBuffer<int> Arr[2], uint Idx, int Val0) {
Arr[0] = Y;
Arr[0][Idx] = Val0;
}
[numthreads(4,1,1)]
void main(uint GI : SV_GroupIndex) {
RWBuffer<int> Arr[2] = {X, Y};
SomeFn(Arr, GI, 1);
Arr[0][GI] = 2;
}
Expected Behavior
X: [ 2, 2, 2, 2 ]
Y: [ 1, 1, 1, 1 ]
Actual Behavior
X: [ 0, 0, 0, 0 ]
Y: [ 2, 2, 2, 2 ]
Environment
- DXC main 8/1/2025
- Windows/DirectX
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 supplied HLSL shader with DXC on Windows/DirectX and compare the observed resource-array writes with the expected X and Y values. Trace the compiler path handling local editable resource arrays; done means the example produces the expected output and a regression test covers the case.
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
- Mostly clear
- Newbie friendliness
- 38/100