DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
[SPIR-V] Crash on brace initialization of struct with bitfields
Description dxc allows uniform initialization syntax for structs containing bitfields but crashes when invoked with -spirv.
Steps to Reproduce
https://godbolt.org/z/9vPeM38a3
// dxc -spirv -T cs_6_4 -HV 2021 -E main
struct ColorRGBA {
uint R:8;
uint G:8;
uint B:8;
uint A:8;
};
RWStructuredBuffer<uint> buf : r0;
[numthreads(1,1,1)]
void main()
{
ColorRGBA c = {127, 127, 127, 0};
buf[0] = c.A;
}
Actual Behavior Internal compiler error: LLVM Assert
Environment
- DXC version 1.7 - 1.7.0.14081 (main, 9cb80b6cc)
- Windows 10 Pro (21H2)
Confirmed to repro with SPIRV and not DXIL