summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_flush.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-04-25 16:59:09 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-04-25 23:41:48 +0100
commit43b85af56efbe6eb06f4e62d23e9f6f583c5ec2e (patch)
treee5d96cc5349ba5efbae081771f000d6c9f6ef5d3 /src/gallium/drivers/llvmpipe/lp_flush.c
parent8352983e2ab9523345f2b2b3db62db19f01fab62 (diff)
llvmpipe: Cleanup/improve llvmpipe_flush_resource usage.
Recognize PIPE_TRANSFER_UNSYNCHRONIZED and PIPE_TRANSFER_DONTBLOCK.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_flush.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_flush.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
index 153491378a..470132d49f 100644
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
@@ -96,6 +96,9 @@ llvmpipe_flush( struct pipe_context *pipe,
/**
* Flush context if necessary.
*
+ * Returns FALSE if it would have block, but do_not_block was set, TRUE
+ * otherwise.
+ *
* TODO: move this logic to an auxiliary library?
*/
boolean
@@ -106,7 +109,7 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
unsigned flush_flags,
boolean read_only,
boolean cpu_access,
- boolean do_not_flush)
+ boolean do_not_block)
{
unsigned referenced;
@@ -115,9 +118,6 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
if ((referenced & PIPE_REFERENCED_FOR_WRITE) ||
((referenced & PIPE_REFERENCED_FOR_READ) && !read_only)) {
- if (do_not_flush)
- return FALSE;
-
/*
* TODO: The semantics of these flush flags are too obtuse. They should
* disappear and the pipe driver should just ensure that all visible
@@ -136,6 +136,9 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
struct pipe_fence_handle *fence = NULL;
+ if (do_not_block)
+ return FALSE;
+
pipe->flush(pipe, flush_flags, &fence);
if (fence) {