Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qiutang98 opened this issue Aug 25, 2024 · 1 comment · May be fixed by #7128
Open

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

qiutang98 opened this issue Aug 25, 2024 · 1 comment · May be fixed by #7128
Assignees
Labels
bug Bug, regression, crash spirv Work related to SPIR-V

Comments

@qiutang98
Copy link

qiutang98 commented Aug 25, 2024

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
@qiutang98 qiutang98 added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Aug 25, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Aug 27, 2024
@damyanp damyanp moved this to For Google in HLSL Triage Aug 27, 2024
@s-perron s-perron added this to the Next+1 Release milestone Sep 17, 2024
@s-perron s-perron moved this from For Google to Triaged in HLSL Triage Sep 17, 2024
@s-perron s-perron self-assigned this Feb 6, 2025
s-perron added a commit to s-perron/DirectXShaderCompiler that referenced this issue Feb 6, 2025
A case was missed when adding the `vk::image_format` to the image types.
We did not handle runtime arrays. We fix that oversight.

Fixes microsoft#6880
@s-perron s-perron linked a pull request Feb 6, 2025 that will close this issue
@s-perron s-perron moved this from New to In review in HLSL Roadmap Feb 6, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Projects
Status: In review
Status: Triaged
Development

Successfully merging a pull request may close this issue.

4 participants