HLSL: Fix #771: add inline keyword.

This commit is contained in:
John Kessenich 2017-03-15 09:05:14 -06:00
parent 95e736c83b
commit 36b218de91
5 changed files with 9 additions and 3 deletions

View File

@ -4,7 +4,7 @@ struct PS_OUTPUT
float Depth : SV_Depth; float Depth : SV_Depth;
}; };
void MyFunc(in float x, out float y, inout float z) inline void MyFunc(in float x, out float y, inout float z)
{ {
y = x; y = x;
z = y; z = y;

View File

@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits. // For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run). // For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1914" #define GLSLANG_REVISION "Overload400-PrecQual.1916"
#define GLSLANG_DATE "14-Mar-2017" #define GLSLANG_DATE "15-Mar-2017"

View File

@ -627,6 +627,9 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier)
case EHTokGloballyCoherent: case EHTokGloballyCoherent:
qualifier.coherent = true; qualifier.coherent = true;
break; break;
case EHTokInline:
// TODO: map this to SPIR-V function control
break;
// GS geometries: these are specified on stage input variables, and are an error (not verified here) // GS geometries: these are specified on stage input variables, and are an error (not verified here)
// for output variables. // for output variables.

View File

@ -119,6 +119,7 @@ void HlslScanContext::fillInKeywordMap()
(*KeywordMap)["inout"] = EHTokInOut; (*KeywordMap)["inout"] = EHTokInOut;
(*KeywordMap)["layout"] = EHTokLayout; (*KeywordMap)["layout"] = EHTokLayout;
(*KeywordMap)["globallycoherent"] = EHTokGloballyCoherent; (*KeywordMap)["globallycoherent"] = EHTokGloballyCoherent;
(*KeywordMap)["inline"] = EHTokInline;
(*KeywordMap)["point"] = EHTokPoint; (*KeywordMap)["point"] = EHTokPoint;
(*KeywordMap)["line"] = EHTokLine; (*KeywordMap)["line"] = EHTokLine;
@ -616,6 +617,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
case EHTokPrecise: case EHTokPrecise:
case EHTokLayout: case EHTokLayout:
case EHTokGloballyCoherent: case EHTokGloballyCoherent:
case EHTokInline:
return keyword; return keyword;
// primitive types // primitive types

View File

@ -66,6 +66,7 @@ enum EHlslTokenClass {
EHTokInOut, EHTokInOut,
EHTokLayout, EHTokLayout,
EHTokGloballyCoherent, EHTokGloballyCoherent,
EHTokInline,
// primitive types // primitive types
EHTokPoint, EHTokPoint,