On Thu, 10 Mar 2022 at 08:44, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 09.03.2022 um 20:57 schrieb Henri Verbeet hverbeet@gmail.com: 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.
I find GE_WRAP helpful for the comment explaining what we do here.
Sure, but a regular function would also do that.