summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_pipe_fb.c
blob: d4ae332f469464b17a4224411fb7778c4ac6b5be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

/**
 * called from intelDrawBuffer()
 */
static void brw_set_draw_region( struct intel_context *intel, 
                                 struct intel_region *color_regions[],
                                 struct intel_region *depth_region,
                                 GLuint num_color_regions)
{
   struct brw_context *brw = brw_context(&intel->ctx);
   GLuint i;

   /* release old color/depth regions */
   if (brw->state.depth_region != depth_region)
      brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
   for (i = 0; i < brw->state.nr_color_regions; i++)
       intel_region_release(&brw->state.color_regions[i]);
   intel_region_release(&brw->state.depth_region);

   /* reference new color/depth regions */
   for (i = 0; i < num_color_regions; i++)
       intel_region_reference(&brw->state.color_regions[i], color_regions[i]);
   intel_region_reference(&brw->state.depth_region, depth_region);
   brw->state.nr_color_regions = num_color_regions;
}