From 3ecbeacd3b02e2a8c1b9796df1caced0aa34224f Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 24 Jan 2025 21:39:13 -0800 Subject: Fix depth texture sampling on Metal. (#6168) --- source/slang/slang-emit-c-like.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index ac548e354..98bddad9b 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -1413,6 +1413,7 @@ bool CLikeSourceEmitter::shouldFoldInstIntoUseSites(IRInst* inst) // or statement). case kIROp_UpdateElement: case kIROp_DefaultConstruct: + case kIROp_MetalCastToDepthTexture: return false; // Always fold these in, because they are trivial @@ -3129,6 +3130,7 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst) case kIROp_AtomicCompareExchange: case kIROp_StructuredBufferGetDimensions: case kIROp_MetalAtomicCast: + case kIROp_MetalCastToDepthTexture: emitInstStmt(inst); break; -- cgit v1.2.3