summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-hlsl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-hlsl.cpp')
-rw-r--r--source/slang/slang-emit-hlsl.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp
index 48fe86fff..20fcc5bed 100644
--- a/source/slang/slang-emit-hlsl.cpp
+++ b/source/slang/slang-emit-hlsl.cpp
@@ -467,10 +467,12 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu
case BaseType::Int16:
case BaseType::Int:
case BaseType::Int64:
+ case BaseType::IntPtr:
case BaseType::UInt8:
case BaseType::UInt16:
case BaseType::UInt:
case BaseType::UInt64:
+ case BaseType::UIntPtr:
case BaseType::Bool:
// Because the intermediate type will always
// be an integer type, we can convert to
@@ -809,11 +811,26 @@ void HLSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
case kIROp_DoubleType:
case kIROp_Int16Type:
case kIROp_UInt16Type:
- {
case kIROp_HalfType:
+ {
m_writer->emit(getDefaultBuiltinTypeName(type->getOp()));
return;
}
+#if SLANG_PTR_IS_64
+ case kIROp_IntPtrType:
+ m_writer->emit("int64_t");
+ return;
+ case kIROp_UIntPtrType:
+ m_writer->emit("uint64_t");
+ return;
+#else
+ case kIROp_IntPtrType:
+ m_writer->emit("int");
+ return;
+ case kIROp_UIntPtrType:
+ m_writer->emit("uint");
+ return;
+#endif
case kIROp_StructType:
m_writer->emit(getName(type));
return;
@@ -856,7 +873,7 @@ void HLSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
case kIROp_NativeStringType:
case kIROp_StringType:
{
- m_writer->emit("int");
+ m_writer->emit("string");
return;
}
default: break;