class Foo {
float x;
};
cbuffer cb {
Foo foo;
}
RWBuffer<float> Buf : register(u0);
[numthreads(4,1,1)]
void main() {
Buf[0] = foo.x;
}
https://godbolt.org/z/c1fYheWWb
The codegen crashes in clang::CodeGen::HLSLBufferLayoutBuilder::layoutField because the layout code is not handling classes, only structs.