From: Pyry Haulos Date: Fri, 19 Aug 2016 12:20:38 +0000 (+0100) Subject: Limit maximum allocation size in memory mapping tests X-Git-Tag: upstream/1.3.5~1205^2^2~2^2^2^2~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=adff582b509ac5e941721b040f575dbc9319b0ed;p=platform%2Fupstream%2FVK-GL-CTS.git Limit maximum allocation size in memory mapping tests Fixes also ReferenceMemory::m_flushed memory usage counting when estimating reference memory usage (size should be divided by atomSize). Fixes #468 Bug: b/69677943 Change-Id: Iad754e211e8070b09254d2451e03418fc2be541b --- diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp index 74aee73..23bb21b 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp @@ -786,8 +786,8 @@ void MemoryObject::randomInvalidate (const DeviceInterface& vkd, VkDevice device enum { - // Use only 1/2 of each memory heap. - MAX_MEMORY_USAGE_DIV = 2 + MAX_MEMORY_USAGE_DIV = 2, // Use only 1/2 of each memory heap. + MAX_MEMORY_ALLOC_DIV = 2, // Do not alloc more than 1/2 of available space. }; template @@ -1067,14 +1067,14 @@ MemoryObject* MemoryHeap::allocateRandom (const DeviceInterface& vkd, VkDevice d } const MemoryType type = memoryTypeMaxSizePair.first; - const VkDeviceSize maxAllocationSize = memoryTypeMaxSizePair.second; + const VkDeviceSize maxAllocationSize = memoryTypeMaxSizePair.second / MAX_MEMORY_ALLOC_DIV; const VkDeviceSize atomSize = (type.type.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0 ? 1 : m_nonCoherentAtomSize; const VkDeviceSize allocationSizeGranularity = de::max(atomSize, getMemoryClass() == MEMORY_CLASS_DEVICE ? m_limits.devicePageSize : getHostPageSize()); const VkDeviceSize size = randomSize(rng, atomSize, maxAllocationSize); const VkDeviceSize memoryUsage = roundUpToMultiple(size, allocationSizeGranularity); - const VkDeviceSize referenceMemoryUsage = size + divRoundUp(size, 8) + divRoundUp(size, atomSize); + const VkDeviceSize referenceMemoryUsage = size + divRoundUp(size, 8) + divRoundUp(size / atomSize, 8); DE_ASSERT(size <= maxAllocationSize);