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

Henri Verbeet hverbeet at gmail.com
Wed Mar 9 11:57:11 CST 2022


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.



More information about the wine-devel mailing list