diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-08-06 01:47:09 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-08-06 16:06:50 +0200 |
commit | 8286c3a49f03dc219e57d4a9ec27a4d840c5f603 (patch) | |
tree | 20e0f0a599ccaf269baa0dfe08f172acc82c82ce /src/amd/vulkan/vk_format.h | |
parent | 75fd4d8fd3ce389e82d2c449e2cc23855dbcf366 (diff) |
radv: Don't use SRGB format for image stores during resolve.
These seem to store very bogus results. Luckily there is some code
that converts srgb->linear already, so just making the descriptor
format UNORM should work.
Fixes: 588185eb6b7 "radv/meta: add srgb conversion to end of resolve shader."
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/vk_format.h')
-rw-r--r-- | src/amd/vulkan/vk_format.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/amd/vulkan/vk_format.h b/src/amd/vulkan/vk_format.h index c2c7ca4ce24..43265ed3d97 100644 --- a/src/amd/vulkan/vk_format.h +++ b/src/amd/vulkan/vk_format.h @@ -465,4 +465,27 @@ vk_format_get_component_bits(VkFormat format, } } +static inline VkFormat +vk_to_non_srgb_format(VkFormat format) +{ + switch(format) { + case VK_FORMAT_R8_SRGB : + return VK_FORMAT_R8_UNORM; + case VK_FORMAT_R8G8_SRGB: + return VK_FORMAT_R8G8_UNORM; + case VK_FORMAT_R8G8B8_SRGB: + return VK_FORMAT_R8G8B8_UNORM; + case VK_FORMAT_B8G8R8_SRGB: + return VK_FORMAT_B8G8R8_UNORM; + case VK_FORMAT_R8G8B8A8_SRGB : + return VK_FORMAT_R8G8B8A8_UNORM; + case VK_FORMAT_B8G8R8A8_SRGB: + return VK_FORMAT_B8G8R8A8_UNORM; + case VK_FORMAT_A8B8G8R8_SRGB_PACK32: + return VK_FORMAT_A8B8G8R8_UNORM_PACK32; + default: + return format; + } +} + #endif /* VK_FORMAT_H */ |