From 223ccd40599ffcd74b409c7321f2264b93aec4bd Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:45:23 -0700 Subject: Fix Metal pointer type emission in entry point parameters (#7759) * Fix Metal pointer type emission in entry point parameters Add missing default case in Metal emitter's address space switch to preserve pointer types. Previously, unrecognized address spaces would fall through without emitting pointer syntax, causing uint64_t* to become ulong instead of ulong constant*. Fixes #7605, #6174 * Treat AddressSpace::UserPointer as Global in Metal Also adding another test for `uniform` keyword --- source/slang/slang-emit-metal.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp index 9232fc95d..d3b00d57d 100644 --- a/source/slang/slang-emit-metal.cpp +++ b/source/slang/slang-emit-metal.cpp @@ -1163,6 +1163,7 @@ void MetalSourceEmitter::emitSimpleTypeImpl(IRType* type) switch (ptrType->getAddressSpace()) { case AddressSpace::Global: + case AddressSpace::UserPointer: m_writer->emit(" device"); m_writer->emit("*"); break; @@ -1182,6 +1183,9 @@ void MetalSourceEmitter::emitSimpleTypeImpl(IRType* type) m_writer->emit(" object_data"); m_writer->emit("*"); break; + default: + SLANG_UNEXPECTED("Unknown addressspace encountered."); + break; } return; } -- cgit v1.2.3