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
log << TestLog::Message << "Memory type: " << memoryType << TestLog::EndMessage;
log << TestLog::Message << "Memory heap: " << memoryHeap << TestLog::EndMessage;
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
TCU_THROW(NotSupportedError, "Memory heap doesn't have enough memory.");
try
{
m_heaps[heapNdx].heap = memoryProperties.memoryHeaps[heapNdx];
m_heaps[heapNdx].memoryUsage = 0;
{
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);
m_heaps[heapNdx].objects.reserve(100);
if (m_opNdx == 0)
{
log << TestLog::Message << "Performing " << m_opCount << " random VkAllocMemory() / VkFreeMemory() calls before freeing all memory." << TestLog::EndMessage;
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)
}
if (m_opNdx >= m_opCount)
const float allocationPercents[] =
{
const float allocationPercents[] =
{
};
const int allocationCounts[] =
};
const int allocationCounts[] =
{
const int allocationCount = allocationCounts[allocationCountNdx];
{
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;
continue;
TestConfig config;
if (allocationCount == -1)
{
if (allocationCount == -1)
{
- config.memoryAllocationCount = (int)(0.25f / allocationPercent);
+ config.memoryAllocationCount = (int)((1.00f / 8.00f) / allocationPercent);
if (config.memoryAllocationCount == 0
|| config.memoryAllocationCount == 1
if (config.memoryAllocationCount == 0
|| config.memoryAllocationCount == 1
void MemoryObject::randomFlush (const DeviceInterface& vkd, VkDevice device, de::Random& rng)
{
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<VkMappedMemoryRange> ranges (rangeCount);
randomRanges(rng, ranges, rangeCount, *m_memory, m_size);
vector<VkMappedMemoryRange> ranges (rangeCount);
randomRanges(rng, ranges, rangeCount, *m_memory, m_size);
void MemoryObject::randomInvalidate (const DeviceInterface& vkd, VkDevice device, de::Random& rng)
{
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<VkMappedMemoryRange> ranges (rangeCount);
randomRanges(rng, ranges, rangeCount, *m_memory, m_size);
vector<VkMappedMemoryRange> ranges (rangeCount);
randomRanges(rng, ranges, rangeCount, *m_memory, m_size);
- // 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