Module: wine Branch: master Commit: 626dc29ae2b0ccee93539959f2070df1407a36c9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=626dc29ae2b0ccee93539959f... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 10 19:02:36 2022 -0600 wined3d: Always submit UPDATE_SUB_RESOURCE ops when uploading if not mapping persistently. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index ffa0689e5a4..27a597d0b74 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3113,7 +3113,10 @@ static bool wined3d_cs_map_upload_bo(struct wined3d_device_context *context, str if (bo) { map_ptr += bo->memory_offset; - if (!bo->coherent) + /* If we are not mapping all buffers persistently, use + * UPDATE_SUB_RESOURCE as a means of telling the CS thread to try + * to unmap the resource, so that we can free VA space. */ + if (!bo->coherent || !wined3d_map_persistent()) client->mapped_upload.flags |= UPLOAD_BO_UPLOAD_ON_UNMAP; } map_desc->data = resource_offset_map_pointer(resource, sub_resource_idx, map_ptr, box);