GPUOpen-Drivers / AMDVLK

AMD Open Source Driver For Vulkan
MIT License
1.72k stars 161 forks source link

Swizzled image view on R8_UNORM is not sampled correctly #243

Closed llyzs closed 3 years ago

llyzs commented 3 years ago

Steps to reproduce:

  1. Create an image with R8_UNORM format
  2. Clear the image with color {1.0, 0.0, 0.0, 0.0} using vkCmdClearColorImage
  3. (Optional) Render something on the image created above
  4. Create an image view with swizzle (VkImageViewCreateInfo.components) equals to {VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_R}. That is, the R channel is being used as Alpha when being sampled.
  5. Create an image with B8G8R8A8_UNORM format as framebuffer
  6. Render onto the framebuffer by sampling from the image view created in step 3

The result is either complete black or contains many small black blocks (image corruption), and sometimes the driver even freezes.

Note:

Tested on RX6700XT but it is likely an issue with the RX5xxx gen as well.

JaxLinAMD commented 3 years ago

looks like a known issue.

llyzs commented 3 years ago

Confirmed this was fixed with latest release.