From 788fbeb36fc1951ce69aeac0d0aa1674b3f742aa Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 15 Dec 2017 08:15:26 -0700 Subject: [PATCH] HLSL: Make attributes for built-in override semantics. Fixes #1188. --- Test/hlsl.PointSize.geom | 2 +- hlsl/hlslParseHelper.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Test/hlsl.PointSize.geom b/Test/hlsl.PointSize.geom index d2a04a48d..ef66fc891 100644 --- a/Test/hlsl.PointSize.geom +++ b/Test/hlsl.PointSize.geom @@ -1,5 +1,5 @@ struct S { - [[vk::builtin("PointSize")]] float ps; + [[vk::builtin("PointSize")]] float ps : PSIZE; }; [maxvertexcount(4)] diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 31ea82a16..a3e5e8a73 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -5856,7 +5856,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBu break; } - qualifier.builtIn = builtIn; + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = builtIn; qualifier.semanticName = intermediate.addSemanticName(upperCase); }