[PATCH 2/3] wined3d: Return the map pitch from the prepare_upload_bo() callbacks.

Zebediah Figura zfigura at codeweavers.com
Sun Oct 10 22:23:14 CDT 2021


On 10/8/21 11:23 AM, Henri Verbeet wrote:
> On Thu, 7 Oct 2021 at 04:22, Zebediah Figura <zfigura at 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()?

Sure, that seems reasonable.

> 
>> @@ -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.
> 



More information about the wine-devel mailing list