diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 73e3b73f..ad456dc5 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -672,17 +672,17 @@ 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) +static unsigned int vector_count(const struct hlsl_type *type) { - if (type->type == HLSL_CLASS_VECTOR || type->modifiers & HLSL_MODIFIER_ROW_MAJOR) + if (type->modifiers & HLSL_MODIFIER_ROW_MAJOR) return type->dimx; else return type->dimy; } -static unsigned int major_size(const struct hlsl_type *type) +static unsigned int vector_size(const struct hlsl_type *type) { - if (type->type == HLSL_CLASS_VECTOR || type->modifiers & HLSL_MODIFIER_ROW_MAJOR) + if (type->modifiers & HLSL_MODIFIER_ROW_MAJOR) return type->dimy; else return type->dimx; @@ -704,7 +704,7 @@ static bool split_matrix_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr type = rhs->data_type; if (type->type != HLSL_CLASS_MATRIX) return false; - element_type = hlsl_get_vector_type(ctx, type->base_type, minor_size(type)); + element_type = hlsl_get_vector_type(ctx, type->base_type, vector_size(type)); if (rhs->type != HLSL_IR_LOAD) { @@ -712,7 +712,7 @@ static bool split_matrix_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr return false; } - for (i = 0; i < major_size(type); ++i) + for (i = 0; i < vector_count(type); ++i) { if (!split_copy(ctx, store, hlsl_ir_load(rhs), 4 * i, element_type)) return false;