Jan Sikorski : wined3d: Count all bo's towards retired bo size.

Alexandre Julliard julliard at winehq.org
Thu Oct 14 15:09:33 CDT 2021


Module: wine
Branch: master
Commit: b70a7f37bc44720c6b69b9323911b9b1e4b15c08
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b70a7f37bc44720c6b69b9323911b9b1e4b15c08

Author: Jan Sikorski <jsikorski at codeweavers.com>
Date:   Tue Oct 12 15:49:27 2021 +0200

wined3d: Count all bo's towards retired bo size.

Some memory may be counted more than once, as suballocations and as
backing memory for these suballocations. It doesn't seem worth worrying
about, since the threshold and the mechanism itself are heuristic.

Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context_vk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 8f0751785ad..af7b9fc1830 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -901,6 +901,9 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
 
     TRACE("context_vk %p, bo %p.\n", context_vk, bo);
 
+    if (bo->command_buffer_id == context_vk->current_command_buffer.id)
+        context_vk->retired_bo_size += bo->size;
+
     if ((slab_vk = bo->slab))
     {
         if (bo->map_ptr)
@@ -923,9 +926,6 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
     if (bo->map_ptr)
         VK_CALL(vkUnmapMemory(device_vk->vk_device, bo->vk_memory));
     wined3d_context_vk_destroy_vk_memory(context_vk, bo->vk_memory, bo->command_buffer_id);
-
-    if (bo->command_buffer_id == context_vk->current_command_buffer.id)
-        context_vk->retired_bo_size += bo->size;
 }
 
 void wined3d_context_vk_poll_command_buffers(struct wined3d_context_vk *context_vk)




More information about the wine-cvs mailing list