radv: fix invalid conversion warnings in vk_format.h

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6013>
This commit is contained in:
Rhys Perry 2020-02-19 11:45:59 +00:00 committed by Marge Bot
parent fcd8f69113
commit 40b65a86a4
1 changed files with 4 additions and 4 deletions

View File

@ -280,22 +280,22 @@ radv_swizzle_conv(VkComponentSwizzle component, const unsigned char chan[4], VkC
case VK_COMPONENT_SWIZZLE_R:
for (x = 0; x < 4; x++)
if (chan[x] == 0)
return x;
return (enum vk_swizzle)x;
return VK_SWIZZLE_0;
case VK_COMPONENT_SWIZZLE_G:
for (x = 0; x < 4; x++)
if (chan[x] == 1)
return x;
return (enum vk_swizzle)x;
return VK_SWIZZLE_0;
case VK_COMPONENT_SWIZZLE_B:
for (x = 0; x < 4; x++)
if (chan[x] == 2)
return x;
return (enum vk_swizzle)x;
return VK_SWIZZLE_0;
case VK_COMPONENT_SWIZZLE_A:
for (x = 0; x < 4; x++)
if (chan[x] == 3)
return x;
return (enum vk_swizzle)x;
return VK_SWIZZLE_1;
default:
unreachable("Illegal swizzle");