Remove use of alloc recorder from descriptor_pool.repeated_reset
authorPyry Haulos <phaulos@google.com>
Tue, 27 Sep 2016 23:01:53 +0000 (16:01 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 29 Sep 2016 19:20:36 +0000 (12:20 -0700)
Recording all allocations can take considerable amount of memory and it
appears that the tests just log the total memory usage and don't
otherwise need or check it.

Fixes #472

Change-Id: Ic8804b6781329a03e42fc481c0d430151b60ca88

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

index 792142c..9e3509c 100644 (file)
@@ -29,7 +29,6 @@
 #include "vkRefUtil.hpp"
 #include "vkPlatform.hpp"
 #include "vkDeviceUtil.hpp"
-#include "vkAllocationCallbackUtil.hpp"
 
 #include "tcuCommandLine.hpp"
 #include "tcuTestLog.hpp"
@@ -50,27 +49,11 @@ namespace
 using namespace std;
 using namespace vk;
 
-size_t checkAndLogMemoryUsage (tcu::TestLog& log, AllocationCallbackRecorder& allocRecorder, const char* prefix)
-{
-       size_t                                                          memoryUsage;
-       AllocationCallbackValidationResults validationResults;
-
-       validateAllocationCallbacks(allocRecorder, &validationResults);
-       memoryUsage = getLiveSystemAllocationTotal(validationResults);
-
-       log << tcu::TestLog::Message << prefix << ": " << memoryUsage << tcu::TestLog::EndMessage;
-
-       return memoryUsage;
-}
-
 tcu::TestStatus resetDescriptorPoolTest (Context& context, deUint32 numIterations)
 {
-       AllocationCallbackRecorder      allocRecorder(getSystemAllocator());
-
        const deUint32                          numDescriptorSetsPerIter = 2048;
        const DeviceInterface&          vkd                                              = context.getDeviceInterface();
        const VkDevice                          device                                   = context.getDevice();
-       tcu::TestLog&                           log                                              = context.getTestContext().getLog();
 
        const VkDescriptorPoolSize descriptorPoolSize =
        {
@@ -92,10 +75,7 @@ tcu::TestStatus resetDescriptorPoolTest (Context& context, deUint32 numIteration
        {
                const Unique<VkDescriptorPool> descriptorPool(
                        createDescriptorPool(vkd, device,
-                                                                &descriptorPoolInfo,
-                                                                allocRecorder.getCallbacks()));
-
-               checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkCreateDescriptorPool");
+                                                                &descriptorPoolInfo));
 
                const VkDescriptorSetLayoutBinding descriptorSetLayoutBinding =
                {
@@ -127,8 +107,7 @@ tcu::TestStatus resetDescriptorPoolTest (Context& context, deUint32 numIteration
                                        DescriptorSetLayoutPtr(
                                                new Unique<VkDescriptorSetLayout>(
                                                        createDescriptorSetLayout(vkd, device,
-                                                                                                         &descriptorSetLayoutInfo,
-                                                                                                         allocRecorder.getCallbacks()))));
+                                                                                                         &descriptorSetLayoutInfo))));
                        }
 
                        vector<VkDescriptorSetLayout> descriptorSetLayoutsRaw(numDescriptorSetsPerIter);
@@ -138,8 +117,6 @@ tcu::TestStatus resetDescriptorPoolTest (Context& context, deUint32 numIteration
                                descriptorSetLayoutsRaw[ndx] = **descriptorSetLayouts[ndx];
                        }
 
-                       checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkCreateDescriptorSetLayout");
-
                        const VkDescriptorSetAllocateInfo descriptorSetInfo =
                        {
                                VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, // sType
@@ -159,13 +136,8 @@ tcu::TestStatus resetDescriptorPoolTest (Context& context, deUint32 numIteration
                        }
 
                }
-
-               checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkDestroyDescriptorSetLayout");
-
        }
 
-       checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkDestroyDescriptorPool");
-
        // If it didn't crash, pass
        return tcu::TestStatus::pass("Pass");
 }