summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-02-13 14:33:57 -0800
committerEric Anholt <[email protected]>2014-02-18 09:56:36 -0800
commit019560c127778dc3b08bdc7c3acdc68dbbb80ea0 (patch)
tree07bb3124a32731af3d6b1efae3a30f21b2207314 /src/mesa/drivers/dri/i965/brw_context.c
parent0440e677b98c6e09f0958fcf782be67dccb94b08 (diff)
i965: Drop some duplicated code in DRI winsys BO updates.
The only DRI2 vs DRI3 delta was just how to decide about frontbuffer-ness for doing the upsample. v2: Fix missing singlesample_mt->region->name update in the merged code, which would have broken the DRI2 don't-recreate-the-miptree optimization. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 021287ee234..ba2f971bcc1 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1302,11 +1302,14 @@ intel_process_dri2_buffer(struct brw_context *brw,
return;
}
- rb->mt = intel_miptree_create_for_dri2_buffer(brw,
- buffer->attachment,
- intel_rb_format(rb),
- num_samples,
- region);
+ intel_update_winsys_renderbuffer_miptree(brw, rb, region);
+
+ if (brw->is_front_buffer_rendering &&
+ (buffer->attachment == __DRI_BUFFER_FRONT_LEFT ||
+ buffer->attachment == __DRI_BUFFER_FAKE_FRONT_LEFT) &&
+ rb->Base.Base.NumSamples > 1) {
+ intel_miptree_upsample(brw, rb->mt);
+ }
assert(rb->mt);
@@ -1359,12 +1362,13 @@ intel_update_image_buffer(struct brw_context *intel,
return;
}
- intel_miptree_release(&rb->mt);
- rb->mt = intel_miptree_create_for_image_buffer(intel,
- buffer_type,
- intel_rb_format(rb),
- num_samples,
- region);
+ intel_update_winsys_renderbuffer_miptree(intel, rb, region);
+
+ if (intel->is_front_buffer_rendering &&
+ buffer_type == __DRI_IMAGE_BUFFER_FRONT &&
+ rb->Base.Base.NumSamples > 1) {
+ intel_miptree_upsample(intel, rb->mt);
+ }
}
static void