From d71966c77e64f1fdf34cc36154d294da01c52afc Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 6 Sep 2024 12:23:14 +0200 Subject: [PATCH] vkd3d: Do not keep track of descriptor heaps when using virtual heaps. Descriptors only need flushing when using Vulkan heaps, so let's avoid uselessly scanning an array and taking and releasing a mutex if we're not. --- libs/vkd3d/command.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 86a10887..188162f9 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3210,6 +3210,9 @@ static void command_list_flush_vk_heap_updates(struct d3d12_command_list *list) static void command_list_add_descriptor_heap(struct d3d12_command_list *list, struct d3d12_descriptor_heap *heap) { + if (!list->device->use_vk_heaps) + return; + if (!contains_heap(list->descriptor_heaps, list->descriptor_heap_count, heap)) { if (list->descriptor_heap_count == ARRAY_SIZE(list->descriptor_heaps))