From 0a08147fcbd34c2ff810d10b596e801b92730ef4 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 21 Jan 2014 21:53:21 +1300 Subject: i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper We're about to need this in another place. Signed-off-by: Chris Forbes Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Acked-by: Eric Anholt --- src/mesa/drivers/dri/i965/intel_fbo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c index 201e06f51bf..5ade9e6168a 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); -- cgit v1.2.3