summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-01-13 15:32:55 -0700
committerBrian Paul <brianp@vmware.com>2010-01-13 15:32:55 -0700
commit018b78ad649e88cc6d8b6b10aef1502075508515 (patch)
treed8daa2fb567ae9776a5cbbfc428f13718a4f99c0 /src/gallium/drivers/llvmpipe
parent12872774461a84f0a7c272aff5aac5e30a78a7c2 (diff)
llvmpipe: check render targets before other textures
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index ce006bf618..649e97992b 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -482,19 +482,22 @@ lp_setup_is_texture_referenced( const struct setup_context *setup,
const struct pipe_texture *texture )
{
unsigned i;
- for (i = 0; i < Elements(setup->scenes); i++) {
- if (lp_scene_is_textured_referenced(setup->scenes[i], texture)) {
- return PIPE_REFERENCED_FOR_READ;
- }
- }
/* 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;
}
- if (setup->fb.zsbuf && setup->fb.zsbuf->texture == texture)
+ if (setup->fb.zsbuf && setup->fb.zsbuf->texture == texture) {
return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
+ }
+
+ /* check textures referenced by the scene */
+ for (i = 0; i < Elements(setup->scenes); i++) {
+ if (lp_scene_is_textured_referenced(setup->scenes[i], texture)) {
+ return PIPE_REFERENCED_FOR_READ;
+ }
+ }
return PIPE_UNREFERENCED;
}