summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_rast.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-11 17:57:45 -0700
committerBrian Paul <brianp@vmware.com>2009-12-11 17:57:45 -0700
commit4b70af918dd9040a6987c6a55e76e49f0e3f90bf (patch)
treeeb3e587da8e9a72136490461099c75972f15a8e5 /src/gallium/drivers/llvmpipe/lp_rast.c
parent932374073863379e9da862d6115410889f038154 (diff)
llvmpipe: added lp_rast_fence() bin function
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 6b7aa8d729..3e7b3d7ab4 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -32,6 +32,7 @@
#include "lp_bin_queue.h"
#include "lp_debug.h"
+#include "lp_fence.h"
#include "lp_state.h"
#include "lp_rast.h"
#include "lp_rast_priv.h"
@@ -506,6 +507,30 @@ lp_rast_end_tile( struct lp_rasterizer *rast,
/**
+ * Signal on a fence. This is called during bin execution/rasterization.
+ * Called per thread.
+ */
+void lp_rast_fence( struct lp_rasterizer *rast,
+ unsigned thread_index,
+ const union lp_rast_cmd_arg arg )
+{
+ struct lp_fence *fence = arg.fence;
+
+ pipe_mutex_lock( fence->mutex );
+
+ fence->count++;
+ assert(fence->count <= fence->rank);
+
+ LP_DBG(DEBUG_RAST, "%s count=%u rank=%u\n", __FUNCTION__,
+ fence->count, fence->rank);
+
+ pipe_condvar_signal( fence->signalled );
+
+ pipe_mutex_unlock( fence->mutex );
+}
+
+
+/**
* When all the threads are done rasterizing a bin, one thread will
* call this function to reset the bin and put it onto the empty queue.
*/