wined3d: Use YieldProcessor().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-01-20 22:35:48 -06:00 committed by Alexandre Julliard
parent 86fc30c105
commit 6bdf641142
2 changed files with 3 additions and 10 deletions

View File

@ -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 =

View File

@ -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