Add Int8 capability for conversions between int8 and non-32 bit types
Components: Vulkan
Affects: dEQP-VK.spirv_assembly.*.convert*
Change-Id: I61485d5f6cc8c1d48cc50f1268398b7df7c92d91
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";