Modify spirv_assembly tests adding dependency on 16bit_storage extension
authorJeff Leger <quic_jleger@quicinc.com>
Sat, 2 Dec 2017 02:16:28 +0000 (21:16 -0500)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 14 Dec 2017 09:34:23 +0000 (04:34 -0500)
Several tests were using 16bit_storage, but were not checking the
extension was supported nor declaring the required opCapability.

Affects:
dEQP-VK.spirv_assembly.instruction.compute.sconvert.*
dEQP-VK.spirv_assembly.instruction.compute.uconvert.*

Components: Vulkan

VK-GL-CTS issue: 875

Change-Id: I07fda13c69cdef09967d4aab5067edff07c47fa1

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

index 848f1ce..0b556ac 100644 (file)
@@ -5851,16 +5851,21 @@ struct ConvertCase
 
                if (m_features == COMPUTE_TEST_USES_INT16)
                {
-                       m_asmTypes["int_capabilities"] = "OpCapability Int16\n";
+                       m_asmTypes["int_capabilities"] = "OpCapability Int16\n"
+                                                                                        "OpCapability StorageUniformBufferBlock16\n";
+                       m_asmTypes["int_extensions"]   = "OpExtension \"SPV_KHR_16bit_storage\"\n";
                }
                else if (m_features == COMPUTE_TEST_USES_INT64)
                {
                        m_asmTypes["int_capabilities"] = "OpCapability Int64\n";
+                       m_asmTypes["int_extensions"]   = "";
                }
                else if (m_features == COMPUTE_TEST_USES_INT16_INT64)
                {
-                       m_asmTypes["int_capabilities"] = string("OpCapability Int16\n") +
-                                                                                                       "OpCapability Int64\n";
+                       m_asmTypes["int_capabilities"] = "OpCapability Int16\n"
+                                                                                        "OpCapability StorageUniformBufferBlock16\n"
+                                                                                        "OpCapability Int64\n";
+                       m_asmTypes["int_extensions"] = "OpExtension \"SPV_KHR_16bit_storage\"\n";
                }
                else
                {
@@ -5889,6 +5894,7 @@ const string getConvertCaseShaderStr (const string& instruction, const ConvertCa
        const StringTemplate shader (
                "OpCapability Shader\n"
                "${int_capabilities}"
+               "${int_extensions}"
                "OpMemoryModel Logical GLSL450\n"
                "OpEntryPoint GLCompute %main \"main\" %id\n"
                "OpExecutionMode %main LocalSize 1 1 1\n"
@@ -5981,6 +5987,11 @@ tcu::TestCaseGroup* createSConvertTests (tcu::TestContext& testCtx)
                spec.outputs.push_back(test->m_outputBuffer);
                spec.numWorkGroups = IVec3(1, 1, 1);
 
+               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64)
+               {
+                       spec.extensions.push_back("VK_KHR_16bit_storage");
+               }
+
                group->addChild(new SpvAsmComputeShaderCase(testCtx, test->m_name.c_str(), "Convert integers with OpSConvert.", spec, test->m_features));
        }
 
@@ -6019,6 +6030,11 @@ tcu::TestCaseGroup* createUConvertTests (tcu::TestContext& testCtx)
                spec.outputs.push_back(test->m_outputBuffer);
                spec.numWorkGroups = IVec3(1, 1, 1);
 
+               if (test->m_features == COMPUTE_TEST_USES_INT16 || test->m_features == COMPUTE_TEST_USES_INT16_INT64)
+               {
+                       spec.extensions.push_back("VK_KHR_16bit_storage");
+               }
+
                group->addChild(new SpvAsmComputeShaderCase(testCtx, test->m_name.c_str(), "Convert integers with OpUConvert.", spec, test->m_features));
        }
        return group.release();