On Wed, Apr 20, 2022 at 11:00 PM Matteo Bruni matteo.mystral@gmail.com wrote:
On Wed, Apr 20, 2022 at 8:09 PM Zebediah Figura zfigura@codeweavers.com wrote:
On 4/18/22 01:34, Giovanni Mascellani wrote:
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
libs/vkd3d-shader/hlsl_codegen.c | 52 ++++++++++++++++++++++++++ tests/hlsl-matrix-indexing.shader_test | 17 +++++++++ 2 files changed, 69 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 72c00430..73e3b73f 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -672,6 +672,57 @@ static bool split_struct_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr return true; }
+static unsigned int minor_size(const struct hlsl_type *type) +{
- if (type->type == HLSL_CLASS_VECTOR || type->modifiers & HLSL_MODIFIER_ROW_MAJOR)
return type->dimx;
- else
return type->dimy;
+}
+static unsigned int major_size(const struct hlsl_type *type) +{
- if (type->type == HLSL_CLASS_VECTOR || type->modifiers & HLSL_MODIFIER_ROW_MAJOR)
return type->dimy;
- else
return type->dimx;
+}
Why handle HLSL_CLASS_VECTOR in these?
Speaking of which, let me attach my local changes when I reviewed this patch...
Except I missed a later fixup to replace HLSL_MODIFIER_ROW_MAJOR with HLSL_MODIFIER_COLUMN_MAJOR in those conditions (which is related to my confusion WRT coordinate flipping), oh well...