diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-02-28 16:23:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-28 13:23:29 -0800 |
| commit | efbfa7832afff7e6285713086259abda2456ed55 (patch) | |
| tree | d5a94eb66867d7f9dc01e4c1a25502443bf71040 /source/slang-core-module | |
| parent | 618b4c7657f539e66f032cd40554798bc0d68f6d (diff) | |
Add Slang-specific intrinsics for integer pack/unpack (#6459)
* update hlsl meta
* update test
* use slang syntax in meta file
* improve meta file
* fix pack clamp u8
* remove builtin packed types, use typealias instead
* fix wgsl pack clamp
* fix formatting
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang-core-module')
| -rw-r--r-- | source/slang-core-module/slang-embedded-core-module-source.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/slang-core-module/slang-embedded-core-module-source.cpp b/source/slang-core-module/slang-embedded-core-module-source.cpp index 557b50eb2..9dc324d2a 100644 --- a/source/slang-core-module/slang-embedded-core-module-source.cpp +++ b/source/slang-core-module/slang-embedded-core-module-source.cpp @@ -56,12 +56,6 @@ enum BaseTypeConversionRank : uint8_t kBaseTypeConversionRank_Int32, kBaseTypeConversionRank_IntPtr, kBaseTypeConversionRank_Int64, - - // Packed type conversion ranks where the overall rank order does not apply. - // They must be explicitly casted to another type. - kBaseTypeConversionRank_Int8x4Packed, - kBaseTypeConversionRank_UInt8x4Packed, - kBaseTypeConversionRank_Error, }; @@ -155,17 +149,6 @@ static const BaseTypeConversionInfo kBaseTypes[] = { UINT_MASK, kBaseTypeConversionKind_Unsigned, kBaseTypeConversionRank_IntPtr}, - - {"int8_t4_packed", - BaseType::Int8x4Packed, - 0, - kBaseTypeConversionKind_Unsigned, - kBaseTypeConversionRank_Int8x4Packed}, - {"uint8_t4_packed", - BaseType::UInt8x4Packed, - 0, - kBaseTypeConversionKind_Unsigned, - kBaseTypeConversionRank_UInt8x4Packed}, }; void Session::finalizeSharedASTBuilder() @@ -192,12 +175,6 @@ void Session::finalizeSharedASTBuilder() globalAstBuilder->getBuiltinType(baseType.tag); } -static bool isConversionRankPackedType(BaseTypeConversionRank rank) -{ - return (rank == BaseTypeConversionRank::kBaseTypeConversionRank_Int8x4Packed) || - (rank == BaseTypeConversionRank::kBaseTypeConversionRank_UInt8x4Packed); -} - // Given two base types, we need to be able to compute the cost of converting between them. ConversionCost getBaseTypeConversionCost( BaseTypeConversionInfo const& toInfo, @@ -210,14 +187,6 @@ ConversionCost getBaseTypeConversionCost( return kConversionCost_None; } - // Handle special case for packed types, where they must be explicitly casted to another type. - bool isToPackedType = isConversionRankPackedType(toInfo.conversionRank); - bool isFromPackedType = isConversionRankPackedType(fromInfo.conversionRank); - if (isToPackedType || isFromPackedType) - { - return kConversionCost_GeneralConversion; - } - // Conversions within the same kind are easist to handle if (toInfo.conversionKind == fromInfo.conversionKind) { |
