From 5330f8c621ab9791fda299f361a09fd551da4c61 Mon Sep 17 00:00:00 2001 From: Nate Morrical Date: Sun, 8 Dec 2024 14:12:54 -0800 Subject: [PATCH] reverting change to emitting metal types, ulong appears to be an officially supported type in metal now --- source/slang/slang-emit-metal.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp index 6b7e0c2498..6f73c7cae7 100644 --- a/source/slang/slang-emit-metal.cpp +++ b/source/slang/slang-emit-metal.cpp @@ -1043,9 +1043,6 @@ void MetalSourceEmitter::emitParamTypeImpl(IRType* type, String const& name) void MetalSourceEmitter::emitSimpleTypeKnowingCount(IRType* type, IRIntegerValue elementCount) { - // NM: note, "ulong/ushort" is only type that works for i16/i64 vec, but can't be used for - // scalars. (See metal specification pg 26) - switch (type->getOp()) { case kIROp_VoidType: @@ -1065,28 +1062,19 @@ void MetalSourceEmitter::emitSimpleTypeKnowingCount(IRType* type, IRIntegerValue m_writer->emit("long"); return; case kIROp_UInt64Type: - if (elementCount > 1) - m_writer->emit("ulong"); - else - m_writer->emit("uint64_t"); + m_writer->emit("ulong"); return; case kIROp_Int16Type: m_writer->emit("short"); return; case kIROp_UInt16Type: - if (elementCount > 1) - m_writer->emit("ushort"); - else - m_writer->emit("uint16_t"); + m_writer->emit("ushort"); return; case kIROp_IntPtrType: m_writer->emit("long"); return; case kIROp_UIntPtrType: - if (elementCount > 1) - m_writer->emit("ulong"); - else - m_writer->emit("uint64_t"); + m_writer->emit("ulong"); return; case kIROp_StructType: m_writer->emit(getName(type));