From 6f2ce72b038b34e84819ddfc5d658166ed879eaa Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 27 Feb 2025 16:57:52 -0800 Subject: Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` (#6468) * Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` * Fix ci. --- source/slang/slang-emit-glsl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-emit-glsl.cpp') diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index 25dab3fb3..776c539b4 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -1791,6 +1791,12 @@ bool GLSLSourceEmitter::tryEmitGlobalParamImpl(IRGlobalParam* varDecl, IRType* v } } + if (varDecl->findDecoration()) + { + // By default, we don't need to emit a definition for target builtin variables. + return true; + } + // Do the default thing return false; } -- cgit v1.2.3