Zebediah Figura : vkd3d-shader/hlsl: Split matrices into multiple variables in prepend_input_copy().
Alexandre Julliard
julliard at winehq.org
Wed Jun 8 15:40:13 CDT 2022
Module: vkd3d
Branch: master
Commit: ea38ecc4ffb0541fe4b46cddc9af31f66e18f34b
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=ea38ecc4ffb0541fe4b46cddc9af31f66e18f34b
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Jun 7 16:29:11 2022 -0500
vkd3d-shader/hlsl: Split matrices into multiple variables in prepend_input_copy().
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d-shader/hlsl_codegen.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
index b4fcfd27..6f524744 100644
--- a/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d-shader/hlsl_codegen.c
@@ -84,6 +84,21 @@ static void prepend_input_copy(struct hlsl_ctx *ctx, struct list *instrs, struct
struct hlsl_ir_load *load;
struct hlsl_ir_var *input;
+ if (type->type == HLSL_CLASS_MATRIX)
+ {
+ struct hlsl_type *vector_type = hlsl_get_vector_type(ctx, type->base_type, minor_size(type));
+ struct hlsl_semantic vector_semantic = *semantic;
+ unsigned int i;
+
+ for (i = 0; i < major_size(type); ++i)
+ {
+ prepend_input_copy(ctx, instrs, var, vector_type, 4 * i, modifiers, &vector_semantic);
+ ++vector_semantic.index;
+ }
+
+ return;
+ }
+
if (!(name = hlsl_get_string_buffer(ctx)))
return;
vkd3d_string_buffer_printf(name, "<input-%s%u>", semantic->name, semantic->index);
More information about the wine-cvs
mailing list