Spares feature is checked and sparse bindig condition bug is fixed.
authorPeter Siket <ps.szeged@partner.samsung.com>
Mon, 11 Jan 2016 15:34:08 +0000 (16:34 +0100)
committerPeter Siket <ps.szeged@partner.samsung.com>
Mon, 11 Jan 2016 15:34:08 +0000 (16:34 +0100)
external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp

index 0c7ffb43d4e59566f733b6abb6f0e487e0558ab3..5607a8cd43b3798c0f1e642e29884b185b18842e 100644 (file)
@@ -147,9 +147,9 @@ private:
                        return tcu::TestStatus::fail("Alloc memory failed! (requested memory size: " + de::toString(size) + ")");
 
                
-               if ((m_testCase.flags | VK_BUFFER_CREATE_SPARSE_BINDING_BIT ) ||
-                       (m_testCase.flags | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) ||
-                       (m_testCase.flags | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT))
+               if ((m_testCase.flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT ) ||
+                       (m_testCase.flags & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) ||
+                       (m_testCase.flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT))
                {
                        VkQueue queue                                                                                           = 0;
 
@@ -202,6 +202,19 @@ private:
 
 tcu::TestStatus BufferTestInstance::iterate (void)
 {
+       VkPhysicalDeviceFeatures                physicalDeviceFeatures;
+       
+       m_context.getInstanceInterface().getPhysicalDeviceFeatures(m_context.getPhysicalDevice(), &physicalDeviceFeatures);
+       
+       if ((m_testCase.flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT ) && !physicalDeviceFeatures.sparseBinding)
+               return tcu::TestStatus::pass("Sparse bindings feature is not enabled");
+
+       if ((m_testCase.flags & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT ) && !physicalDeviceFeatures.sparseResidencyBuffer)
+               return tcu::TestStatus::pass("Sparse buffer residency feature is not enabled");
+
+       if ((m_testCase.flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT ) && !physicalDeviceFeatures.sparseResidencyAliased)
+               return tcu::TestStatus::pass("Sparse aliased residency feature is not enabled");
+       
        const VkDeviceSize testSizes[] =
        {
                1,
@@ -209,7 +222,7 @@ tcu::TestStatus BufferTestInstance::iterate (void)
                15991,
                16384
        };
-       tcu::TestStatus testStatus                                      = tcu::TestStatus::pass("Buffer test");
+       tcu::TestStatus                                 testStatus                      = tcu::TestStatus::pass("Buffer test");
 
        for (int i = 0; i < DE_LENGTH_OF_ARRAY(testSizes); i++)
        {