summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-03-13 15:12:25 -0400
committerGitHub <noreply@github.com>2019-03-13 15:12:25 -0400
commit3b33c1be0ad4c1256878d8669773ef1f8fc9b58d (patch)
tree59f47d6902cedac46db661a795f1952964261588 /source/slang
parent196f07f0474be732a92fed74542ba58177cfb378 (diff)
* Set the underlying type for sv_groupthread_id and sv_groupid for glsl, so if smaller type is used conversion is performed (#902)
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/ir-glsl-legalize.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/ir-glsl-legalize.cpp b/source/slang/ir-glsl-legalize.cpp
index a4018e34f..3811346a5 100644
--- a/source/slang/ir-glsl-legalize.cpp
+++ b/source/slang/ir-glsl-legalize.cpp
@@ -315,6 +315,9 @@ GLSLSystemValueInfo* getGLSLSystemValueInfo(
else if(semanticName == "sv_groupid")
{
name = "gl_WorkGroupID";
+
+ auto builder = context->getBuilder();
+ requiredType = builder->getVectorType(builder->getBasicType(BaseType::UInt), builder->getIntValue(builder->getIntType(), 3));
}
else if(semanticName == "sv_groupindex")
{
@@ -323,6 +326,9 @@ GLSLSystemValueInfo* getGLSLSystemValueInfo(
else if(semanticName == "sv_groupthreadid")
{
name = "gl_LocalInvocationID";
+
+ auto builder = context->getBuilder();
+ requiredType = builder->getVectorType(builder->getBasicType(BaseType::UInt), builder->getIntValue(builder->getIntType(), 3));
}
else if(semanticName == "sv_gsinstanceid")
{