microsoft / microsoft/DirectXShaderCompiler
Use of "float1" can cause assert/missing switch case
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
Compiling the below code hits an assert (a missing case in SemaHLSL.cpp's FlattenedTypeIterator::pushTrackerForType).
"objectKind" is ArTypeObjectKind::AR_TOBJ_POINTER, which is missing from the switch.
Steps to Reproduce
dxc -Tcs_6_6
ByteAddressBuffer inBuffer : register(t0);
RWByteAddressBuffer bufferArray[] : register(u0);
[numthreads(1, 1, 1)]
void main()
{
// Simple read
float1 dynamicBufferIndex = inBuffer.Load(0);
// Dynamically indexed write
bufferArray[dynamicBufferIndex].Store(0, 1));
}
Actual Behavior
Assert in debug.
Environment
- dxcompiler.dll: 1.8 - 1.8.0.4583 (PIX_MemberFunctions, 2f4a01af1-dirty)
- Win11, recent insider build
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 SemaHLSL.cpp and FlattenedTypeIterator::pushTrackerForType, then run the provided dxc -Tcs_6_6 reproduction using the float1 dynamic index. Trace the pointer object kind through the switch and verify that the regression no longer asserts in a debug build, ideally with coverage for the shown shader.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100