#include "pipe/p_screen.h"
#include "util/u_memory.h"
-#include "os/os_time.h"
+#include "util/os_time.h"
#include "swr_context.h"
#include "swr_screen.h"
#include "swr_fence.h"
+#ifdef __APPLE__
+#include <sched.h>
+#endif
+
#if defined(PIPE_CC_MSVC) // portable thread yield
#define sched_yield SwitchToThread
#endif
swr_fence_do_work(fence);
/* Correct value is in SwrSync data, and not the fence write field. */
- fence->read = userData2;
+ /* Contexts may not finish in order, but fence value always increases */
+ if (fence->read < userData2)
+ fence->read = userData2;
}
/*
/*
* Wait for the fence to finish.
*/
-boolean
+bool
swr_fence_finish(struct pipe_screen *screen,
struct pipe_context *ctx,
struct pipe_fence_handle *fence_handle,