Description
If you wrap vk::BufferPointer in a struct like so:
template <typename T>
struct BufferAccessor {
vk::BufferPointer<T> ptr;
};
then initializing it with the constructor syntax produces invalid SPIR-V:
BufferAccessor<float> accessor = BufferAccessor<float>(buffer);
// fatal error: generated SPIR-V is invalid: OpConstantNull Result Type <id> '8[%_ptr_PhysicalStorageBuffer_float]' cannot have a null value.
// %13 = OpConstantNull %_ptr_PhysicalStorageBuffer_float
Setting the member directly works fine as a workaround.
Steps to Reproduce
https://godbolt.org/z/jYaM7c437
Environment
- DXC version: trunk
- Host Operating System: Windows 11