Module: vkd3d Branch: master Commit: a28ecaa135259fcb7bbf1d60270f93e3a38f5c6c URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/a28ecaa135259fcb7bbf1d60270f93...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu Feb 16 14:44:12 2023 -0600
vkd3d-shader/hlsl: Get rid of the check_invalid_matrix_modifiers() helper.
---
libs/vkd3d-shader/hlsl.y | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 3e6077d9..e011ea24 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -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))