Skip to content

Commit 5330f8c

Browse files
committed
reverting change to emitting metal types, ulong appears to be an officially supported type in metal now
1 parent 5e8e720 commit 5330f8c

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

source/slang/slang-emit-metal.cpp

+3-15
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,6 @@ void MetalSourceEmitter::emitParamTypeImpl(IRType* type, String const& name)
10431043

10441044
void MetalSourceEmitter::emitSimpleTypeKnowingCount(IRType* type, IRIntegerValue elementCount)
10451045
{
1046-
// NM: note, "ulong/ushort" is only type that works for i16/i64 vec, but can't be used for
1047-
// scalars. (See metal specification pg 26)
1048-
10491046
switch (type->getOp())
10501047
{
10511048
case kIROp_VoidType:
@@ -1065,28 +1062,19 @@ void MetalSourceEmitter::emitSimpleTypeKnowingCount(IRType* type, IRIntegerValue
10651062
m_writer->emit("long");
10661063
return;
10671064
case kIROp_UInt64Type:
1068-
if (elementCount > 1)
1069-
m_writer->emit("ulong");
1070-
else
1071-
m_writer->emit("uint64_t");
1065+
m_writer->emit("ulong");
10721066
return;
10731067
case kIROp_Int16Type:
10741068
m_writer->emit("short");
10751069
return;
10761070
case kIROp_UInt16Type:
1077-
if (elementCount > 1)
1078-
m_writer->emit("ushort");
1079-
else
1080-
m_writer->emit("uint16_t");
1071+
m_writer->emit("ushort");
10811072
return;
10821073
case kIROp_IntPtrType:
10831074
m_writer->emit("long");
10841075
return;
10851076
case kIROp_UIntPtrType:
1086-
if (elementCount > 1)
1087-
m_writer->emit("ulong");
1088-
else
1089-
m_writer->emit("uint64_t");
1077+
m_writer->emit("ulong");
10901078
return;
10911079
case kIROp_StructType:
10921080
m_writer->emit(getName(type));

0 commit comments

Comments
 (0)