[PATCH] wined3d: Prevent buildup of retired buffer objects' memory.

Henri Verbeet hverbeet at gmail.com
Tue Apr 20 09:32:32 CDT 2021


On Tue, 20 Apr 2021 at 16:10, Jan Sikorski <jsikorski at codeweavers.com> wrote:
> > On 20 Apr 2021, at 15:30, Henri Verbeet <hverbeet at gmail.com> wrote:
> > On Tue, 20 Apr 2021 at 11:37, Jan Sikorski <jsikorski at codeweavers.com> wrote:
> >> @@ -921,6 +921,9 @@ 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_counter += bo->size;
> >> }
> > Should we guard "retired_bo_counter" against overflow? On 32-bit
> > builds that has a maximum of 4GiB, which is perhaps not as much as it
> > once was in terms of VRAM.
>
> Right, that wouldn’t hurt even if it’s not that likely to happen, would you mind if I simply changed it to VkDeviceSize instead of doing overflow checks?
>
I think that's fine too.



More information about the wine-devel mailing list