=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: libs/vkd3d: Use VK_COMPONENT_SWIZZLE_IDENTITY in vkd3d_set_view_swizzle_for_format().

Alexandre Julliard julliard at winehq.org
Tue May 29 13:43:47 CDT 2018


Module: vkd3d
Branch: master
Commit: 265ce370141f8e001c3dee251f74220771b3420a
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=265ce370141f8e001c3dee251f74220771b3420a

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue May 29 12:50:33 2018 +0200

libs/vkd3d: Use VK_COMPONENT_SWIZZLE_IDENTITY in vkd3d_set_view_swizzle_for_format().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d/resource.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index e37b03b..acd3bad 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -999,6 +999,11 @@ static bool vkd3d_create_buffer_view(struct d3d12_device *device,
 static void vkd3d_set_view_swizzle_for_format(VkComponentMapping *components,
         const struct vkd3d_format *format, bool allowed_swizzle)
 {
+    components->r = VK_COMPONENT_SWIZZLE_IDENTITY;
+    components->g = VK_COMPONENT_SWIZZLE_IDENTITY;
+    components->b = VK_COMPONENT_SWIZZLE_IDENTITY;
+    components->a = VK_COMPONENT_SWIZZLE_IDENTITY;
+
     if (format->vk_aspect_mask == VK_IMAGE_ASPECT_STENCIL_BIT)
     {
         if (allowed_swizzle)
@@ -1007,7 +1012,6 @@ static void vkd3d_set_view_swizzle_for_format(VkComponentMapping *components,
             components->g = VK_COMPONENT_SWIZZLE_R;
             components->b = VK_COMPONENT_SWIZZLE_ZERO;
             components->a = VK_COMPONENT_SWIZZLE_ZERO;
-            return;
         }
         else
         {
@@ -1024,18 +1028,12 @@ static void vkd3d_set_view_swizzle_for_format(VkComponentMapping *components,
             components->g = VK_COMPONENT_SWIZZLE_ZERO;
             components->b = VK_COMPONENT_SWIZZLE_ZERO;
             components->a = VK_COMPONENT_SWIZZLE_R;
-            return;
         }
         else
         {
             FIXME("Alpha swizzle is not supported.\n");
         }
     }
-
-    components->r = VK_COMPONENT_SWIZZLE_R;
-    components->g = VK_COMPONENT_SWIZZLE_G;
-    components->b = VK_COMPONENT_SWIZZLE_B;
-    components->a = VK_COMPONENT_SWIZZLE_A;
 }
 
 static VkResult vkd3d_create_texture_view(struct d3d12_device *device,




More information about the wine-cvs mailing list