Fix check for 16-bit extension for 16-bit conversion functions.
authorDave Airlie <airlied@redhat.com>
Mon, 30 Apr 2018 03:02:29 +0000 (13:02 +1000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 18 May 2018 10:37:58 +0000 (06:37 -0400)
All the 16-bit conversion tests run even if the vulkan implementation
doesn't advertise the 16-bit storage feature. Request the 16-bit
storage feature for all the 16-bit tests.

Components: Vulkan

Affect:
dEQP-VK.spirv_assembly.instruction.*convert*16*
VK-GL-CTS issue: 1150

Change-Id: Icf58fdd0af5c757d44716b5cddd193f78827192f

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

index 364a261..eb4b8f9 100644 (file)
@@ -8538,8 +8538,10 @@ tcu::TestCaseGroup* createConvertComputeTests (tcu::TestContext& testCtx, const
                spec.inputs.push_back   (test->m_inputBuffer);
                spec.outputs.push_back  (test->m_outputBuffer);
 
-               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64 || usesInt16(test->m_fromType, test->m_toType))
+               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64 || usesInt16(test->m_fromType, test->m_toType)) {
                        spec.extensions.push_back("VK_KHR_16bit_storage");
+                       spec.requestedVulkanFeatures.ext16BitStorage = EXT16BITSTORAGEFEATURES_UNIFORM_BUFFER_BLOCK;
+               }
 
                group->addChild(new SpvAsmComputeShaderCase(testCtx, test->m_name.c_str(), "", spec, test->m_features));
        }
@@ -8561,6 +8563,7 @@ tcu::TestCaseGroup* createConvertGraphicsTests (tcu::TestContext& testCtx, const
                vector<string>          extensions;
                vector<deInt32>         noSpecConstants;
                PushConstants           noPushConstants;
+               VulkanFeatures          vulkanFeatures;
                GraphicsInterfaces      noInterfaces;
                tcu::RGBA                       defaultColors[4];
 
@@ -8569,12 +8572,14 @@ tcu::TestCaseGroup* createConvertGraphicsTests (tcu::TestContext& testCtx, const
                resources.outputs.push_back     (std::make_pair(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, test->m_outputBuffer));
                extensions.push_back            ("VK_KHR_storage_buffer_storage_class");
 
-               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64 || usesInt16(test->m_fromType, test->m_toType))
+               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64 || usesInt16(test->m_fromType, test->m_toType)) {
                        extensions.push_back("VK_KHR_16bit_storage");
+                       vulkanFeatures.ext16BitStorage = EXT16BITSTORAGEFEATURES_UNIFORM_BUFFER_BLOCK;
+               }
 
                createTestsForAllStages(
                        test->m_name, defaultColors, defaultColors, fragments, noSpecConstants,
-                       noPushConstants, resources, noInterfaces, extensions, features, VulkanFeatures(), group.get());
+                       noPushConstants, resources, noInterfaces, extensions, features, vulkanFeatures, group.get());
        }
        return group.release();
 }