From bc51a455242d963fe631aab51678220ab996bfd6 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Mon, 10 Dec 2018 14:31:31 +0000 Subject: [PATCH] Remove one method of specifying features in vktSpvAsm The features can either be specified as a vector of strings (most of which won't work), or as a VulkanFeatures struct, which is properly checked. Remove the vector of strings method and change everything to use the VulkanFeatures. Components: Vulkan Affects: dEQP-VK.spirv_assembly.* Change-Id: Ia4f51f9e64dde129cb577982f2a17fa529c4c961 (cherry picked from commit f58817ce095d2a0dda0b5d2a57f82428b3462f38) --- .../spirv_assembly/vktSpvAsm16bitStorageTests.cpp | 4 -- .../vktSpvAsmCompositeInsertTests.cpp | 33 +++++++------- .../spirv_assembly/vktSpvAsmFloatControlsTests.cpp | 2 - .../vktSpvAsmGraphicsShaderTestUtil.cpp | 51 +++------------------- .../vktSpvAsmGraphicsShaderTestUtil.hpp | 46 +++---------------- .../spirv_assembly/vktSpvAsmImageSamplerTests.cpp | 14 +++--- .../spirv_assembly/vktSpvAsmIndexingTests.cpp | 7 ++- .../spirv_assembly/vktSpvAsmInstructionTests.cpp | 14 +++--- .../vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp | 23 +++++++++- .../vktSpvAsmUboMatrixPaddingTests.cpp | 11 +++-- .../spirv_assembly/vktSpvAsmVariableInitTests.cpp | 7 ++- .../spirv_assembly/vktSpvAsmVaryingNameTests.cpp | 5 +-- 12 files changed, 75 insertions(+), 142 deletions(-) diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm16bitStorageTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm16bitStorageTests.cpp index 020e904..70c1d32 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm16bitStorageTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm16bitStorageTests.cpp @@ -4176,7 +4176,6 @@ void addGraphics16BitStorageInputOutputFloat16To16x2Group (tcu::TestCaseGroup* t SpecConstants noSpecConstants; PushConstants noPushConstants; vector extensions; - vector features; map noFragments; GraphicsResources noResources; StageToSpecConstantMap specConstantMap; @@ -4228,7 +4227,6 @@ void addGraphics16BitStorageInputOutputFloat16To16x2Group (tcu::TestCaseGroup* t noResources, interfaces, extensions, - features, requiredFeatures, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, QP_TEST_RESULT_FAIL, @@ -4252,7 +4250,6 @@ void addGraphics16BitStorageInputOutputInt16To16x2Group (tcu::TestCaseGroup* tes SpecConstants noSpecConstants; PushConstants noPushConstants; vector extensions; - vector features; map noFragments; GraphicsResources noResources; StageToSpecConstantMap specConstantMap; @@ -4306,7 +4303,6 @@ void addGraphics16BitStorageInputOutputInt16To16x2Group (tcu::TestCaseGroup* tes noResources, interfaces, extensions, - features, requiredFeatures, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, QP_TEST_RESULT_FAIL, diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCompositeInsertTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCompositeInsertTests.cpp index 6b53700..0d34f2b 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCompositeInsertTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCompositeInsertTests.cpp @@ -213,7 +213,6 @@ void addGraphicsVectorCompositeInsertTests (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - vector noFeatures; vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); vector refData; @@ -258,21 +257,21 @@ void addGraphicsVectorCompositeInsertTests (tcu::TestCaseGroup* group) vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_TRUE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_FALSE; createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, (testName + "_vert").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, (testName + "_tessc").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, (testName + "_tesse").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, (testName + "_geom").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_FALSE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_TRUE; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, (testName + "_frag").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); } } @@ -365,7 +364,6 @@ void addGraphicsMatrixCompositeInsertTests (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - vector noFeatures; vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); vector identityData; @@ -416,21 +414,21 @@ void addGraphicsMatrixCompositeInsertTests (tcu::TestCaseGroup* group) vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_TRUE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_FALSE; createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, (testName + "_vert").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, (testName + "_tessc").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, (testName + "_tesse").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, (testName + "_geom").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_FALSE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_TRUE; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, (testName + "_frag").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); } } } @@ -508,7 +506,6 @@ void addGraphicsNestedStructCompositeInsertTests (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - vector noFeatures; vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); vector identityData; @@ -559,21 +556,21 @@ void addGraphicsNestedStructCompositeInsertTests (tcu::TestCaseGroup* group) vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_TRUE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_FALSE; createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, (testName + "_vert").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, (testName + "_tessc").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, (testName + "_tesse").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, (testName + "_geom").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_FALSE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_TRUE; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, (testName + "_frag").c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); } } // anonymous diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp index aef15a4..493e47d 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp @@ -3121,7 +3121,6 @@ InstanceContext GraphicsTestGroupBuilder::createInstanceContext(const TestCaseIn resources.outputs.push_back(Resource(outBufferSp, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)); resources.verifyIO = checkFloatsLUT[outFloatType]; - vector features; StageToSpecConstantMap noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; @@ -3150,7 +3149,6 @@ InstanceContext GraphicsTestGroupBuilder::createInstanceContext(const TestCaseIn resources, noInterfaces, extensions, - features, vulkanFeatures, testedStage); diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp index 0d62543..8a4cb61 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp @@ -260,7 +260,6 @@ InstanceContext::InstanceContext (const RGBA (&inputs)[4], const GraphicsResources& resources_, const GraphicsInterfaces& interfaces_, const vector& extensions_, - const vector& features_, VulkanFeatures vulkanFeatures_, VkShaderStageFlags customizedStages_) : testCodeFragments (testCodeFragments_) @@ -268,7 +267,6 @@ InstanceContext::InstanceContext (const RGBA (&inputs)[4], , hasTessellation (false) , requiredStages (static_cast(0)) , requiredDeviceExtensions (extensions_) - , requiredDeviceFeatures (features_) , requestedFeatures (vulkanFeatures_) , pushConstants (pushConsants_) , customizedStages (customizedStages_) @@ -296,7 +294,6 @@ InstanceContext::InstanceContext (const InstanceContext& other) , hasTessellation (other.hasTessellation) , requiredStages (other.requiredStages) , requiredDeviceExtensions (other.requiredDeviceExtensions) - , requiredDeviceFeatures (other.requiredDeviceFeatures) , requestedFeatures (other.requestedFeatures) , pushConstants (other.pushConstants) , customizedStages (other.customizedStages) @@ -2476,38 +2473,6 @@ TestStatus runAndVerifyDefaultPipeline (Context& context, InstanceContext instan TCU_THROW(NotSupportedError, (std::string("Extension not supported: ") + *i).c_str()); } - { - for (deUint32 featureNdx = 0; featureNdx < instance.requiredDeviceFeatures.size(); ++featureNdx) - { - const string& feature = instance.requiredDeviceFeatures[featureNdx]; - - if (feature == "shaderInt16") - { - if (features.shaderInt16 != VK_TRUE) - TCU_THROW(NotSupportedError, "Device feature not supported: shaderInt16"); - } - else if (feature == "shaderInt64") - { - if (features.shaderInt64 != VK_TRUE) - TCU_THROW(NotSupportedError, "Device feature not supported: shaderInt64"); - } - else if (feature == "shaderFloat64") - { - if (features.shaderFloat64 != VK_TRUE) - TCU_THROW(NotSupportedError, "Device feature not supported: shaderFloat64"); - } - else if (feature == "fragmentStoresAndAtomics") - { - if (features.fragmentStoresAndAtomics != VK_TRUE) - TCU_THROW(NotSupportedError, "Device feature not supported: fragmentStoresAndAtomics"); - } - else - { - TCU_THROW(InternalError, (std::string("Unimplemented physical device feature: ") + feature).c_str()); - } - } - } - // Core features { const VkShaderStageFlags vertexPipelineStoresAndAtomicsAffected = vk::VK_SHADER_STAGE_VERTEX_BIT @@ -4141,7 +4106,6 @@ void createTestForStage (vk::VkShaderStageFlagBits stage, const GraphicsResources& resources, const GraphicsInterfaces& interfaces, const vector& extensions, - const vector& features, VulkanFeatures vulkanFeatures, tcu::TestCaseGroup* tests, const qpTestResult failResult, @@ -4156,7 +4120,7 @@ void createTestForStage (vk::VkShaderStageFlagBits stage, if (!specConstants.empty()) specConstantMap[stage] = specConstants; - InstanceContext ctx (inputColors, outputColors, testCodeFragments, specConstantMap, pushConstants, resources, interfaces, extensions, features, vulkanFeatures, stage); + InstanceContext ctx (inputColors, outputColors, testCodeFragments, specConstantMap, pushConstants, resources, interfaces, extensions, vulkanFeatures, stage); for (size_t i = 0; i < pipeline.size(); ++i) { ctx.moduleMap[pipeline[i].moduleName].push_back(std::make_pair(pipeline[i].entryName, pipeline[i].stage)); @@ -4180,7 +4144,6 @@ void createTestsForAllStages (const std::string& name, const GraphicsResources& resources, const GraphicsInterfaces& interfaces, const vector& extensions, - const vector& features, VulkanFeatures vulkanFeatures, tcu::TestCaseGroup* tests, const qpTestResult failResult, @@ -4188,23 +4151,23 @@ void createTestsForAllStages (const std::string& name, { createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, name + "_vert", inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, - interfaces, extensions, features, vulkanFeatures, tests, failResult, failMessageTemplate); + interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, name + "_tessc", inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, - interfaces, extensions, features, vulkanFeatures, tests, failResult, failMessageTemplate); + interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, name + "_tesse", inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, - interfaces, extensions, features, vulkanFeatures, tests, failResult, failMessageTemplate); + interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, name + "_geom", inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, - interfaces, extensions, features, vulkanFeatures, tests, failResult, failMessageTemplate); + interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, name + "_frag", inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, - interfaces, extensions, features, vulkanFeatures, tests, failResult, failMessageTemplate); + interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); } void addTessCtrlTest (tcu::TestCaseGroup* group, const char* name, const map& fragments) @@ -4214,7 +4177,7 @@ void addTessCtrlTest (tcu::TestCaseGroup* group, const char* name, const map(), vector(), VulkanFeatures(), group); + GraphicsInterfaces(), vector(), VulkanFeatures(), group); } } // SpirVAssembly diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.hpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.hpp index 51abffc..3bf3933 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.hpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.hpp @@ -266,7 +266,6 @@ struct InstanceContext bool hasTessellation; vk::VkShaderStageFlagBits requiredStages; std::vector requiredDeviceExtensions; - std::vector requiredDeviceFeatures; VulkanFeatures requestedFeatures; PushConstants pushConstants; // Specifies the (one or more) stages that use a customized shader code. @@ -295,7 +294,6 @@ struct InstanceContext const GraphicsResources& resources_, const GraphicsInterfaces& interfaces_, const std::vector& extensions_, - const std::vector& features_, VulkanFeatures vulkanFeatures_, VkShaderStageFlags customizedStages_); @@ -360,13 +358,12 @@ InstanceContext createInstanceContext (const ShaderElement (&elements)[N], const GraphicsResources& resources, const GraphicsInterfaces& interfaces, const std::vector& extensions, - const std::vector& features, VulkanFeatures vulkanFeatures, VkShaderStageFlags customizedStages, const qpTestResult failResult = QP_TEST_RESULT_FAIL, const std::string& failMessageTemplate = std::string()) { - InstanceContext ctx (inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, interfaces, extensions, features, vulkanFeatures, customizedStages); + InstanceContext ctx (inputColors, outputColors, testCodeFragments, specConstants, pushConstants, resources, interfaces, extensions, vulkanFeatures, customizedStages); for (size_t i = 0; i < N; ++i) { ctx.moduleMap[elements[i].moduleName].push_back(std::make_pair(elements[i].entryName, elements[i].stage)); @@ -387,7 +384,7 @@ inline InstanceContext createInstanceContext (const ShaderElement (&element { return createInstanceContext(elements, inputColors, outputColors, testCodeFragments, StageToSpecConstantMap(), PushConstants(), GraphicsResources(), - GraphicsInterfaces(), std::vector(), std::vector(), + GraphicsInterfaces(), std::vector(), VulkanFeatures(), vk::VK_SHADER_STAGE_ALL); } @@ -417,7 +414,6 @@ void createTestForStage (vk::VkShaderStageFlagBits stage, const GraphicsResources& resources, const GraphicsInterfaces& interfaces, const std::vector& extensions, - const std::vector& features, VulkanFeatures vulkanFeatures, tcu::TestCaseGroup* tests, const qpTestResult failResult = QP_TEST_RESULT_FAIL, @@ -433,7 +429,6 @@ void createTestsForAllStages (const std::string& name, const GraphicsResources& resources, const GraphicsInterfaces& interfaces, const std::vector& extensions, - const std::vector& features, VulkanFeatures vulkanFeatures, tcu::TestCaseGroup* tests, const qpTestResult failResult = QP_TEST_RESULT_FAIL, @@ -452,11 +447,10 @@ inline void createTestsForAllStages (const std::string& name, GraphicsResources noResources; GraphicsInterfaces noInterfaces; std::vector noExtensions; - std::vector noFeatures; createTestsForAllStages( name, inputColors, outputColors, testCodeFragments, noSpecConstants, noPushConstants, - noResources, noInterfaces, noExtensions, noFeatures, VulkanFeatures(), + noResources, noInterfaces, noExtensions, VulkanFeatures(), tests, failResult, failMessageTemplate); } @@ -473,11 +467,10 @@ inline void createTestsForAllStages (const std::string& name, GraphicsResources noResources; GraphicsInterfaces noInterfaces; std::vector noExtensions; - std::vector noFeatures; createTestsForAllStages( name, inputColors, outputColors, testCodeFragments, specConstants, noPushConstants, - noResources, noInterfaces, noExtensions, noFeatures, VulkanFeatures(), + noResources, noInterfaces, noExtensions, VulkanFeatures(), tests, failResult, failMessageTemplate); } @@ -495,33 +488,10 @@ inline void createTestsForAllStages (const std::string& name, SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - std::vector noFeatures; createTestsForAllStages( name, inputColors, outputColors, testCodeFragments, noSpecConstants, noPushConstants, - resources, noInterfaces, extensions, noFeatures, vulkanFeatures, - tests, failResult, failMessageTemplate); -} - -inline void createTestsForAllStages (const std::string& name, - const tcu::RGBA (&inputColors)[4], - const tcu::RGBA (&outputColors)[4], - const std::map& testCodeFragments, - const GraphicsResources& resources, - const std::vector& extensions, - const std::vector& features, - tcu::TestCaseGroup* tests, - VulkanFeatures vulkanFeatures = VulkanFeatures(), - const qpTestResult failResult = QP_TEST_RESULT_FAIL, - const std::string& failMessageTemplate = std::string()) -{ - SpecConstants noSpecConstants; - PushConstants noPushConstants; - GraphicsInterfaces noInterfaces; - - createTestsForAllStages( - name, inputColors, outputColors, testCodeFragments, noSpecConstants, noPushConstants, - resources, noInterfaces, extensions, features, vulkanFeatures, + resources, noInterfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); } @@ -538,12 +508,11 @@ inline void createTestsForAllStages (const std::string& name, { GraphicsResources noResources; SpecConstants noSpecConstants; - std::vector noFeatures; PushConstants noPushConstants; createTestsForAllStages( name, inputColors, outputColors, testCodeFragments, noSpecConstants, noPushConstants, - noResources, interfaces, extensions, noFeatures, vulkanFeatures, + noResources, interfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); } @@ -561,11 +530,10 @@ inline void createTestsForAllStages (const std::string& name, { SpecConstants noSpecConstants; GraphicsInterfaces noInterfaces; - std::vector noFeatures; createTestsForAllStages( name, inputColors, outputColors, testCodeFragments, noSpecConstants, pushConstants, - resources, noInterfaces, extensions, noFeatures, vulkanFeatures, + resources, noInterfaces, extensions, vulkanFeatures, tests, failResult, failMessageTemplate); } diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmImageSamplerTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmImageSamplerTests.cpp index 4fe0133..9d6a38f 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmImageSamplerTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmImageSamplerTests.cpp @@ -1045,7 +1045,6 @@ void addGraphicsImageSamplerTest (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - std::vector noFeatures; std::vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); @@ -1117,21 +1116,21 @@ void addGraphicsImageSamplerTest (tcu::TestCaseGroup* group) vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_TRUE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_FALSE; createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, "shader_vert", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, typeGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, typeGroup.get()); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, "shader_tessc", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, typeGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, typeGroup.get()); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, "shader_tesse", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, typeGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, typeGroup.get()); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, "shader_geom", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, typeGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, typeGroup.get()); vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_FALSE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_TRUE; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, "shader_frag", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, typeGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, typeGroup.get()); if (testNdx == TESTTYPE_OPTYPEIMAGE_MISMATCH) testtypeGroup->addChild(typeGroup.release()); @@ -1188,7 +1187,6 @@ void addGraphicsDepthPropertyTest (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - std::vector noFeatures; std::vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); @@ -1259,7 +1257,7 @@ void addGraphicsDepthPropertyTest (tcu::TestCaseGroup* group) getDefaultColors(defaultColors); createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, "shader_frag", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, descGroup.get()); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, descGroup.get()); readOpGroup->addChild(descGroup.release()); } diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmIndexingTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmIndexingTests.cpp index 2523a08..5ad6941 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmIndexingTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmIndexingTests.cpp @@ -311,7 +311,6 @@ void addGraphicsIndexingStructTests (tcu::TestCaseGroup* group) const string testName = chainOpTestNames[chainOpIdx] + string(sign == 0 ? "_u" : "_s") + de::toString(idxSize); VulkanFeatures vulkanFeatures; vector extensions; - vector features; SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; @@ -432,7 +431,7 @@ void addGraphicsIndexingStructTests (tcu::TestCaseGroup* group) if (idxSize == 16) { fragments["capability"] = "OpCapability Int16\n"; - features.push_back("shaderInt16"); + vulkanFeatures.coreFeatures.shaderInt16 = VK_TRUE; specs["convert"] = "OpUConvert"; specs["intdecl"] = " %u16 = OpTypeInt 16 0\n" " %i16 = OpTypeInt 16 1\n"; @@ -440,7 +439,7 @@ void addGraphicsIndexingStructTests (tcu::TestCaseGroup* group) else if (idxSize == 64) { fragments["capability"] = "OpCapability Int64\n"; - features.push_back("shaderInt64"); + vulkanFeatures.coreFeatures.shaderInt64 = VK_TRUE; specs["convert"] = "OpUConvert"; specs["intdecl"] = " %u64 = OpTypeInt 64 0\n" " %i64 = OpTypeInt 64 1\n"; @@ -493,7 +492,7 @@ void addGraphicsIndexingStructTests (tcu::TestCaseGroup* group) createTestsForAllStages( testName.c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, extensions, features, vulkanFeatures, structGroup.get()); + noPushConstants, resources, noInterfaces, extensions, vulkanFeatures, structGroup.get()); } } } diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp index 643b802..f9ef994 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp @@ -7094,16 +7094,16 @@ tcu::TestCaseGroup* createSpecConstantTests (tcu::TestContext& testCtx) map specializations; map fragments; SpecConstants specConstants; - vector features; PushConstants noPushConstants; GraphicsResources noResources; GraphicsInterfaces noInterfaces; std::vector noExtensions; + VulkanFeatures requiredFeatures; // Special SPIR-V code for SConvert-case if (strcmp(cases[caseNdx].caseName, "sconvert") == 0) { - features.push_back("shaderInt16"); + requiredFeatures.coreFeatures.shaderInt16 = VK_TRUE; fragments["capability"] = "OpCapability Int16\n"; // Adds 16-bit integer capability specializations["OPTYPE_DEFINITIONS"] = "%i16 = OpTypeInt 16 1\n"; // Adds 16-bit integer type specializations["TYPE_CONVERT"] = "%sc_op32 = OpSConvert %i32 %sc_op\n"; // Converts 16-bit integer to 32-bit integer @@ -7112,7 +7112,7 @@ tcu::TestCaseGroup* createSpecConstantTests (tcu::TestContext& testCtx) // Special SPIR-V code for FConvert-case if (strcmp(cases[caseNdx].caseName, "fconvert") == 0) { - features.push_back("shaderFloat64"); + requiredFeatures.coreFeatures.shaderFloat64 = VK_TRUE; fragments["capability"] = "OpCapability Float64\n"; // Adds 64-bit float capability specializations["OPTYPE_DEFINITIONS"] = "%f64 = OpTypeFloat 64\n"; // Adds 64-bit float type specializations["TYPE_CONVERT"] = "%sc_op32 = OpConvertFToS %i32 %sc_op\n"; // Converts 64-bit float to 32-bit integer @@ -7141,7 +7141,7 @@ tcu::TestCaseGroup* createSpecConstantTests (tcu::TestContext& testCtx) createTestsForAllStages( cases[caseNdx].caseName, inputColors, cases[caseNdx].expectedColors, fragments, specConstants, - noPushConstants, noResources, noInterfaces, noExtensions, features, VulkanFeatures(), group.get()); + noPushConstants, noResources, noInterfaces, noExtensions, requiredFeatures, group.get()); } const char decorations2[] = @@ -9641,7 +9641,6 @@ tcu::TestCaseGroup* createConvertGraphicsTests (tcu::TestContext& testCtx, const for (vector::const_iterator test = testCases.begin(); test != testCases.end(); ++test) { map fragments = getConvertCaseFragments(instruction, *test); - vector features; VulkanFeatures vulkanFeatures; GraphicsResources resources; vector extensions; @@ -9659,7 +9658,7 @@ tcu::TestCaseGroup* createConvertGraphicsTests (tcu::TestContext& testCtx, const createTestsForAllStages( test->m_name, defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, extensions, features, vulkanFeatures, group.get()); + noPushConstants, resources, noInterfaces, extensions, vulkanFeatures, group.get()); } return group.release(); } @@ -10719,7 +10718,6 @@ tcu::TestCaseGroup* createDerivativeTests (tcu::TestContext& testCtx) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - vector noFeatures; specs["op_code"] = testOp.opCode; specs["num_data_points"] = de::toString(testOp.inputData.size() / N); @@ -10745,7 +10743,7 @@ tcu::TestCaseGroup* createDerivativeTests (tcu::TestContext& testCtx) features.ext16BitStorage = EXT16BITSTORAGEFEATURES_UNIFORM_BUFFER_BLOCK; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, testName.c_str(), defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, specResource, noInterfaces, extensions, noFeatures, features, testGroup.get(), QP_TEST_RESULT_FAIL, string(), true); + noPushConstants, specResource, noInterfaces, extensions, features, testGroup.get(), QP_TEST_RESULT_FAIL, string(), true); } return testGroup.release(); diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp index f80a4dc..1ff806a 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp @@ -664,6 +664,21 @@ string getFullOperationWithDifferentInputWidthStr (string resultName, string spi return str; } +static inline void requiredFeaturesFromStrings(const std::vector &features, VulkanFeatures &requestedFeatures) +{ + for (deUint32 featureNdx = 0; featureNdx < features.size(); ++featureNdx) + { + const std::string& feature = features[featureNdx]; + + if (feature == "shaderInt16") + requestedFeatures.coreFeatures.shaderInt16 = VK_TRUE; + else if (feature == "shaderInt64") + requestedFeatures.coreFeatures.shaderInt64 = VK_TRUE; + else + DE_ASSERT(0); // Not implemented. Don't add to here. Just use VulkanFeatures + } +} + template class SpvAsmTypeTests : public tcu::TestCaseGroup { @@ -1481,7 +1496,9 @@ void SpvAsmTypeTests::createStageTests (const char* testName, fragments["extension"] = spirvExtensions; fragments["capability"] = spirvCapabilities; - createTestsForAllStages(testName, defaultColors, defaultColors, fragments, resources, noExtensions, features, this, requiredFeatures); + requiredFeaturesFromStrings(features, requiredFeatures); + + createTestsForAllStages(testName, defaultColors, defaultColors, fragments, resources, noExtensions, this, requiredFeatures); } template @@ -2087,7 +2104,9 @@ void SpvAsmTypeTests::createSwitchTests (void) fragments["extension"] = spirvExtensions; fragments["capability"] = spirvCapabilities; - createTestsForAllStages("switch", defaultColors, defaultColors, fragments, resources, noExtensions, features, this, requiredFeatures); + requiredFeaturesFromStrings(features, requiredFeatures); + + createTestsForAllStages("switch", defaultColors, defaultColors, fragments, resources, noExtensions, this, requiredFeatures); } template diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUboMatrixPaddingTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUboMatrixPaddingTests.cpp index 407b876..1c333a5 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUboMatrixPaddingTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUboMatrixPaddingTests.cpp @@ -153,7 +153,6 @@ void addGraphicsUboMatrixPaddingTest (tcu::TestCaseGroup* group) SpecConstants noSpecConstants; PushConstants noPushConstants; GraphicsInterfaces noInterfaces; - std::vector noFeatures; std::vector noExtensions; VulkanFeatures vulkanFeatures = VulkanFeatures(); @@ -249,21 +248,21 @@ void addGraphicsUboMatrixPaddingTest (tcu::TestCaseGroup* group) vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_TRUE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_FALSE; createTestForStage(VK_SHADER_STAGE_VERTEX_BIT, "mat2x2_vert", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, "mat2x2_tessc", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, "mat2x2_tesse", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); createTestForStage(VK_SHADER_STAGE_GEOMETRY_BIT, "mat2x2_geom", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); vulkanFeatures.coreFeatures.vertexPipelineStoresAndAtomics = DE_FALSE; vulkanFeatures.coreFeatures.fragmentStoresAndAtomics = DE_TRUE; createTestForStage(VK_SHADER_STAGE_FRAGMENT_BIT, "mat2x2_frag", defaultColors, defaultColors, fragments, noSpecConstants, - noPushConstants, resources, noInterfaces, noExtensions, noFeatures, vulkanFeatures, group); + noPushConstants, resources, noInterfaces, noExtensions, vulkanFeatures, group); } } // anonymous diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariableInitTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariableInitTests.cpp index 6413713..c756229 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariableInitTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariableInitTests.cpp @@ -556,7 +556,6 @@ void addGraphicsVariableInitOutputTest (tcu::TestCaseGroup* group) PushConstants noPushConstants; GraphicsInterfaces noInterfaces; vector extensions; - vector features; map noFragments; StageToSpecConstantMap specConstantMap; @@ -573,7 +572,8 @@ void addGraphicsVariableInitOutputTest (tcu::TestCaseGroup* group) group->addChild(outputGroup); - features.push_back("fragmentStoresAndAtomics"); + VulkanFeatures requiredFeatures; + requiredFeatures.coreFeatures.fragmentStoresAndAtomics = VK_TRUE; extensions.push_back("VK_KHR_storage_buffer_storage_class"); for (int paramIdx = 0; paramIdx < DE_LENGTH_OF_ARRAY(params); paramIdx++) @@ -598,8 +598,7 @@ void addGraphicsVariableInitOutputTest (tcu::TestCaseGroup* group) resources, noInterfaces, extensions, - features, - VulkanFeatures(), + requiredFeatures, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, QP_TEST_RESULT_FAIL, string()); diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVaryingNameTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVaryingNameTests.cpp index bcab925..8e995bf 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVaryingNameTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVaryingNameTests.cpp @@ -188,7 +188,7 @@ void addGraphicsVaryingNameTest (tcu::TestCaseGroup* group, const TestParams& pa PushConstants noPushConstants; GraphicsInterfaces noInterfaces; vector extensions; - vector features; + VulkanFeatures features; map noFragments; StageToSpecConstantMap specConstantMap; GraphicsResources resources; @@ -205,7 +205,7 @@ void addGraphicsVaryingNameTest (tcu::TestCaseGroup* group, const TestParams& pa getDefaultColors(defaultColors); - features.push_back("fragmentStoresAndAtomics"); + features.coreFeatures.fragmentStoresAndAtomics = VK_TRUE; extensions.push_back("VK_KHR_storage_buffer_storage_class"); resources.outputs.push_back(Resource(BufferSp(new Float32Buffer(expectedOutput)), VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)); @@ -221,7 +221,6 @@ void addGraphicsVaryingNameTest (tcu::TestCaseGroup* group, const TestParams& pa noInterfaces, extensions, features, - VulkanFeatures(), VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, QP_TEST_RESULT_FAIL, string()); -- 2.7.4