summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2023-05-03 16:37:54 -0400
committerMarge Bot <emma+marge@anholt.net>2023-05-16 00:11:12 +0000
commit7ce82f1dec8b6a6beb7d541258015fecc380b742 (patch)
tree8433933ba7e45999b5563860c6a3465c147a67eb
parent5dd63a69dad996fad50788598753f69255053294 (diff)
downloadmesa-7ce82f1dec8b6a6beb7d541258015fecc380b742.tar.gz
zink: set higher prio on dedicated memory allocations
this should guarantee that e.g., swapchain type images aren't paged out Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22855>
-rw-r--r--src/gallium/drivers/zink/zink_bo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_bo.c b/src/gallium/drivers/zink/zink_bo.c
index adcaa71134c..b875925984e 100644
--- a/src/gallium/drivers/zink/zink_bo.c
+++ b/src/gallium/drivers/zink/zink_bo.c
@@ -268,6 +268,14 @@ bo_create_internal(struct zink_screen *screen,
if (screen->info.have_KHR_buffer_device_address)
pNext = &ai;
+ VkMemoryPriorityAllocateInfoEXT prio = {
+ VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT,
+ pNext,
+ (flags & ZINK_ALLOC_NO_SUBALLOC) ? 1.0 : 0.5,
+ };
+ if (screen->info.have_EXT_memory_priority)
+ pNext = &prio;
+
VkMemoryAllocateInfo mai;
mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
mai.pNext = pNext;