Matteo Bruni : d3dcompiler: Allow multiple input/output modifiers.

Alexandre Julliard julliard at winehq.org
Thu Oct 11 15:25:17 CDT 2012


Module: wine
Branch: master
Commit: deb00c946088c6780d8e47704e3ff053b00b9bc0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=deb00c946088c6780d8e47704e3ff053b00b9bc0

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Thu Oct 11 19:48:47 2012 +0200

d3dcompiler: Allow multiple input/output modifiers.

---

 dlls/d3dcompiler_43/hlsl.y |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index a7d4c68..738ab3a 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -991,6 +991,7 @@ static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct lis
 %type <list> expr_statement
 %type <unary_op> unary_op
 %type <assign_op> assign_op
+%type <modifiers> input_mods
 %type <modifiers> input_mod
 %%
 
@@ -1225,20 +1226,31 @@ param_list:               parameter
                                 }
                             }
 
-parameter:                input_mod var_modifiers type any_identifier semantic
+parameter:                input_mods var_modifiers type any_identifier semantic
                             {
-                                $$.modifiers = $1;
+                                $$.modifiers = $1 ? $1 : HLSL_MODIFIER_IN;
                                 $$.modifiers |= $2;
                                 $$.type = $3;
                                 $$.name = $4;
                                 $$.semantic = $5;
                             }
 
-input_mod:                /* Empty */
+input_mods:               /* Empty */
                             {
-                                $$ = HLSL_MODIFIER_IN;
+                                $$ = 0;
+                            }
+                        | input_mods input_mod
+                            {
+                                if ($1 & $2)
+                                {
+                                    hlsl_report_message(hlsl_ctx.source_file, @2.first_line, @2.first_column,
+                                            HLSL_LEVEL_ERROR, "duplicate input-output modifiers");
+                                    return 1;
+                                }
+                                $$ = $1 | $2;
                             }
-                        | KW_IN
+
+input_mod:                KW_IN
                             {
                                 $$ = HLSL_MODIFIER_IN;
                             }




More information about the wine-cvs mailing list