Skip fconvert16 if float16 not supported
authorGraeme Leese <gleese@broadcom.com>
Fri, 7 Dec 2018 10:58:39 +0000 (10:58 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 7 Dec 2018 11:18:51 +0000 (06:18 -0500)
The SPIR-V instruction test for float16 wasn't checking for the float16
capability correctly so didn't work properly on implementations that
don't support it.

Components: Vulkan
VK-GL-CTS issue: 1499
Affects:
    dEQP-VK.spirv_assembly.instruction.compute.opspecconstantop.fconvert16

Change-Id: Id8dfc596acda41da670b2d6c08bde9920df99268

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

index 5b9f9f9..a157281 100644 (file)
@@ -2791,6 +2791,8 @@ tcu::TestCaseGroup* createSpecConstantGroup (tcu::TestContext& testCtx)
                // Special SPIR-V code for FConvert-case for 16-bit floats
                if (strcmp(cases[caseNdx].caseName, "fconvert16") == 0)
                {
+                       spec.extensions.push_back("VK_KHR_shader_float16_int8");
+                       spec.requestedVulkanFeatures.extFloat16Int8 = EXTFLOAT16INT8FEATURES_FLOAT16;
                        specializations["CAPABILITIES"]                 = "OpCapability Float16\n";                                                     // Adds 16-bit float capability
                        specializations["OPTYPE_DEFINITIONS"]   = "%f16 = OpTypeFloat 16\n";                                            // Adds 16-bit float type
                        specializations["TYPE_CONVERT"]                 = "%sc_final32 = OpConvertFToS %i32 %sc_final\n";       // Converts 16-bit float to 32-bit integer