microsoft / microsoft/DirectXShaderCompiler
Fixed size array assignment causes assert
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
A compiler assert is hit when attempting to do a fixed array value assignment. I would expect a compiler error to be emitted instead, with a clean exit.
Steps to Reproduce
https://godbolt.org/z/jcr6WT8b6
Compile the following minimum repro with dxc -T as_6_5 -E as_main bug.hlsl
struct MS_Payload {
float2 uvs[4];
};
[NumThreads(1, 1, 1)]
void as_main() {
float2 UVS[4] = {
float2(0, 0),
float2(0, 1),
float2(1, 1),
float2(1, 0),
};
MS_Payload payload;
payload.uvs = UVS; // <-- here
DispatchMesh(1, 1, 1, payload);
}
Actual Behavior
Yields error: cast<X>() argument of incompatible type!
Stack trace when used via libdxcompiler.dylib:
Environment
./dxc --version
libdxcompiler.dylib: 1.9(dev;5011-dc85cd71)
macOS Sequoia 15.6
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
Begin with the Godbolt minimum repro and run it using dxc -T as_6_5 -E as_main bug.hlsl to reproduce the assertion. Trace the reported cast<X>() failure in the compiler, then verify that the fixed-array assignment produces a clean compiler diagnostic and exit instead of asserting.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100