#include "vkRefUtil.hpp"
#include "vkPlatform.hpp"
#include "vkDeviceUtil.hpp"
-#include "vkAllocationCallbackUtil.hpp"
#include "tcuCommandLine.hpp"
#include "tcuTestLog.hpp"
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 =
{
{
const Unique<VkDescriptorPool> descriptorPool(
createDescriptorPool(vkd, device,
- &descriptorPoolInfo,
- allocRecorder.getCallbacks()));
-
- checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkCreateDescriptorPool");
+ &descriptorPoolInfo));
const VkDescriptorSetLayoutBinding descriptorSetLayoutBinding =
{
DescriptorSetLayoutPtr(
new Unique<VkDescriptorSetLayout>(
createDescriptorSetLayout(vkd, device,
- &descriptorSetLayoutInfo,
- allocRecorder.getCallbacks()))));
+ &descriptorSetLayoutInfo))));
}
vector<VkDescriptorSetLayout> descriptorSetLayoutsRaw(numDescriptorSetsPerIter);
descriptorSetLayoutsRaw[ndx] = **descriptorSetLayouts[ndx];
}
- checkAndLogMemoryUsage(log, allocRecorder, "Memory usage after vkCreateDescriptorSetLayout");
-
const VkDescriptorSetAllocateInfo descriptorSetInfo =
{
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, // sType
}
}
-
- 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");
}