Module: wine Branch: master Commit: e906468c64498db006dd98cb726a34ef1f71a24d URL: https://source.winehq.org/git/wine.git/?a=commit;h=e906468c64498db006dd98cb7...
Author: Zebediah Figura zfigura@codeweavers.com Date: Tue Sep 28 16:12:49 2021 -0500
wined3d: Call prepare_upload_bo in wined3d_device_context_emit_map() only for DISCARD or NOOVERWRITE maps.
We can't do an asynchronous upload with just WINED3D_MAP_WRITE, but we can with update_sub_resource, and prepare_upload_bo doesn't know which it was called from.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 2d295d4660e..77c27e6cad0 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2463,7 +2463,8 @@ HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context,
wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
- if ((*map_ptr = context->ops->prepare_upload_bo(context, resource, + if ((flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) + && (*map_ptr = context->ops->prepare_upload_bo(context, resource, sub_resource_idx, box, row_pitch, slice_pitch, flags, &addr))) { TRACE("Returning upload bo %s, map pointer %p, row pitch %u, slice pitch %u.\n",