summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-spirv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
-rw-r--r--source/slang/slang-emit-spirv.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index cb9eb0ae9..23eaa4435 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -6423,11 +6423,12 @@ struct SPIRVEmitContext
// If the component types are not the same, convert them to be so.
if (!isTypeEqual(getVectorElementType(toType), fromElementType))
{
+ SpvOp convertOp = isIntegralType(fromElementType) ? (isSignedType(fromElementType) ? SpvOpSConvert : SpvOpUConvert) : SpvOpFConvert;
auto newFromType = replaceVectorElementType(fromType, getVectorElementType(toType));
fromSpvInst = emitInstCustomOperandFunc(
parent,
nullptr,
- SpvOpFConvert,
+ convertOp,
[&]() {
emitOperand(newFromType);
emitOperand(kResultID),