Skip to content

Validation layer warnings on ray tracing samples #1423

@asuessenbach

Description

@asuessenbach

With the ray tracing samples ray_tracing_basic, ray_tracing_extended, ray_tracing_position_fetch, and ray_tracing_reflection I get this validation layer warning:

vkCmdTraceRaysKHR(): the storage image descriptor [VkDescriptorSet 0x6c000000006c, Set 0, Binding 1, Index 0, variable "image"] is accessed by a OpTypeImage that has a Format operand Rgba8 (equivalent to VK_FORMAT_R8G8B8A8_UNORM) which doesn't match the VkImageView 0x500000000050 format (VK_FORMAT_B8G8R8A8_UNORM). Any loads or stores with the variable will produce undefined values to the whole image (not just the texel being accessed). While the formats are compatible, Storage Images must exactly match. Few ways to resolve this are
1. Set your ImageView to VK_FORMAT_R8G8B8A8_UNORM and swizzle the values in the shader to match the desired results.
2. 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

Simply changing the VkImage's and VkImageView's format to VK_FORMAT_R8G8B8A8_UNORM would resolve the warning, but of course changes the visual output of those samples.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions