Skip to content

[SPIR-V] vk::image_format no work with bindless array. #6880

Closed

Description

@qiutang98

Problem shader

[[vk::image_format("r16f")]]
[[vk::binding(3, 0)]] 
RWTexture2D<float> RWTextureBindless[];

[[vk::image_format("r16f")]] 
[[vk::binding(0, 1)]] 
globallycoherent RWTexture2D<float> mip5Dest;

The compiled result translate to GLSL by SPIRV-Cross:

layout(set = 0, binding = 3, r32f) uniform writeonly image2D RWTextureBindless[];
layout(set = 1, binding = 0, r16f) uniform coherent image2D mip5Dest;

When watching SPIR-V Asm, can find it still use r32f:

%type_2d_image_0 = OpTypeImage %float 2D 2 0 0 2 R32f
%type_2d_image_1 = OpTypeImage %float 2D 2 0 0 2 R16f

// ...
%638 = OpAccessChain %_ptr_UniformConstant_type_2d_image_0 %RWTextureBindless %636
%639 = OpLoad %type_2d_image_0 %638

// ...
%512 = OpLoad %type_2d_image_1 %mip5Dest

Activity

  1. added
    bug
    needs-triage
    spirv
    on Aug 25, 2024
  2. moved this from For Google to Triaged in HLSL Triageon Sep 17, 2024
  3. added a commit that references this issue on Feb 6, 2025
    0dc61f4
  4. moved this from New to In review in HLSL Roadmapon Feb 6, 2025
  5. devshgraphicsprogramming commented on Feb 8, 2025

    @devshgraphicsprogramming

    秋棠 (@qiutang98) I know it doesn't solve your issue, but are you sure that you want all your bindless images to have the same format?

    The Vulkan imageStoreWithoutFormat feature is quite ubiquitous nowadays.

  6. moved this from In review to Done in HLSL Roadmapon Feb 18, 2025
  7. added a commit that references this issue on Feb 18, 2025
    fcbd2a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions