From: Chris Forbes Date: Tue, 21 Jan 2014 08:53:21 +0000 (+1300) Subject: i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a08147fcbd34c2ff810d10b596e801b92730ef4;p=mesa.git 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 --- 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);