radv: fix invalid conversion warnings in vk_format.h
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 19 Feb 2020 11:45:59 +0000 (11:45 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jul 2020 19:38:43 +0000 (19:38 +0000)
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>

src/amd/vulkan/vk_format.h

index 0b62ea721fa64b5a2a86968f52ed5a5d0752c854..285de63528f05eee9e0575edb767bef76817d52f 100644 (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");