Fix validation for int8 conversion
authorAlexander Galazin <alexander.galazin@arm.com>
Wed, 28 Nov 2018 10:47:18 +0000 (11:47 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 29 Nov 2018 09:25:47 +0000 (04:25 -0500)
Add Int8 capability for conversions between int8 and non-32 bit types

Components: Vulkan

Affects: dEQP-VK.spirv_assembly.*.convert*

Change-Id: I61485d5f6cc8c1d48cc50f1268398b7df7c92d91

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp

index 9177957..09630d1 100644 (file)
@@ -8844,7 +8844,18 @@ struct ConvertCase
 
                if (usesInt8(from, to))
                {
+                       bool requiresInt8Capability = true;
+                       if (instruction == "OpUConvert" || instruction == "OpSConvert")
+                       {
+                               // Conversions between 8 and 32 bit are provided by SPV_KHR_8bit_storage. The rest requires explicit Int8
+                               if (usesInt32(from, to))
+                                       requiresInt8Capability = false;
+                       }
+
                        caps += "OpCapability StorageBuffer8BitAccess\n";
+                       if (requiresInt8Capability)
+                               caps += "OpCapability Int8\n";
+
                        decl += "%i8         = OpTypeInt 8 1\n"
                                        "%u8         = OpTypeInt 8 0\n";
                        exts += "OpExtension \"SPV_KHR_8bit_storage\"\n";