Mesa (master): r300g: add buffer/texture referenced checks.
Dave Airlie
airlied at kemper.freedesktop.org
Sat Mar 20 14:00:21 PDT 2010
Module: Mesa
Branch: master
Commit: 03f1896304da481bd054779a025a4509f7ea59af
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=03f1896304da481bd054779a025a4509f7ea59af
Author: Dave Airlie <airlied at redhat.com>
Date: Sun Mar 21 06:32:48 2010 +1000
r300g: add buffer/texture referenced checks.
I've no idea about the comments that were in there, just pass
this down to the winsys.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/drivers/r300/r300_context.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 210e31e..a55d2db 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -72,29 +72,23 @@ static void r300_destroy_context(struct pipe_context* context)
}
static unsigned int
-r300_is_texture_referenced(struct pipe_context *pipe,
+r300_is_texture_referenced(struct pipe_context *context,
struct pipe_texture *texture,
unsigned face, unsigned level)
{
- return 0;
+ struct r300_context* r300 = r300_context(context);
+ struct r300_texture* tex = (struct r300_texture*)texture;
+
+ return r300->rws->is_buffer_referenced(r300->rws, tex->buffer);
}
static unsigned int
-r300_is_buffer_referenced(struct pipe_context *pipe,
+r300_is_buffer_referenced(struct pipe_context *context,
struct pipe_buffer *buf)
{
- /* This only checks to see whether actual hardware buffers are
- * referenced. Since we use managed BOs and transfers, it's actually not
- * possible for pipe_buffers to ever reference the actual hardware, so
- * buffers are never referenced.
- */
-
- /* XXX: that doesn't make sense given that
- * r300_is_texture_referenced is implemented on top of this
- * function and hardware can certainly refer to textures
- * directly...
- */
- return 0;
+ struct r300_context* r300 = r300_context(context);
+
+ return r300_buffer_is_referenced(r300, buf);
}
static void r300_flush_cb(void *data)
More information about the mesa-commit
mailing list