Alloc callbacks: don't report a quality warning for pooled objects
authorMaciej Jesionowski <maciej.jesionowski@mobica.com>
Wed, 7 Dec 2016 09:55:36 +0000 (10:55 +0100)
committerMaciej Jesionowski <maciej.jesionowski@mobica.com>
Wed, 7 Dec 2016 10:10:21 +0000 (06:10 -0400)
Modified tests:
- dEQP-VK.api.object_management.alloc_callback_fail_multiple.descriptor_set
- dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_primary
- dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_secondary

Change-Id: I0daea167c4b0c1e0a00039286b85af8c02e410f5

external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp

index 9f0b019b0b21ebbb376ba964a9f7f8a7fb264d8c..48e04ac457f21e8911f58b88e58c172f5275ebe8 100644 (file)
@@ -2519,11 +2519,12 @@ tcu::TestStatus allocCallbackFailTest (Context& context, typename Object::Parame
 }
 
 // Determine whether an API call sets the invalid handles to NULL (true) or leaves them undefined or not modified (false)
-template<typename T>
-inline bool isNullHandleOnAllocationFailure                            (void)  { return false; }
+template<typename T> inline bool isNullHandleOnAllocationFailure                        (void) { return false; }
+template<>                      inline bool isNullHandleOnAllocationFailure<VkPipeline> (void) { return true;  }
 
-template<>
-inline bool isNullHandleOnAllocationFailure<VkPipeline>        (void)  { return true; }
+template<typename T> inline bool isPooledObject                                                                 (void) { return false; };
+template<>                      inline bool isPooledObject<VkCommandBuffer>                     (void) { return true;  };
+template<>                      inline bool isPooledObject<VkDescriptorSet>                     (void) { return true;  };
 
 template<typename Object>
 tcu::TestStatus allocCallbackFailMultipleObjectsTest (Context& context, typename Object::Parameters params)
@@ -2592,7 +2593,12 @@ tcu::TestStatus allocCallbackFailMultipleObjectsTest (Context& context, typename
        }
 
        if (numPassingAllocs == 0)
-               return tcu::TestStatus(QP_TEST_RESULT_QUALITY_WARNING, "Allocation callbacks not called");
+       {
+               if (isPooledObject<typename Object::Type>())
+                       return tcu::TestStatus::pass("Not validated: pooled objects didn't seem to use host memory");
+               else
+                       return tcu::TestStatus(QP_TEST_RESULT_QUALITY_WARNING, "Allocation callbacks not called");
+       }
        else
                return tcu::TestStatus::pass("Ok");
 }