From 005120cce8e22453d4d270c3f3c993211b134bbf Mon Sep 17 00:00:00 2001 From: Graham Wihlidal Date: Fri, 17 Feb 2017 19:03:25 +0100 Subject: [PATCH 1/2] HLSL - Support for SV_GroupIndex --- hlsl/hlslParseHelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 272632ba..71f271a2 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -3887,6 +3887,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con qualifier.builtIn = EbvGlobalInvocationId; else if (semanticUpperCase == "SV_GROUPTHREADID") qualifier.builtIn = EbvLocalInvocationId; + else if (semanticUpperCase == "SV_GROUPINDEX") + qualifier.builtIn = EbvLocalInvocationIndex; else if (semanticUpperCase == "SV_GROUPID") qualifier.builtIn = EbvWorkGroupId; else if (semanticUpperCase == "SV_DOMAINLOCATION") @@ -3903,8 +3905,6 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con qualifier.builtIn = EbvFragDepthLesser; else if( semanticUpperCase == "SV_STENCILREF") error(loc, "unimplemented; need ARB_shader_stencil_export", "SV_STENCILREF", ""); - else if( semanticUpperCase == "SV_GROUPINDEX") - error(loc, "unimplemented", "SV_GROUPINDEX", ""); } // From 6f332f3ac6959a2f90d79c040330cd819307f76a Mon Sep 17 00:00:00 2001 From: Graham Wihlidal Date: Fri, 17 Feb 2017 19:05:14 +0100 Subject: [PATCH 2/2] Warning fixes --- hlsl/hlslParseHelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 71f271a2..5ff54d48 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -543,7 +543,7 @@ bool HlslParseContext::parseMatrixSwizzleSelector(const TSourceLoc& loc, const T error(loc, "matrix component swizzle missing", compString.c_str(), ""); return false; } - startPos[numComps++] = c + 1; + startPos[numComps++] = (int)c + 1; } } @@ -2153,7 +2153,7 @@ TIntermTyped* HlslParseContext::handleAssignToMatrixSwizzle(const TSourceLoc& lo TIntermTyped* vectorAssign = nullptr; if (vector == nullptr) { // create a new intermediate vector variable to assign to - TType vectorType(matrix->getBasicType(), EvqTemporary, matrix->getQualifier().precision, swizzle.size()/2); + TType vectorType(matrix->getBasicType(), EvqTemporary, matrix->getQualifier().precision, (int)swizzle.size()/2); vector = intermediate.addSymbol(*makeInternalVariable("intermVec", vectorType), loc); // assign the right to the new vector