[PATCH 2/5] wined3d: Use the default queue index for resource fencing.

Stefan Dösinger stefandoesinger at gmail.com
Thu Mar 10 01:44:38 CST 2022



> Am 09.03.2022 um 20:57 schrieb Henri Verbeet <hverbeet at gmail.com>:
> 
> On Wed, 9 Mar 2022 at 11:48, Stefan Dösinger <stefan at codeweavers.com> wrote:
>> +#define GE_WRAP(x, y) (((x)-(y)) < (UINT_MAX / 2))
>> +    if (!GE_WRAP(head, access_time))
>> +        return;
>> +
>> +    while (1)
>> +    {
>> +        tail = *(volatile ULONG *)&cs->queue[WINED3D_CS_QUEUE_DEFAULT].tail;
>> +        if (head == tail) /* Queue empty. */
>> +            break;
>> +
>> +        if (!GE_WRAP(access_time, tail) && access_time != tail)
>> +            break;
>> +
>>         YieldProcessor();
>> +    }
>> +#undef GE_WRAP
>> }
>> +C_ASSERT(WINED3D_CS_QUEUE_SIZE < UINT_MAX / 4);
>> 
> GE_WRAP doesn't need to be a macro, and we typically use "for (;;)"
> instead of "while (1)"; I'm not going to hold the series for that
> though.

I find GE_WRAP helpful for the comment explaining what we do here. I can remove it though if you prefer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220310/fadc21fa/attachment.sig>


More information about the wine-devel mailing list