diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-05-15 13:20:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-15 13:20:15 -0400 |
| commit | 18169353d093f2f1baa360f57121250f4a8ea7ef (patch) | |
| tree | b85b1fbdbee66071e65ef23c49a37655930ebb87 /source | |
| parent | 30eee05f3f809e3950c8d8463ecdd9807c943692 (diff) | |
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)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/ir-glsl-legalize.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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") { |
