OpTypeImage
's format mismatching with that of the bound VkImageView is ignored.
#9129
Labels
Incomplete
Missing Validation VUs to be added
ShaderVal
Shader Validation (SPIR-V related)
SpecChange
Issues that require a change in the Vulkan Spec
Environment:
SDK ver 1.3.296
Describe the Issue
Consider the following HLSL:
note the absence of a format qualifier for
outputImage
.This code produces the following SPIR-V:
Note the line:
%type_2d_image = OpTypeImage %float 2D 2 0 0 2 Rgba32f
According to the table from here: https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#spirvenv-image-formats , the SPIR-V
Rgba32f
format maps toVK_FORMAT_R32G32B32A32_SFLOAT
.However, I am using this shader with
VK_FORMAT_R8G8B8A8_UNORM
, and not getting any validation errors at all.As far as I am aware, on hardware that supports
StorageImageWriteWithoutFormat
capability (which is what I'm using), the format ofOpTypeImage
is simply ignored, so no harm done. However, on GPUs that do care about the format qualifier, my usage could potentially corrupt the image. Should this be something that VVL warns about?Expected behavior
I'd expect a validation error/warning saying that the format of the view is not matching what the SPIR-V module expects.
Valid Usage ID
I don't actually know if it's violating any specific VUIDs, but still seems like a clear case of erroneous API usage.
The text was updated successfully, but these errors were encountered: