From 6bdf641142c631ce22784da16cf8ff0bda4f3a70 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 20 Jan 2021 22:35:48 -0600 Subject: [PATCH] wined3d: Use YieldProcessor(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/cs.c | 4 ++-- dlls/wined3d/wined3d_private.h | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 0b9c5f70043..56df760145a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -646,7 +646,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw * ahead of the worker thread. */ while (pending >= swapchain->max_frame_latency) { - wined3d_pause(); + YieldProcessor(); pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); } } @@ -2822,7 +2822,7 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id return wined3d_cs_st_finish(cs, queue_id); while (cs->queue[queue_id].head != *(volatile LONG *)&cs->queue[queue_id].tail) - wined3d_pause(); + YieldProcessor(); } static const struct wined3d_cs_ops wined3d_cs_mt_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 37fe3a314cb..e010deb1264 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -424,13 +424,6 @@ static inline unsigned int wined3d_popcount(unsigned int x) #endif } -static inline void wined3d_pause(void) -{ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#endif -} - #define ORM_BACKBUFFER 0 #define ORM_FBO 1 @@ -4817,7 +4810,7 @@ static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource) return; while (InterlockedCompareExchange(&resource->access_count, 0, 0)) - wined3d_pause(); + YieldProcessor(); } /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other