From b37be9359555280edcf3a34f4f70132df2a69020 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mika=20Isoj=C3=A4rvi?= Date: Mon, 4 Jan 2016 15:40:42 -0800 Subject: [PATCH] Fix issues in memory tests. Change memory mapping tests to use 1/16th of memory at most. Change memory allocation tests to use 1/8th of memory at most. Fix number of ranges in random flush and random finish calls. Change-Id: Ie8c5ad688c6243c69ea5de8681cf3b4e4a7c5c93 --- .../modules/vulkan/memory/vktMemoryAllocationTests.cpp | 12 ++++++------ .../modules/vulkan/memory/vktMemoryMappingTests.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp index 1ad6702..3582487 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp @@ -147,7 +147,7 @@ tcu::TestStatus AllocateFreeTestInstance::iterate (void) log << TestLog::Message << "Memory type: " << memoryType << TestLog::EndMessage; log << TestLog::Message << "Memory heap: " << memoryHeap << TestLog::EndMessage; - if (allocationSize * m_config.memoryAllocationCount * 4 > memoryHeap.size) + if (allocationSize * m_config.memoryAllocationCount * 8 > memoryHeap.size) TCU_THROW(NotSupportedError, "Memory heap doesn't have enough memory."); try @@ -300,7 +300,7 @@ RandomAllocFreeTestInstance::RandomAllocFreeTestInstance (Context& context, deUi { m_heaps[heapNdx].heap = memoryProperties.memoryHeaps[heapNdx]; m_heaps[heapNdx].memoryUsage = 0; - m_heaps[heapNdx].maxMemoryUsage = m_heaps[heapNdx].heap.size / 4; + m_heaps[heapNdx].maxMemoryUsage = m_heaps[heapNdx].heap.size / 8; m_heaps[heapNdx].objects.reserve(100); @@ -348,7 +348,7 @@ tcu::TestStatus RandomAllocFreeTestInstance::iterate (void) if (m_opNdx == 0) { log << TestLog::Message << "Performing " << m_opCount << " random VkAllocMemory() / VkFreeMemory() calls before freeing all memory." << TestLog::EndMessage; - log << TestLog::Message << "Using max one fourth of the memory in each memory heap." << TestLog::EndMessage; + log << TestLog::Message << "Using max 1/8 of the memory in each memory heap." << TestLog::EndMessage; } if (m_opNdx >= m_opCount) @@ -477,7 +477,7 @@ tcu::TestCaseGroup* createAllocationTests (tcu::TestContext& testCtx) const float allocationPercents[] = { - 0.01f, 0.1f, 0.25f + 0.01f }; const int allocationCounts[] = @@ -566,7 +566,7 @@ tcu::TestCaseGroup* createAllocationTests (tcu::TestContext& testCtx) { const int allocationCount = allocationCounts[allocationCountNdx]; - if ((allocationCount != -1) && ((float)allocationCount * allocationPercent > 0.25f)) + if ((allocationCount != -1) && ((float)allocationCount * allocationPercent >= 1.00f / 8.00f)) continue; TestConfig config; @@ -576,7 +576,7 @@ tcu::TestCaseGroup* createAllocationTests (tcu::TestContext& testCtx) if (allocationCount == -1) { - config.memoryAllocationCount = (int)(0.25f / allocationPercent); + config.memoryAllocationCount = (int)((1.00f / 8.00f) / allocationPercent); if (config.memoryAllocationCount == 0 || config.memoryAllocationCount == 1 diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp index 7034149..ea3cd65 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp @@ -479,7 +479,7 @@ void MemoryObject::unmap (void) void MemoryObject::randomFlush (const DeviceInterface& vkd, VkDevice device, de::Random& rng) { - const size_t rangeCount = (size_t)rng.getInt(0, 10); + const size_t rangeCount = (size_t)rng.getInt(1, 10); vector ranges (rangeCount); randomRanges(rng, ranges, rangeCount, *m_memory, m_size); @@ -489,7 +489,7 @@ void MemoryObject::randomFlush (const DeviceInterface& vkd, VkDevice device, de: void MemoryObject::randomInvalidate (const DeviceInterface& vkd, VkDevice device, de::Random& rng) { - const size_t rangeCount = (size_t)rng.getInt(0, 10); + const size_t rangeCount = (size_t)rng.getInt(1, 10); vector ranges (rangeCount); randomRanges(rng, ranges, rangeCount, *m_memory, m_size); @@ -499,8 +499,8 @@ void MemoryObject::randomInvalidate (const DeviceInterface& vkd, VkDevice device enum { - // Use only 1/8 of each memory heap. - MAX_MEMORY_USAGE_DIV = 8 + // Use only 1/16 of each memory heap. + MAX_MEMORY_USAGE_DIV = 16 }; template -- 2.7.4