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)
committerPyry Haulos <phaulos@google.com>
Thu, 15 Dec 2016 14:42:08 +0000 (10:42 -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
(cherry picked from commit ca634a5ac0b5278736e012f43a59bb25a5234e6f)

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

index 9f0b019..48e04ac 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");
 }