// Determine the maximum memory heap space available for protected images
vk::VkPhysicalDeviceMemoryProperties memoryProperties = vk::getPhysicalDeviceMemoryProperties(context.getInstanceDriver(), context.getPhysicalDevice());
vk::VkDeviceSize protectedHeapSize = 0;
- vk::VkDeviceSize maxMemoryUsage = 0;
deUint32 protectedHeapMask = 0;
for (deUint32 memType = 0; memType < memoryProperties.memoryTypeCount; memType++)
(protectedHeapMask & (1u << heapIndex)) == 0)
{
protectedHeapSize = de::max(protectedHeapSize, memoryProperties.memoryHeaps[heapIndex].size);
- maxMemoryUsage = protectedHeapSize / 4 ; /* Use at maximum 25% of heap */
protectedHeapMask |= 1u << heapIndex;
}
}
// If the implementation doesn't have a max image count, min+16 means we won't clamp.
- // Limit it to how many protected images we estimate can be allocated - 25% of heap size
+ // Limit it to how many protected images we estimate can be allocated
const deUint32 maxImageCount = de::min((capabilities.maxImageCount > 0) ? capabilities.maxImageCount : capabilities.minImageCount + 16u,
- deUint32(maxMemoryUsage / memoryRequirements.size));
+ deUint32(protectedHeapSize / memoryRequirements.size));
if (maxImageCount < capabilities.minImageCount)
TCU_THROW(NotSupportedError, "Memory heap doesn't have enough memory!.");
vk::VkDevice device = context.getDevice();
vk::VkPhysicalDeviceMemoryProperties memoryProperties = vk::getPhysicalDeviceMemoryProperties(context.getInstanceDriver(), context.getPhysicalDevice());
vk::VkDeviceSize protectedHeapSize = 0;
- vk::VkDeviceSize maxMemoryUsage = 0;
for (deUint32 memType = 0; memType < memoryProperties.memoryTypeCount; memType++)
{
#endif
{
protectedHeapSize = de::max(protectedHeapSize, memoryProperties.memoryHeaps[heapIndex].size);
- maxMemoryUsage = protectedHeapSize / 4 ; /* Use at maximum 25% of heap */
}
}
}
// Check for the image size requirement based on double/triple buffering
- if (memoryRequirements.size * capabilities.minImageCount < maxMemoryUsage)
+ if (memoryRequirements.size * capabilities.minImageCount < protectedHeapSize)
{
cases.push_back(baseParameters);
cases.back().imageFormat = curFmt->format;
vk::VkDevice device = context.getDevice();
vk::VkPhysicalDeviceMemoryProperties memoryProperties = vk::getPhysicalDeviceMemoryProperties(context.getInstanceDriver(), context.getPhysicalDevice());
vk::VkDeviceSize protectedHeapSize = 0;
- vk::VkDeviceSize maxMemoryUsage = 0;
for (deUint32 memType = 0; memType < memoryProperties.memoryTypeCount; memType++)
{
#endif
{
protectedHeapSize = de::max(protectedHeapSize, memoryProperties.memoryHeaps[heapIndex].size);
- maxMemoryUsage = protectedHeapSize / 4 ; /* Use at maximum 25% of heap */
}
}
}
// Check for the image size requirement based on double/triple buffering
- if (memoryRequirements.size * capabilities.minImageCount < maxMemoryUsage)
+ if (memoryRequirements.size * capabilities.minImageCount < protectedHeapSize)
{
cases.push_back(baseParameters);
cases.back().imageExtent.width = de::clamp(s_testSizes[ndx].width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width);
}
// Check for the image size requirement based on double/triple buffering
- if (memoryRequirements.size * capabilities.minImageCount < maxMemoryUsage)
+ if (memoryRequirements.size * capabilities.minImageCount < protectedHeapSize)
{
cases.push_back(baseParameters);
cases.back().imageExtent = capabilities.currentExtent;
}
// Check for the image size requirement based on double/triple buffering
- if (memoryRequirements.size * capabilities.minImageCount < maxMemoryUsage)
+ if (memoryRequirements.size * capabilities.minImageCount < protectedHeapSize)
{
cases.push_back(baseParameters);
cases.back().imageExtent =s_testExtentSizes[ndx];