microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.11k stars 697 forks source link

[SPIR-V] Unable to set 'unknown' format when using image_format attribute #6981

Closed Keenuts closed 4 weeks ago

Keenuts commented 1 month ago

Description

Context: https://github.com/microsoft/DirectXShaderCompiler/issues/6979#issuecomment-2427553483 Repro:

// RUN: %dxc -T cs_6_7 -E main -spirv -fspv-target-env=vulkan1.3 %s
[[vk::binding(0,0)]]
[[vk::image_format("unknown")]]
RWTexture3D<float32_t2> untypedImage;

[numthreads(8,8,8)]
void main(uint32_t3 gl_GlobalInvocationID : SV_DispatchThreadID)
{
    untypedImage[gl_GlobalInvocationID] = float32_t2(4,5);
}

Actual Behavior DXC generates Rg32f as format for untypedImage instead of the requested Unknown.

Keenuts commented 1 month ago

@devshgraphicsprogramming to track this specific issue.

Keenuts commented 1 month ago

spirv-tools fix in, now I need to bring it to DXC