On Wed, 9 Mar 2022 at 11:48, Stefan Dösinger stefan@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.