diff options
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_context.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index d994a46ccf..4b470b2c6a 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -33,11 +33,10 @@ #include "r300_query.h" #include "r300_render.h" #include "r300_screen.h" +#include "r300_screen_buffer.h" #include "r300_state_invariant.h" -#include "r300_texture.h" #include "r300_transfer.h" - -#include "radeon_winsys.h" +#include "r300_winsys.h" static void r300_destroy_context(struct pipe_context* context) { @@ -72,29 +71,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) @@ -204,7 +197,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, /* Open up the OQ BO. */ r300->oqbo = screen->buffer_create(screen, 4096, - PIPE_BUFFER_USAGE_VERTEX, 4096); + PIPE_BUFFER_USAGE_PIXEL, 4096); make_empty_list(&r300->query_list); r300_init_flush_functions(r300); |