-
Notifications
You must be signed in to change notification settings - Fork 420
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
layers: Fix warning for Storage Image #9536
layers: Fix warning for Storage Image #9536
Conversation
CI Vulkan-ValidationLayers build queued with queue ID 381106. |
CI Vulkan-ValidationLayers build # 19202 running. |
3b856ee
to
62d7a26
Compare
CI Vulkan-ValidationLayers build queued with queue ID 381138. |
CI Vulkan-ValidationLayers build # 19204 running. |
CI Vulkan-ValidationLayers build # 19204 failed. |
CI Vulkan-ValidationLayers build queued with queue ID 381385. |
CI Vulkan-ValidationLayers build # 19205 running. |
CI Vulkan-ValidationLayers build # 19205 failed. |
62d7a26
to
11c5a1f
Compare
CI Vulkan-ValidationLayers build queued with queue ID 381478. |
CI Vulkan-ValidationLayers build # 19206 running. |
<< string_VkFormat(resource_variable.info.image_format) << " which doesn't match the " | ||
<< dev_state.FormatHandle(image_view) << " format (" << string_VkFormat(image_view_ci.format) | ||
<< "). Any loads or stores with the variable will produce undefined values."; | ||
if (vkuFormatCompatibilityClass(image_view_ci.format) == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 100% going to trip people up as a "wait I was not allowed to do this?" so the new message tries to help explain more "what to do" here
vkCmdDispatch(): the storage image descriptor [VkDescriptorSet 0xee647e0000000009, Set 0, Binding 0, Index 0, variable "si0"] is accessed by a OpTypeImage that has a Format operand Rgba8 (equivalent to VK_FORMAT_R8G8B8A8_UNORM) which doesn't match the VkImageView 0xf443490000000006 format (VK_FORMAT_B8G8R8A8_UNORM). Any loads or stores with the variable will produce undefined values. While the formats are compatible, Storage Images must exactly match. Two ways to resolve this are
Set your ImageView to VK_FORMAT_R8G8B8A8_UNORM and swizzle the values in the shader to match the desired results.
Use the Unknown format in your shader (will need the widely supported shaderStorageImageWriteWithoutFormat feature)
Spec information at https://docs.vulkan.org/spec/latest/chapters/textures.html#textures-format-validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice error message
11c5a1f
to
f63587b
Compare
CI Vulkan-ValidationLayers build queued with queue ID 381533. |
CI Vulkan-ValidationLayers build # 19208 running. |
CI Vulkan-ValidationLayers build # 19208 passed. |
Fixes issue with warning, the user might use
Rgba8
in their shader which maps toVK_FORMAT_R8G8B8A8_UNORM
but the user can still useVK_FORMAT_B8G8R8A8_UNORM
(basically was doing exact format check instead of usingvkuFormatCompatibilityClass