[Mesa-dev] [PATCH V3 22/30] i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper

Chris Forbes chrisf at ijw.co.nz
Wed Apr 2 01:05:18 PDT 2014


We're about to need this in another place.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/i965/intel_fbo.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index 201e06f..5ade9e6 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -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);
-- 
1.9.1



More information about the mesa-dev mailing list