Skip to content

Instantly share code, notes, and snippets.

@laino
Created July 22, 2016 04:00
Show Gist options
  • Save laino/7f7f0ad3596fc7301f8e7181528a6b46 to your computer and use it in GitHub Desktop.
Save laino/7f7f0ad3596fc7301f8e7181528a6b46 to your computer and use it in GitHub Desktop.
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 98cfa2e..3934469 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -661,7 +661,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
* In Counter-Strike: Source a frame difference of 3 causes noticable
* input delay that makes the game unplayable. */
while (pending > 1)
+ {
+ usleep(0);
pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
+ }
}
static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -3193,7 +3196,8 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs)
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
- while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE))
+ usleep(0);
}
static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs)
@@ -3215,7 +3219,8 @@ static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs)
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
- while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE))
+ usleep(0);
}
static const struct wined3d_cs_ops wined3d_cs_mt_ops =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment