On Thu, 7 Oct 2021 at 04:22, Zebediah Figura zfigura@codeweavers.com wrote:
dlls/wined3d/cs.c | 33 ++++++++++++++++++--------------- dlls/wined3d/wined3d_private.h | 4 ++-- 2 files changed, 20 insertions(+), 17 deletions(-)
Like in 1/3, prepare_upload_bo() has been renamed to map_upload_bo().
@@ -2492,11 +2492,9 @@ HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context, void *map_ptr; HRESULT hr;
- wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
- if ((flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) && (map_ptr = context->ops->map_upload_bo(context, resource,
sub_resource_idx, box, row_pitch, slice_pitch, flags)))
{sub_resource_idx, box, &row_pitch, &slice_pitch, flags)))
Would it then make sense to pass a wined3d_map_desc pointer to map_upload_bo()?
@@ -2505,6 +2503,8 @@ HRESULT wined3d_device_context_emit_map(struct wined3d_device_context *context, return WINED3D_OK; }
- wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
It's mostly inconsequential, but note that we only need to call this on success. Also, I suppose we might as well pass "&map_desc->row_pitch" and "&map_desc->slice_pitch" here.