Zebediah Figura : wined3d: Use YieldProcessor().

Alexandre Julliard julliard at winehq.org
Thu Jan 21 16:19:14 CST 2021


Module: wine
Branch: master
Commit: 6bdf641142c631ce22784da16cf8ff0bda4f3a70
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6bdf641142c631ce22784da16cf8ff0bda4f3a70

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Jan 20 22:35:48 2021 -0600

wined3d: Use YieldProcessor().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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




More information about the wine-cvs mailing list