vkd3d-shader/hlsl: Get rid of the check_invalid_matrix_modifiers() helper.

This commit is contained in:
Zebediah Figura 2023-02-16 14:44:12 -06:00 committed by Alexandre Julliard
parent 5838364886
commit a28ecaa135
Notes: Alexandre Julliard 2023-02-28 22:10:58 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/102

View File

@ -149,13 +149,6 @@ static void destroy_instr_list(struct list *list)
vkd3d_free(list);
}
static void check_invalid_matrix_modifiers(struct hlsl_ctx *ctx, DWORD modifiers, struct vkd3d_shader_location loc)
{
if (modifiers & HLSL_MODIFIERS_MAJORITY_MASK)
hlsl_error(ctx, &loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
"'row_major' and 'column_major' modifiers are only allowed for matrices.");
}
static bool hlsl_types_are_componentwise_compatible(struct hlsl_ctx *ctx, struct hlsl_type *src,
struct hlsl_type *dst)
{
@ -889,9 +882,10 @@ static struct hlsl_type *apply_type_modifiers(struct hlsl_ctx *ctx, struct hlsl_
if (!(default_majority = ctx->matrix_majority) && force_majority)
default_majority = HLSL_MODIFIER_COLUMN_MAJOR;
}
else if (type->type != HLSL_CLASS_MATRIX)
else if (type->type != HLSL_CLASS_MATRIX && (*modifiers & HLSL_MODIFIERS_MAJORITY_MASK))
{
check_invalid_matrix_modifiers(ctx, *modifiers, *loc);
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
"'row_major' and 'column_major' modifiers are only allowed for matrices.");
}
if (!default_majority && !(*modifiers & HLSL_TYPE_MODIFIERS_MASK))