From c3387d33ee48cb66e22a4b5a4d1e9e01f7a90dee Mon Sep 17 00:00:00 2001
From: John Kessenich <cepheus@frii.com>
Date: Fri, 17 Jun 2016 14:21:02 -0600
Subject: [PATCH] HLSL: Support semantics in function parameter declarations.

---
 Test/hlsl.float1.frag | 2 +-
 hlsl/hlslGrammar.cpp  | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Test/hlsl.float1.frag b/Test/hlsl.float1.frag
index 5000dcedc..6247e77be 100644
--- a/Test/hlsl.float1.frag
+++ b/Test/hlsl.float1.frag
@@ -1,7 +1,7 @@
 float1 f1 = float1(1.0);
 float scalar = 2.0;
 
-float1 ShaderFunction(float1 inFloat1, float inScalar) : COLOR0
+float1 ShaderFunction(float1 inFloat1 : COLOR, float inScalar) : COLOR0
 {
     return f1 * scalar + inFloat1 * inScalar;
 }
diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp
index c0d4f2857..3f0740a02 100755
--- a/hlsl/hlslGrammar.cpp
+++ b/hlsl/hlslGrammar.cpp
@@ -769,8 +769,8 @@ bool HlslGrammar::acceptFunctionParameters(TFunction& function)
 }
 
 // parameter_declaration
-//      : fully_specified_type
-//      | fully_specified_type identifier
+//      : fully_specified_type post_decls
+//      | fully_specified_type identifier post_decls
 //
 bool HlslGrammar::acceptParameterDeclaration(TFunction& function)
 {
@@ -783,6 +783,8 @@ bool HlslGrammar::acceptParameterDeclaration(TFunction& function)
     HlslToken idToken;
     acceptIdentifier(idToken);
 
+    acceptPostDecls(*type);
+
     TParameter param = { idToken.string, type };
     function.addParameter(param);
 
-- 
GitLab