=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Fix swizzle for scalars.

Alexandre Julliard julliard at winehq.org
Fri Feb 22 15:20:00 CST 2019


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Feb 21 12:32:47 2019 +0100

vkd3d-shader: Fix swizzle for scalars.

In rare cases, OpCompositeExtract was generated for scalars.

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-shader/spirv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 2b52334..6ef04a4 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2661,6 +2661,9 @@ static uint32_t vkd3d_dxbc_compiler_emit_swizzle_ext(struct vkd3d_dxbc_compiler
 
     type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count);
 
+    if (component_count == 1 && val_component_count == 1)
+        return val_id;
+
     if (component_count == 1)
     {
         component_idx = vkd3d_write_mask_get_component_idx(write_mask);




More information about the wine-cvs mailing list