summaryrefslogtreecommitdiff
path: root/source/slang/slang-stdlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
-rw-r--r--source/slang/slang-stdlib.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index 2bc24d8ec..3c8b48e00 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -222,7 +222,12 @@ namespace Slang
{
return kConversionCost_IntegerToFloatConversion;
}
-
+ else if (toInfo.conversionKind == kBaseTypeConversionKind_Float
+ && toInfo.conversionRank >= kBaseTypeConversionRank_Int16
+ && fromInfo.conversionRank >= kBaseTypeConversionRank_Int8)
+ {
+ return kConversionCost_IntegerToHalfConversion;
+ }
// All other cases are considered as "general" conversions,
// where we don't consider any one conversion better than
// any others.