Skip to content

[SPIR-V] SPV_EXT_descriptor_heap extension support #8243

Open

Description

Khronos recently introduced VK_EXT_descriptor_heap with its SPIR-V counterpart SPV_EXT_descriptor_heap. It would be nice to have a direct 1:1 mapping for HLSL descriptor heaps when targeting Vulkan. Are there any plans to add support for this feature?

Activity

  1. s-perron commented on Mar 8, 2026

    @s-perron
    Collaborator

    We were just discussing that last week. It is on our list, but no ETA.

  2. GloriousPtr commented on May 1, 2026

    @GloriousPtr

    I know its not ready yet, but I was testing it out with Texture2D, RWTexture2D and SamplerState. Doesnt seem to be working, getting glitchy textures on Nvidia and AMD driver (AMD beta driver). Not sure if its driver or generated spirv. Thought its worth reporting.

    Shader.hlsl -E PS_Main -T ps_6_6 -HV 2021 -enable-16bit-types -ffinite-math-only -Zi -spirv -fspv-target-env="vulkan1.3" -fspv-use-descriptor-heap

    struct Push_Data
    {
    	float4x4 WorldTransform;
    	vk::BufferPointer<Globals> GlobalDataAddress;
    	vk::BufferPointer<QuantizedVertexData> VertexBufferAddress;
    	vk::BufferPointer<MaterialProperties> MaterialAddress;
    };
    [[vk::push_constant]]
    ConstantBuffer<Push_Data> PushData : register(b0, space0);
    
    struct PixelOut
    {
    	float4 Color0: SV_TARGET0;
    	float4 Color1: SV_TARGET1;
    };
    
    struct MaterialProperties
    {
    	float4 AlbedoColor;
    	float Roughness;
    	float Metalness;
    	float EmissiveIntensity;
    	float AlphaCutoffThreshold;
    	BindlessTexture AlbedoTexture;
    };
    
    PixelOut PS_Main(VSOutput input)
    {
    	PixelOut output;
    
    	MaterialProperties material = PushData.MaterialAddress.Get();
    
    	SamplerState sampler = SamplerDescriptorHeap[0];
    	Texture2D albedoTexture = ResourceDescriptorHeap[material.AlbedoTexture];
    	float4 albedo = albedoTexture.Sample(sampler, input.UV);
    	output.Color0 = albedo * material.AlbedoColor;
    	output.Color1 = float4(input.UV, 0.0, 1.0);
    	return output;
    }

    with -fspv-use-descriptor-heap
    Image

    without -fspv-use-descriptor-heap
    Image

  3. GloriousPtr commented on May 6, 2026

    @GloriousPtr

    Don't know if this is the fix but looks like dcx generated spirv is missing OpCapability UntypedPointersKHR in the header
    https://godbolt.org/z/jj6W3dPr8

    Edit1: Its also missing OpDecorateId ArrayStrideIdEXT as well.
    Edit2: I patched the spirv to have this and it seems to work.

    OpDecorateId %_runtimearr_type_sampler ArrayStrideIdEXT %106
    OpDecorateId %_runtimearr_type_2d_image ArrayStrideIdEXT %107
    
    %106 = OpConstantSizeOfEXT %int %type_sampler
    %107 = OpConstantSizeOfEXT %int %type_2d_image
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementspirv

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions