microsoft / microsoft/DirectXShaderCompiler

[SPIR-V] Invalid spirv: ResourceDescriptorHeap, ConstantBuffer, vk::RawBufferLoad

Open
#8,373 1 comment 0 reactions 1 assignee View on GitHub

@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);
}

Compiler explorer

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.