Skip to content
Snippets Groups Projects
Commit a28ecaa1 authored by Elizabeth Figura's avatar Elizabeth Figura Committed by Alexandre Julliard
Browse files

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

parent 58383648
Branches
Tags
1 merge request!102hlsl: Matrix majority, 2023 edition, part 2/2.
Pipeline #8146 skipped
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment