summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 688091fa49e..78c06fcd680 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1303,10 +1303,21 @@ intel_update_image_buffer(struct brw_context *intel,
unsigned num_samples = rb->Base.Base.NumSamples;
- if (rb->mt &&
- rb->mt->region &&
- rb->mt->region == region)
- return;
+ /* Check and see if we're already bound to the right
+ * buffer object
+ */
+ if (num_samples == 0) {
+ if (rb->mt &&
+ rb->mt->region &&
+ rb->mt->region->bo == region->bo)
+ return;
+ } else {
+ if (rb->mt &&
+ rb->mt->singlesample_mt &&
+ rb->mt->singlesample_mt->region &&
+ rb->mt->singlesample_mt->region->bo == region->bo)
+ return;
+ }
intel_miptree_release(&rb->mt);
rb->mt = intel_miptree_create_for_image_buffer(intel,