[PATCH 3/5] d3dcompiler: Rename HLSL_MODIFIERS_COMPARISON_MASK to HLSL_MODIFIERS_MAJORITY_MASK and use it in more places.

Zebediah Figura z.figura12 at gmail.com
Sun Mar 15 16:25:11 CDT 2020


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/d3dcompiler_43/d3dcompiler_private.h | 2 +-
 dlls/d3dcompiler_43/hlsl.y                | 5 ++---
 dlls/d3dcompiler_43/utils.c               | 4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h
index 957fc24e201..1a9d68e7206 100644
--- a/dlls/d3dcompiler_43/d3dcompiler_private.h
+++ b/dlls/d3dcompiler_43/d3dcompiler_private.h
@@ -741,7 +741,7 @@ struct hlsl_ir_node
                                       HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \
                                       HLSL_MODIFIER_COLUMN_MAJOR)
 
-#define HLSL_MODIFIERS_COMPARISON_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
+#define HLSL_MODIFIERS_MAJORITY_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
 
 struct reg_reservation
 {
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 556c03b11fe..4f5a7b1782c 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -117,7 +117,7 @@ static void debug_dump_decl(struct hlsl_type *type, DWORD modifiers, const char
 
 static void check_invalid_matrix_modifiers(DWORD modifiers, struct source_location loc)
 {
-    if (modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR))
+    if (modifiers & HLSL_MODIFIERS_MAJORITY_MASK)
     {
         hlsl_report_message(loc, HLSL_LEVEL_ERROR,
                 "'row_major' or 'column_major' modifiers are only allowed for matrices");
@@ -175,8 +175,7 @@ static DWORD add_modifiers(DWORD modifiers, DWORD mod, const struct source_locat
         hlsl_report_message(loc, HLSL_LEVEL_ERROR, "modifier '%s' already specified", debug_modifiers(mod));
         return modifiers;
     }
-    if (mod & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
-            && modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR))
+    if ((mod & HLSL_MODIFIERS_MAJORITY_MASK) && (modifiers & HLSL_MODIFIERS_MAJORITY_MASK))
     {
         hlsl_report_message(loc, HLSL_LEVEL_ERROR, "more than one matrix majority keyword");
         return modifiers;
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c
index 3e8e229c8c1..921ef7c2c7b 100644
--- a/dlls/d3dcompiler_43/utils.c
+++ b/dlls/d3dcompiler_43/utils.c
@@ -892,8 +892,8 @@ BOOL compare_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2)
         return FALSE;
     if (t1->base_type == HLSL_TYPE_SAMPLER && t1->sampler_dim != t2->sampler_dim)
         return FALSE;
-    if ((t1->modifiers & HLSL_MODIFIERS_COMPARISON_MASK)
-            != (t2->modifiers & HLSL_MODIFIERS_COMPARISON_MASK))
+    if ((t1->modifiers & HLSL_MODIFIERS_MAJORITY_MASK)
+            != (t2->modifiers & HLSL_MODIFIERS_MAJORITY_MASK))
         return FALSE;
     if (t1->dimx != t2->dimx)
         return FALSE;
-- 
2.25.1




More information about the wine-devel mailing list