#include "tcuTextureUtil.hpp"
#include "tcuImageCompare.hpp"
#include "tcuTestLog.hpp"
+#include "tcuPlatform.hpp"
+#include "vkPlatform.hpp"
#include "deUniquePtr.hpp"
#include "deSharedPtr.hpp"
VkDeviceSize neededMemory = static_cast<VkDeviceSize>(static_cast<float>(colorSize + depthStencilSize) * additionalMemory) + reserveForChecking;
VkDeviceSize maxMemory = getMaxDeviceHeapSize(context, caseDef) >> 2;
+ vk::PlatformMemoryLimits memoryLimits;
+ context.getTestContext().getPlatform().getVulkanPlatform().getMemoryLimits(memoryLimits);
+ maxMemory = std::min(maxMemory, VkDeviceSize(memoryLimits.totalSystemMemory));
+
const VkDeviceSize deviceMemoryBudget = std::min(neededMemory, maxMemory);
bool allocationPossible = false;