diff --git a/src/graphics/host_gpu/renderer/image/imageView.h b/src/graphics/host_gpu/renderer/image/imageView.h index 101d5a2a4..59041ecf4 100644 --- a/src/graphics/host_gpu/renderer/image/imageView.h +++ b/src/graphics/host_gpu/renderer/image/imageView.h @@ -103,9 +103,8 @@ IsSupportedSampledDepthUintResource(const ShaderRecompiler::IR::ImageResource& r inline void ValidateStorageColorView(vk::Format image_format, vk::Format view_format, uint32_t swizzle) noexcept { - const auto srgb_view = SrgbStorageViewFormat(image_format); - const bool srgb_storage_view = srgb_view != vk::Format::eUndefined && view_format == srgb_view; - if ((image_format != view_format && !srgb_storage_view) || !IsValidImageSwizzle(swizzle)) { + if (!ImageViewOps::FormatsCompatible(image_format, view_format) || + !IsValidImageSwizzle(swizzle)) { UnsupportedColorView("storage", image_format, view_format, swizzle); } } diff --git a/tests/ShaderRecompilerComputeTests.cpp b/tests/ShaderRecompilerComputeTests.cpp index 3af576f1b..182c9128b 100644 --- a/tests/ShaderRecompilerComputeTests.cpp +++ b/tests/ShaderRecompilerComputeTests.cpp @@ -16324,7 +16324,7 @@ void CheckBasicStorageTextureDescriptor() { "PPSA06228 R11G11B10 storage descriptor fixture is malformed"); ValidateStorageTexture(BasicBgraStorageTextureResource(), r11g11b10, 0x870000); - ValidateStorageColorView(vk::Format::eB10G11R11UfloatPack32, + ValidateStorageColorView(vk::Format::eB8G8R8A8Unorm, vk::Format::eB10G11R11UfloatPack32, r11g11b10.DstSelXYZW());