diff options
author | Marek Olšák <[email protected]> | 2011-03-07 22:35:49 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-03-11 21:39:30 +0100 |
commit | 25485f4b69447514ab8b595aced90c75606a99bd (patch) | |
tree | 51e9c5c6e295f6c79f2b1af9692bad9b04a8cc60 /src/gallium/drivers/i965 | |
parent | 2b64886c8122227ffa2d86abb9b4a5d79d1e2451 (diff) |
gallium: kill is_resource_referenced
Only st/xorg used it and even incorrectly with regards to pipelined transfers.
Diffstat (limited to 'src/gallium/drivers/i965')
-rw-r--r-- | src/gallium/drivers/i965/brw_resource_buffer.c | 20 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_resource_texture.c | 43 |
2 files changed, 0 insertions, 63 deletions
diff --git a/src/gallium/drivers/i965/brw_resource_buffer.c b/src/gallium/drivers/i965/brw_resource_buffer.c index afb96ee3e7f..32dc54f2b26 100644 --- a/src/gallium/drivers/i965/brw_resource_buffer.c +++ b/src/gallium/drivers/i965/brw_resource_buffer.c @@ -91,30 +91,10 @@ brw_buffer_transfer_unmap( struct pipe_context *pipe, } -static unsigned brw_buffer_is_referenced( struct pipe_context *pipe, - struct pipe_resource *resource, - unsigned level, - int layer) -{ - struct brw_context *brw = brw_context(pipe); - struct brw_winsys_buffer *batch_bo = brw->batch->buf; - struct brw_buffer *buf = brw_buffer(resource); - - if (buf->bo == NULL) - return PIPE_UNREFERENCED; - - if (!brw_screen(pipe->screen)->sws->bo_references( batch_bo, buf->bo )) - return PIPE_UNREFERENCED; - - return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; -} - - struct u_resource_vtbl brw_buffer_vtbl = { brw_buffer_get_handle, /* get_handle */ brw_buffer_destroy, /* resource_destroy */ - brw_buffer_is_referenced, /* is_resource_referenced */ u_default_get_transfer, /* get_transfer */ u_default_transfer_destroy, /* transfer_destroy */ brw_buffer_transfer_map, /* transfer_map */ diff --git a/src/gallium/drivers/i965/brw_resource_texture.c b/src/gallium/drivers/i965/brw_resource_texture.c index 0cb895f35de..71a18290248 100644 --- a/src/gallium/drivers/i965/brw_resource_texture.c +++ b/src/gallium/drivers/i965/brw_resource_texture.c @@ -225,48 +225,6 @@ static void brw_texture_destroy(struct pipe_screen *screen, } - - -static unsigned brw_texture_is_referenced( struct pipe_context *pipe, - struct pipe_resource *texture, - unsigned level, - int layer ) -{ - struct brw_context *brw = brw_context(pipe); - struct brw_screen *bscreen = brw_screen(pipe->screen); - struct brw_winsys_buffer *batch_bo = brw->batch->buf; - struct brw_texture *tex = brw_texture(texture); - struct brw_surface *surf; - int i; - - /* XXX: this is subject to false positives if the underlying - * texture BO is referenced, we can't tell whether the sub-region - * we care about participates in that. - */ - if (bscreen->sws->bo_references( batch_bo, tex->bo )) - return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; - - /* Find any view on this texture for this level/layer and see if it - * is referenced: - */ - for (i = 0; i < 2; i++) { - foreach (surf, &tex->views[i]) { - if (surf->bo == tex->bo) - continue; - - if (!(layer == -1 || surf->id.bits.layer == layer) || - surf->id.bits.level != level) - continue; - - if (bscreen->sws->bo_references( batch_bo, surf->bo)) - return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; - } - } - - return PIPE_UNREFERENCED; -} - - /* * Transfer functions */ @@ -347,7 +305,6 @@ struct u_resource_vtbl brw_texture_vtbl = { brw_texture_get_handle, /* get_handle */ brw_texture_destroy, /* resource_destroy */ - brw_texture_is_referenced, /* is_resource_referenced */ brw_texture_get_transfer, /* get_transfer */ u_default_transfer_destroy, /* transfer_destroy */ brw_texture_transfer_map, /* transfer_map */ |