From ae1a93b579ed276d2455e1b97ca65ad4727d56d0 Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Mon, 18 Aug 2025 21:19:01 -0700 Subject: Emit descriptor handle correctly for ParameterBlock (#8206) In Metal, if `ParameterBlock` contains `DescriptorHandle` directly, it would be emitted as DescriptorHandle literal, which is not valid Metal code, This fix adds a case for `kIROp_DescriptorHandleType` and directs it to the Parent's `emitType` function to handle it. --- source/slang/slang-emit-metal.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp index 1915be58b..9858e51a1 100644 --- a/source/slang/slang-emit-metal.cpp +++ b/source/slang/slang-emit-metal.cpp @@ -1102,6 +1102,9 @@ void MetalSourceEmitter::emitSimpleTypeImpl(IRType* type) case kIROp_StructType: m_writer->emit(getName(type)); return; + case kIROp_DescriptorHandleType: + emitType(type); + return; case kIROp_DoubleType: SLANG_UNEXPECTED("'double' type emitted"); -- cgit v1.2.3