[PATCH v2 5/5] wined3d: Implement NOOVERWITE maps in wined3d_deferred_context_prepare_upload_bo().

Zebediah Figura (she/her) zfigura at codeweavers.com
Wed Jun 30 11:46:20 CDT 2021


On 6/30/21 7:15 AM, Henri Verbeet wrote:
> On Wed, 30 Jun 2021 at 06:34, Zebediah Figura <z.figura12 at gmail.com> wrote:
>> @@ -3452,12 +3452,31 @@ static void *wined3d_deferred_context_prepare_upload_bo(struct wined3d_device_co
>>           return NULL;
>>       }
>>
>> -    if (flags & ~(WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD))
>> +    if (flags & ~(WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE))
>>       {
>>           FIXME("Unhandled flags %#x.\n", flags);
>>           return NULL;
>>       }
>>
>> +    if (flags & WINED3D_MAP_NOOVERWRITE)
>> +    {
>> +        int i = deferred->upload_count;
>> +
>> +        while (i--)
>> +        {
>> +            struct wined3d_deferred_upload *upload = &deferred->uploads[i];
>> +
>> +            if (upload->resource == resource && upload->sub_resource_idx == sub_resource_idx)
>> +            {
>> +                address->buffer_object = 0;
>> +                address->addr = upload->sysmem;
>> +                return upload->sysmem;
>> +            }
>> +        }
>> +
>> +        return NULL;
>> +    }
>> +
> I.e., wined3d_deferred_context_get_upload_bo(), right?
> 

Y...es. Except it's a bit conceptually awkward because of box sizes. 
Perhaps a common helper would be better.



More information about the wine-devel mailing list