From 18169353d093f2f1baa360f57121250f4a8ea7ef Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 15 May 2019 13:20:15 -0400 Subject: The gl_primitiveID built in type is int, but can be uint on HLSL. The change trys to cast for glsl targets to avoid glslang producing a type error. (#962) --- source/slang/ir-glsl-legalize.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/slang/ir-glsl-legalize.cpp b/source/slang/ir-glsl-legalize.cpp index aa6eb187f..6dcfdefd6 100644 --- a/source/slang/ir-glsl-legalize.cpp +++ b/source/slang/ir-glsl-legalize.cpp @@ -353,6 +353,9 @@ GLSLSystemValueInfo* getGLSLSystemValueInfo( else if(semanticName == "sv_primitiveid") { name = "gl_PrimitiveID"; + + auto builder = context->getBuilder(); + requiredType = builder->getBasicType(BaseType::Int); } else if (semanticName == "sv_rendertargetarrayindex") { -- cgit v1.2.3