diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-01-30 16:49:55 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-01-30 17:45:24 +0300 |
commit | 2ed171e525992ff997c20d8384f2993a6106d723 (patch) | |
tree | 10ec3e71906ec1e324209dc0008792e6d6809760 /spirv_parser.cpp | |
parent | 2edee351f0fe3b62ecea754d22327041c9db2603 (diff) |
GLSL/MSL: Implement 8-bit part of VK_KHR_shader_float16_int8.
Storage was in place already, so mostly just dealing with bitcasts and
constants.
Simplies some of the bitcasting logic, and this exposed some bugs in the
implementation. Refactor to use correct width integers with explicit bitcast opcodes.
Diffstat (limited to 'spirv_parser.cpp')
-rw-r--r-- | spirv_parser.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/spirv_parser.cpp b/spirv_parser.cpp index 2f76144e..1725b4ca 100644 --- a/spirv_parser.cpp +++ b/spirv_parser.cpp @@ -461,23 +461,7 @@ void Parser::parse(const Instruction &instruction) uint32_t width = ops[1]; bool signedness = ops[2] != 0; auto &type = set<SPIRType>(id); - switch (width) - { - case 64: - type.basetype = signedness ? SPIRType::Int64 : SPIRType::UInt64; - break; - case 32: - type.basetype = signedness ? SPIRType::Int : SPIRType::UInt; - break; - case 16: - type.basetype = signedness ? SPIRType::Short : SPIRType::UShort; - break; - case 8: - type.basetype = signedness ? SPIRType::SByte : SPIRType::UByte; - break; - default: - SPIRV_CROSS_THROW("Unrecognized bit-width of integral type."); - } + type.basetype = signedness ? to_signed_basetype(width) : to_unsigned_basetype(width); type.width = width; break; } |