From 11d43642008905ac69a3832eb8a9b2ae7b785f86 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 14 Sep 2021 11:36:44 -0700 Subject: Avoid upcasting to f32 in 16bit float-uint bit cast. (#1938) Co-authored-by: Yong He --- source/slang/slang-emit-hlsl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-emit-hlsl.cpp') diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index dc58b7507..9ebf204ac 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -480,7 +480,7 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu m_writer->emit(")"); break; case BaseType::Half: - m_writer->emit("f16tof32"); + m_writer->emit("asfloat16"); break; case BaseType::Float: // Note: at present HLSL only supports @@ -522,7 +522,7 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu break; case BaseType::Half: - m_writer->emit("f32tof16("); + m_writer->emit("asuint16("); closeCount++; break; } -- cgit v1.2.3