[PATCH vkd3d v2 04/10] vkd3d-shader/hlsl: Decay matrices of shape 1xN to vectors of length N.

Giovanni Mascellani gmascellani at codeweavers.com
Fri Oct 15 03:36:58 CDT 2021


For example, the common shape between a matrix 1x4 and a matrix 2x4 is
a vector of length 4, not a matrix 1x4.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 libs/vkd3d-shader/hlsl.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index d2cc1878..bfe2bbb9 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -996,6 +996,9 @@ static bool expr_common_shape(struct hlsl_ctx *ctx, struct hlsl_type *t1, struct
         }
     }
 
+    if (*type == HLSL_CLASS_MATRIX && *dimy == 1)
+        *type = HLSL_CLASS_VECTOR;
+
     return true;
 }
 
-- 
2.33.0




More information about the wine-devel mailing list