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

vkd3d-shader/hlsl: Store the matrix majority as a type modifiers bitmask.

parent b3c62095
No related branches found
Tags wine-0.9.54
No related merge requests found
......@@ -2973,7 +2973,7 @@ static bool hlsl_ctx_init(struct hlsl_ctx *ctx, const char *source_name,
ctx->location.line = ctx->location.column = 1;
vkd3d_string_buffer_cache_init(&ctx->string_buffers);
ctx->matrix_majority = HLSL_COLUMN_MAJOR;
ctx->matrix_majority = HLSL_MODIFIER_COLUMN_MAJOR;
list_init(&ctx->scopes);
......
......@@ -116,12 +116,6 @@ enum hlsl_sampler_dim
HLSL_SAMPLER_DIM_MAX = HLSL_SAMPLER_DIM_CUBEARRAY,
};
enum hlsl_matrix_majority
{
HLSL_COLUMN_MAJOR,
HLSL_ROW_MAJOR
};
enum hlsl_regset
{
HLSL_REGSET_SAMPLERS,
......@@ -735,7 +729,7 @@ struct hlsl_ctx
const struct hlsl_ir_function_decl *cur_function;
/* Default matrix majority for matrix types. Can be set by a pragma within the HLSL source. */
enum hlsl_matrix_majority matrix_majority;
unsigned int matrix_majority;
/* Basic data types stored for convenience. */
struct
......
......@@ -233,14 +233,14 @@ row_major {return KW_ROW_MAJOR; }
struct hlsl_ctx *ctx = yyget_extra(yyscanner);
TRACE("#pragma setting row_major mode.\n");
ctx->matrix_majority = HLSL_ROW_MAJOR;
ctx->matrix_majority = HLSL_MODIFIER_ROW_MAJOR;
BEGIN(pp_ignore);
}
<pp_pragma>pack_matrix{WS}*\({WS}*column_major{WS}*\) {
struct hlsl_ctx *ctx = yyget_extra(yyscanner);
TRACE("#pragma setting column_major mode.\n");
ctx->matrix_majority = HLSL_COLUMN_MAJOR;
ctx->matrix_majority = HLSL_MODIFIER_COLUMN_MAJOR;
BEGIN(pp_ignore);
}
<pp_pragma>{NEWLINE} {
......
......@@ -886,10 +886,7 @@ static struct hlsl_type *apply_type_modifiers(struct hlsl_ctx *ctx, struct hlsl_
&& !(type->modifiers & HLSL_MODIFIERS_MAJORITY_MASK)
&& type->type == HLSL_CLASS_MATRIX)
{
if (ctx->matrix_majority == HLSL_COLUMN_MAJOR)
default_majority = HLSL_MODIFIER_COLUMN_MAJOR;
else
default_majority = HLSL_MODIFIER_ROW_MAJOR;
default_majority = ctx->matrix_majority;
}
else if (type->type != HLSL_CLASS_MATRIX)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment