i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper
authorChris Forbes <chrisf@ijw.co.nz>
Tue, 21 Jan 2014 08:53:21 +0000 (21:53 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 10 Apr 2014 06:27:41 +0000 (18:27 +1200)
We're about to need this in another place.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/intel_fbo.c

index 201e06f51bfc47763398c22b07fcc24c848f5857..5ade9e6168a80ff3f5ff7a4d0fd1761262705b5d 100644 (file)
@@ -519,16 +519,19 @@ intel_renderbuffer_update_wrapper(struct brw_context *brw,
    intel_miptree_check_level_layer(mt, level, layer);
    irb->mt_level = level;
 
+   int layer_multiplier;
    switch (mt->msaa_layout) {
       case INTEL_MSAA_LAYOUT_UMS:
       case INTEL_MSAA_LAYOUT_CMS:
-         irb->mt_layer = layer * mt->num_samples;
+         layer_multiplier = mt->num_samples;
          break;
 
       default:
-         irb->mt_layer = layer;
+         layer_multiplier = 1;
    }
 
+   irb->mt_layer = layer_multiplier * layer;
+
    intel_miptree_reference(&irb->mt, mt);
 
    intel_renderbuffer_set_draw_offset(irb);