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/llvmpipe | |
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/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_flush.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_texture.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_texture.h | 10 |
4 files changed, 19 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c index 6118164b20b..343c6145e7e 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.c +++ b/src/gallium/drivers/llvmpipe/lp_flush.c @@ -118,10 +118,10 @@ llvmpipe_flush_resource(struct pipe_context *pipe, { unsigned referenced; - referenced = pipe->is_resource_referenced(pipe, resource, level, layer); + referenced = llvmpipe_is_resource_referenced(pipe, resource, level, layer); - if ((referenced & PIPE_REFERENCED_FOR_WRITE) || - ((referenced & PIPE_REFERENCED_FOR_READ) && !read_only)) { + if ((referenced & LP_REFERENCED_FOR_WRITE) || + ((referenced & LP_REFERENCED_FOR_READ) && !read_only)) { if (cpu_access) { /* diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 7b7b2721ba8..41d8fa6d124 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -753,20 +753,20 @@ lp_setup_is_resource_referenced( const struct lp_setup_context *setup, /* check the render targets */ for (i = 0; i < setup->fb.nr_cbufs; i++) { if (setup->fb.cbufs[i]->texture == texture) - return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; + return LP_REFERENCED_FOR_READ | LP_REFERENCED_FOR_WRITE; } if (setup->fb.zsbuf && setup->fb.zsbuf->texture == texture) { - return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; + return LP_REFERENCED_FOR_READ | LP_REFERENCED_FOR_WRITE; } /* check textures referenced by the scene */ for (i = 0; i < Elements(setup->scenes); i++) { if (lp_scene_is_resource_referenced(setup->scenes[i], texture)) { - return PIPE_REFERENCED_FOR_READ; + return LP_REFERENCED_FOR_READ; } } - return PIPE_UNREFERENCED; + return LP_UNREFERENCED; } diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 9753da5e57e..2e6a4bd7dc8 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -695,7 +695,7 @@ llvmpipe_transfer_unmap(struct pipe_context *pipe, transfer->box.z); } -static unsigned int +unsigned int llvmpipe_is_resource_referenced( struct pipe_context *pipe, struct pipe_resource *presource, unsigned level, int layer) @@ -703,7 +703,7 @@ llvmpipe_is_resource_referenced( struct pipe_context *pipe, struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe ); if (presource->target == PIPE_BUFFER) - return PIPE_UNREFERENCED; + return LP_UNREFERENCED; return lp_setup_is_resource_referenced(llvmpipe->setup, presource); } @@ -1401,7 +1401,6 @@ llvmpipe_init_context_resource_funcs(struct pipe_context *pipe) pipe->transfer_destroy = llvmpipe_transfer_destroy; pipe->transfer_map = llvmpipe_transfer_map; pipe->transfer_unmap = llvmpipe_transfer_unmap; - pipe->is_resource_referenced = llvmpipe_is_resource_referenced; pipe->transfer_flush_region = u_default_transfer_flush_region; pipe->transfer_inline_write = u_default_transfer_inline_write; diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h index b789c0f4090..b4a0dfd1c36 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.h +++ b/src/gallium/drivers/llvmpipe/lp_texture.h @@ -243,4 +243,14 @@ llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen); extern void llvmpipe_init_context_texture_funcs(struct pipe_context *pipe); + +#define LP_UNREFERENCED 0 +#define LP_REFERENCED_FOR_READ (1 << 0) +#define LP_REFERENCED_FOR_WRITE (1 << 1) + +unsigned int +llvmpipe_is_resource_referenced( struct pipe_context *pipe, + struct pipe_resource *presource, + unsigned level, int layer); + #endif /* LP_TEXTURE_H */ |