DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

[SPIR-V] Crash on brace initialization of struct with bitfields

Open danbrown-amd opened this issue 3 years ago • 1 comments

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)

danbrown-amd avatar Sep 11 '23 22:09 danbrown-amd

Confirmed to repro with SPIRV and not DXIL

pow2clk avatar Sep 12 '23 15:09 pow2clk