diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-08-13 11:46:25 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-08-29 12:13:14 -0400 |
commit | f56b569e9af356c11869ee49a4669bb01b75397e (patch) | |
tree | 5fd52ee856b106c8b97027061737d366de2d1c2b /src/mesa/drivers/dri/i965 | |
parent | 7a2ab6d05573508389b38f8f1fa261ba56062865 (diff) |
DRI2: Drop sarea, implement swap buffers in the X server.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vtbl.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 31e96a250a..ece01a8c9a 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -75,15 +75,27 @@ static void brw_set_draw_region( struct intel_context *intel, GLuint num_regions) { struct brw_context *brw = brw_context(&intel->ctx); + struct intel_region *old_depth_region, *old_draw_regions[MAX_DRAW_BUFFERS]; int i; + if (brw->state.depth_region != depth_region) brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER; - for (i = 0; i < brw->state.nr_draw_regions; i++) - intel_region_release(&brw->state.draw_regions[i]); - intel_region_release(&brw->state.depth_region); + + for (i = 0; i < brw->state.nr_draw_regions; i++) { + old_draw_regions[i] = brw->state.draw_regions[i]; + brw->state.draw_regions[i] = NULL; + } + old_depth_region = brw->state.depth_region; + brw->state.depth_region = NULL; + for (i = 0; i < num_regions; i++) intel_region_reference(&brw->state.draw_regions[i], draw_regions[i]); intel_region_reference(&brw->state.depth_region, depth_region); + + for (i = 0; i < brw->state.nr_draw_regions; i++) + intel_region_release(&old_draw_regions[i]); + intel_region_release(&old_depth_region); + brw->state.nr_draw_regions = num_regions; } |