microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] Invalid spirv: ResourceDescriptorHeap, ConstantBuffer, vk::RawBufferLoad
Open
@luciechoi is already working on this.
Since Apr 14, 2026.
bug
needs-triage
spirv
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
Invalid spirv generated with this simple shader:
Steps to Reproduce
struct Constants
{
uint info;
};
[[vk::push_constant]] Constants g_constants;
struct Info
{
uint64_t address;
};
void pixel_main(out uint target0 : SV_Target0)
{
ConstantBuffer< Info > info = ResourceDescriptorHeap[g_constants.info];
target0 = vk::RawBufferLoad< uint >(info.address);
}
Actual Behavior
fatal error: generated SPIR-V is invalid: [VUID-StandaloneSpirv-None-10684] Invalid explicit layout decorations on type for operand '18[%_ptr_Function_type_ConstantBuffer_Info]', the Function storage class has a explicit layout from the Block decoration.
%24 = OpVariable %_ptr_Function_type_ConstantBuffer_Info Function
Environment
DXC trunk on compiler explorer
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.
Assessment
This issue has not been assessed yet.