summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 94d000a5ac..5f60139968 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -120,7 +120,7 @@ softpipe_destroy( struct pipe_context *pipe )
* if (the texture is being used as a framebuffer surface)
* return PIPE_REFERENCED_FOR_WRITE
* else if (the texture is a bound texture source)
- * return PIPE_REFERENCED_FOR_READ XXX not done yet
+ * return PIPE_REFERENCED_FOR_READ
* else
* return PIPE_UNREFERENCED
*/
@@ -132,6 +132,7 @@ softpipe_is_texture_referenced( struct pipe_context *pipe,
struct softpipe_context *softpipe = softpipe_context( pipe );
unsigned i;
+ /* check if any of the bound drawing surfaces are this texture */
if (softpipe->dirty_render_cache) {
for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
if (softpipe->framebuffer.cbufs[i] &&
@@ -145,7 +146,12 @@ softpipe_is_texture_referenced( struct pipe_context *pipe,
}
}
- /* FIXME: we also need to do the same for the texture cache */
+ /* check if any of the tex_cache textures are this texture */
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ if (softpipe->tex_cache[i] &&
+ softpipe->tex_cache[i]->texture == texture)
+ return PIPE_REFERENCED_FOR_READ;
+ }
return PIPE_UNREFERENCED;
}
@@ -243,9 +249,9 @@ softpipe_create( struct pipe_screen *screen )
/* setup quad rendering stages */
- softpipe->quad.shade = sp_quad_shade_stage(softpipe);
- softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe);
- softpipe->quad.blend = sp_quad_blend_stage(softpipe);
+ softpipe->quad.shade = sp_quad_shade_stage(softpipe);
+ softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe);
+ softpipe->quad.blend = sp_quad_blend_stage(softpipe);
/*
@@ -275,7 +281,6 @@ softpipe_create( struct pipe_screen *screen )
draw_set_render(softpipe->draw, softpipe->vbuf_backend);
-
/* plug in AA line/point stages */
draw_install_aaline_stage(softpipe->draw, &softpipe->pipe);
draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe);
@@ -291,4 +296,3 @@ softpipe_create( struct pipe_screen *screen )
softpipe_destroy(&softpipe->pipe);
return NULL;
}
-