From bae87afb20f95f9f27c64c4955bbc4464c576509 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 6 Feb 2025 22:02:43 -0800 Subject: Support stage_switch. (#6311) * Support stage_switch. * Update proposal status. * Fix gl_InstanceID. * Fix. --- source/slang/slang-ir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 3314567f1..6cf7a1786 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3209,6 +3209,11 @@ void IRBuilder::setDataType(IRInst* inst, IRType* dataType) } } +IRInst* IRBuilder::emitGetCurrentStage() +{ + return emitIntrinsicInst(getIntType(), kIROp_GetCurrentStage, 0, nullptr); +} + IRInst* IRBuilder::emitGetValueFromBoundInterface(IRType* type, IRInst* boundInterfaceValue) { auto inst = @@ -8301,6 +8306,7 @@ bool IRInst::mightHaveSideEffects(SideEffectAnalysisOptions options) case kIROp_ResolveVaryingInputRef: case kIROp_GetPerVertexInputArray: case kIROp_MetalCastToDepthTexture: + case kIROp_GetCurrentStage: return false; case kIROp_ForwardDifferentiate: -- cgit v1.2.3