<div dir="ltr"><div>This and precursor patches<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 19, 2017 at 12:43 PM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2 (Jason):<br>
  Â - Don't trigger miptree re-creation in vain later on with ISL<br>
  Â  Â based. Core GL uses zero to indicate single sampled while<br>
  Â  Â ISL uses one - this would cause intel_miptree_match_image()<br>
  Â  Â to always fail.<br>
  Â - Now that native miptree is already using sample number of<br>
  Â  Â one, there is no need for MAX2() when converting to ISL.<br>
<br>
Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> (v1)<br>
Reviewed-by:  Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> (v1)<br>
<span class="">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>blorp.c  Â  Â  Â  Â  Â  | 16 ++++-----<br>
 src/mesa/drivers/dri/i965/brw_<wbr>context.c  Â  Â  Â  Â  |  2 +-<br>
 src/mesa/drivers/dri/i965/brw_<wbr>meta_util.c  Â  Â  Â  |  2 +-<br>
 src/mesa/drivers/dri/i965/brw_<wbr>tex_layout.c  Â  Â  Â |  4 +--<br>
 src/mesa/drivers/dri/i965/brw_<wbr>wm.c  Â  Â  Â  Â  Â  Â  Â |  4 +--<br>
 src/mesa/drivers/dri/i965/brw_<wbr>wm_surface_state.c |  2 +-<br>
 src/mesa/drivers/dri/i965/<wbr>intel_blit.c  Â  Â  Â  Â  Â |  4 +--<br>
 src/mesa/drivers/dri/i965/<wbr>intel_fbo.c  Â  Â  Â  Â  Â  |  4 +--<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c  Â  | 46 ++++++++++++------------<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h  Â  |  6 ----<br>
 src/mesa/drivers/dri/i965/<wbr>intel_pixel_copy.c  Â  Â |  2 +-<br>
 11 files changed, 43 insertions(+), 49 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
</span>index 2776872d92..474dfc61c1 100644<br>
<span class="">--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -135,7 +135,7 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  struct isl_surf tmp_surfs[1])<br>
 {<br>
  Â  if (mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY) {<br>
</span>-  Â  Â  const unsigned num_samples =  mt->num_samples;<br>
+  Â  Â  const unsigned num_samples = mt->surf.samples;<br>
<div><div class="h5">  Â  Â  Â for (unsigned i = 0; i < num_layers; i++) {<br>
  Â  Â  Â  Â  for (unsigned s = 0; s < num_samples; s++) {<br>
  Â  Â  Â  Â  Â  Â const unsigned phys_layer = (start_layer + i) * num_samples + s;<br>
@@ -275,7 +275,7 @@ swizzle_to_scs(GLenum swizzle)<br>
  * Note: if the src (or dst) is a 2D multisample array texture on Gen7+ using<br>
  * INTEL_MSAA_LAYOUT_UMS or INTEL_MSAA_LAYOUT_CMS, src_layer (dst_layer) is<br>
  * the physical layer holding sample 0.  So, for example, if<br>
- * src_mt->num_samples == 4, then logical layer n corresponds to src_layer ==<br>
+ * src_mt->surf.samples == 4, then logical layer n corresponds to src_layer ==<br>
  * 4*n.<br>
  */<br>
 void<br>
@@ -296,9 +296,9 @@ brw_blorp_blit_miptrees(struct brw_context *brw,<br>
  Â  DBG("%s from %dx %s mt %p %d %d (%f,%f) (%f,%f)"<br>
  Â  Â  Â  "to %dx %s mt %p %d %d (%f,%f) (%f,%f) (flip %d,%d)\n",<br>
  Â  Â  Â  __func__,<br>
-  Â  Â  Â src_mt->num_samples, _mesa_get_format_name(src_mt-><wbr>format), src_mt,<br>
+  Â  Â  Â src_mt->surf.samples, _mesa_get_format_name(src_mt-><wbr>format), src_mt,<br>
  Â  Â  Â  src_level, src_layer, src_x0, src_y0, src_x1, src_y1,<br>
-  Â  Â  Â dst_mt->num_samples, _mesa_get_format_name(dst_mt-><wbr>format), dst_mt,<br>
+  Â  Â  Â dst_mt->surf.samples, _mesa_get_format_name(dst_mt-><wbr>format), dst_mt,<br>
  Â  Â  Â  dst_level, dst_layer, dst_x0, dst_y0, dst_x1, dst_y1,<br>
  Â  Â  Â  mirror_x, mirror_y);<br>
<br>
@@ -318,7 +318,7 @@ brw_blorp_blit_miptrees(struct brw_context *brw,<br>
  Â  Â * R32_FLOAT, so only the contents of the red channel matters.<br>
  Â  Â */<br>
  Â  if (brw->gen == 6 &&<br>
-  Â  Â  Â src_mt->num_samples > 1 && dst_mt->num_samples <= 1 &&<br>
+  Â  Â  Â src_mt->surf.samples > 1 && dst_mt->surf.samples <= 1 &&<br>
  Â  Â  Â  src_mt->format == dst_mt->format &&<br>
  Â  Â  Â  (dst_format == MESA_FORMAT_L_FLOAT32 ||<br>
  Â  Â  Â  Â dst_format == MESA_FORMAT_I_FLOAT32)) {<br>
@@ -375,9 +375,9 @@ brw_blorp_copy_miptrees(struct brw_context *brw,<br>
  Â  DBG("%s from %dx %s mt %p %d %d (%d,%d) %dx%d"<br>
  Â  Â  Â  "to %dx %s mt %p %d %d (%d,%d)\n",<br>
  Â  Â  Â  __func__,<br>
-  Â  Â  Â src_mt->num_samples, _mesa_get_format_name(src_mt-><wbr>format), src_mt,<br>
+  Â  Â  Â src_mt->surf.samples, _mesa_get_format_name(src_mt-><wbr>format), src_mt,<br>
  Â  Â  Â  src_level, src_layer, src_x, src_y, src_width, src_height,<br>
-  Â  Â  Â dst_mt->num_samples, _mesa_get_format_name(dst_mt-><wbr>format), dst_mt,<br>
+  Â  Â  Â dst_mt->surf.samples, _mesa_get_format_name(dst_mt-><wbr>format), dst_mt,<br>
  Â  Â  Â  dst_level, dst_layer, dst_x, dst_y);<br>
<br>
  Â  struct isl_surf tmp_surfs[2];<br>
@@ -564,7 +564,7 @@ brw_blorp_copytexsubimage(<wbr>struct brw_context *brw,<br>
  Â  struct intel_mipmap_tree *dst_mt = intel_image->mt;<br>
<br>
  Â  /* There is support for only up to eight samples. */<br>
-  Â if (src_mt->num_samples > 8 || dst_mt->num_samples > 8)<br>
+  Â if (src_mt->surf.samples > 8 || dst_mt->surf.samples > 8)<br>
  Â  Â  Â return false;<br>
<br>
  Â  if (_mesa_get_format_base_format(<wbr>src_rb->Format) !=<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.c b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
</div></div>index 303c658543..0ef601d342 100644<br>
<span class="">--- a/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
@@ -1218,7 +1218,7 @@ intel_resolve_for_dri2_flush(<wbr>struct brw_context *brw,<br>
  Â  Â  Â rb = intel_get_renderbuffer(fb, buffers[i]);<br>
  Â  Â  Â if (rb == NULL || rb->mt == NULL)<br>
  Â  Â  Â  Â  continue;<br>
</span>-  Â  Â  if (rb->mt->num_samples == 1) {<br>
+  Â  Â  if (rb->mt->surf.samples == 1) {<br>
<span class="">  Â  Â  Â  Â  assert(rb->mt_layer == 0 && rb->mt_level == 0 &&<br>
  Â  Â  Â  Â  Â  Â  Â  Â rb->layer_count == 1);<br>
  Â  Â  Â  Â  intel_miptree_prepare_access(<wbr>brw, rb->mt, 0, 1, 0, 1, false, false);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c b/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
</span>index 7b5a11811b..ea14f44790 100644<br>
<span class="">--- a/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
@@ -298,7 +298,7 @@ brw_is_color_fast_clear_<wbr>compatible(struct brw_context *brw,<br>
  Â  Â * fast clear because it's very likely to be immediately resolved.<br>
  Â  Â */<br>
  Â  if (brw->gen >= 9 &&<br>
</span>-  Â  Â  Â mt->num_samples == 1 &&<br>
+  Â  Â  Â mt->surf.samples == 1 &&<br>
<div><div class="h5">  Â  Â  Â  ctx->Color.sRGBEnabled &&<br>
  Â  Â  Â  _mesa_get_srgb_format_linear(<wbr>mt->format) != mt->format)<br>
  Â  Â  Â return false;<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_tex_layout.c b/src/mesa/drivers/dri/i965/<wbr>brw_tex_layout.c<br>
index 91e94ee4a0..5be73282dc 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_tex_layout.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_tex_layout.c<br>
@@ -100,7 +100,7 @@ intel_vertical_texture_<wbr>alignment_unit(struct brw_context *brw,<br>
  Â  if (brw->gen >= 8)<br>
  Â  Â  Â return 4;<br>
<br>
-  Â if (mt->num_samples > 1)<br>
+  Â if (mt->surf.samples > 1)<br>
  Â  Â  Â return 4;<br>
<br>
  Â  GLenum base_format = _mesa_get_format_base_format(<wbr>mt->format);<br>
@@ -521,7 +521,7 @@ brw_miptree_choose_tiling(<wbr>struct brw_context *brw,<br>
  Â  Â  Â return I915_TILING_NONE;<br>
  Â  }<br>
<br>
-  Â if (mt->num_samples > 1) {<br>
+  Â if (mt->surf.samples > 1) {<br>
  Â  Â  Â /* From p82 of the Sandy Bridge PRM, dw3[1] of SURFACE_STATE ("Tiled<br>
  Â  Â  Â  * Surface"):<br>
  Â  Â  Â  *<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
index 9e1dcee8fd..c9c4504590 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
@@ -398,12 +398,12 @@ brw_populate_sampler_prog_key_<wbr>data(struct gl_context *ctx,<br>
  Â  Â  Â  Â  Â */<br>
  Â  Â  Â  Â  if (intel_tex->mt->aux_usage == ISL_AUX_USAGE_MCS) {<br>
  Â  Â  Â  Â  Â  Â assert(brw->gen >= 7);<br>
-  Â  Â  Â  Â  Â  assert(intel_tex->mt->num_<wbr>samples > 1);<br>
+  Â  Â  Â  Â  Â  assert(intel_tex->mt->surf.<wbr>samples > 1);<br>
  Â  Â  Â  Â  Â  Â assert(intel_tex->mt->mcs_buf)<wbr>;<br>
  Â  Â  Â  Â  Â  Â assert(intel_tex->mt->surf.<wbr>msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
  Â  Â  Â  Â  Â  Â key->compressed_multisample_<wbr>layout_mask |= 1 << s;<br>
<br>
-  Â  Â  Â  Â  Â  if (intel_tex->mt->num_samples >= 16) {<br>
+  Â  Â  Â  Â  Â  if (intel_tex->mt->surf.samples >= 16) {<br>
  Â  Â  Â  Â  Â  Â  Â  assert(brw->gen >= 9);<br>
  Â  Â  Â  Â  Â  Â  Â  key->msaa_16 |= 1 << s;<br>
  Â  Â  Â  Â  Â  Â }<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
index 67dc9d8943..00f0a72b1f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
@@ -1036,7 +1036,7 @@ gen4_update_renderbuffer_<wbr>surface(struct brw_context *brw,<br>
  Â  surf[3] = (brw_get_surface_tiling_bits(<wbr>mt->tiling) |<br>
  Â  Â  Â  Â  Â  Â  (mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);<br>
<br>
-  Â surf[4] = brw_get_surface_num_<wbr>multisamples(mt->num_samples);<br>
+  Â surf[4] = brw_get_surface_num_<wbr>multisamples(mt->surf.samples)<wbr>;<br>
<br>
  Â  assert(brw->has_surface_tile_<wbr>offset || (tile_x == 0 && tile_y == 0));<br>
  Â  /* Note that the low bits of these fields are missing, so<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_blit.c b/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
index 2471380a0a..226c4f23b7 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
@@ -298,7 +298,7 @@ intel_miptree_blit(struct brw_context *brw,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  GLenum logicop)<br>
 {<br>
  Â  /* The blitter doesn't understand multisampling at all. */<br>
-  Â if (src_mt->num_samples > 1 || dst_mt->num_samples > 1)<br>
+  Â if (src_mt->surf.samples > 1 || dst_mt->surf.samples > 1)<br>
  Â  Â  Â return false;<br>
<br>
  Â  /* No sRGB decode or encode is done by the hardware blitter, which is<br>
@@ -371,7 +371,7 @@ intel_miptree_copy(struct brw_context *brw,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  uint32_t src_width, uint32_t src_height)<br>
 {<br>
  Â  /* The blitter doesn't understand multisampling at all. */<br>
-  Â if (src_mt->num_samples > 1 || dst_mt->num_samples > 1)<br>
+  Â if (src_mt->surf.samples > 1 || dst_mt->surf.samples > 1)<br>
  Â  Â  Â return false;<br>
<br>
  Â  if (src_mt->format == MESA_FORMAT_S_UINT8)<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
</div></div>index b7de49f22e..87dc32673c 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
@@ -533,7 +533,7 @@ intel_renderbuffer_update_<wbr>wrapper(struct brw_context *brw,<br>
  Â  irb->mt_layer = layer;<br>
<br>
  Â  const unsigned layer_multiplier =<br>
-  Â  Â  mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY ? mt->num_samples : 1;<br>
+  Â  Â  mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY ? mt->surf.samples : 1;<br>
<span class=""><br>
  Â  if (!layered) {<br>
  Â  Â  Â irb->layer_count = 1;<br>
</span>@@ -970,7 +970,7 @@ intel_renderbuffer_move_to_<wbr>temp(struct brw_context *brw,<br>
<span class="">  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  intel_image->base.Base.<wbr>TexFormat,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  0, 0,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  width, height, 1,<br>
-  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â irb->mt->num_samples,<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â irb->mt->surf.samples,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  layout_flags);<br>
<br>
  Â  if (!invalidate)<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
</span>index 338e965737..418ec3cf06 100644<br>
<span class="">--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -168,7 +168,7 @@ intel_miptree_supports_ccs(<wbr>struct brw_context *brw,<br>
  Â  Â  Â return false;<br>
<br>
  Â  /* This function applies only to non-multisampled render targets. */<br>
-  Â if (mt->num_samples > 1)<br>
+  Â if (mt->surf.samples > 1)<br>
  Â  Â  Â return false;<br>
<br>
  Â  /* MCS is only supported for color buffers */<br>
@@ -191,7 +191,7 @@ intel_miptree_supports_ccs(<wbr>struct brw_context *brw,<br>
  Â  Â  Â  Â * accidentally reject a multisampled surface here. We should have<br>
  Â  Â  Â  Â * rejected it earlier by explicitly checking the sample count.<br>
  Â  Â  Â  Â */<br>
</span>-  Â  Â  assert(mt->num_samples == 1);<br>
+  Â  Â  assert(mt->surf.samples == 1);<br>
<span class="">  Â  }<br>
<br>
  Â  /* Handle the hardware restrictions...<br>
</span>@@ -384,7 +384,7 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
<span class="">  Â  mt->supports_fast_clear = false;<br>
  Â  mt->aux_state = NULL;<br>
  Â  mt->cpp = _mesa_get_format_bytes(format)<wbr>;<br>
-  Â mt->num_samples = num_samples;<br>
+  Â mt->surf.samples = num_samples;<br>
  Â  mt->compressed = _mesa_is_format_compressed(<wbr>format);<br>
  Â  mt->surf.msaa_layout = ISL_MSAA_LAYOUT_NONE;<br>
  Â  mt->refcount = 1;<br>
</span>@@ -604,7 +604,7 @@ intel_miptree_choose_aux_<wbr>usage(struct brw_context *brw,<br>
<span class="">  Â  assert(mt->aux_usage == ISL_AUX_USAGE_NONE);<br>
<br>
  Â  const unsigned no_flags = 0;<br>
-  Â if (mt->num_samples > 1 && is_mcs_supported(brw, mt->format, no_flags)) {<br>
+  Â if (mt->surf.samples > 1 && is_mcs_supported(brw, mt->format, no_flags)) {<br>
  Â  Â  Â assert(mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
  Â  Â  Â mt->aux_usage = ISL_AUX_USAGE_MCS;<br>
  Â  } else if (intel_tiling_supports_ccs(<wbr>brw, mt->tiling) &&<br>
</span>@@ -1369,8 +1369,8 @@ intel_miptree_match_image(<wbr>struct intel_mipmap_tree *mt,<br>
<span class="">  Â  }<br>
<br>
  Â  int level_depth = mt->level[level].depth;<br>
-  Â if (mt->num_samples > 1 && mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)<br>
-  Â  Â  level_depth /= mt->num_samples;<br>
+  Â if (mt->surf.samples > 1 && mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)<br>
+  Â  Â  level_depth /= mt->surf.samples;<br>
<br>
  Â  /* Test image dimensions against the base level image adjusted for<br>
  Â  Â * minification.  This will also catch images not present in the<br>
</span>@@ -1383,7 +1383,7 @@ intel_miptree_match_image(<wbr>struct intel_mipmap_tree *mt,<br>
  Â  }<br>
<br>
  Â  /* Core uses sample number of zero to indicate single-sampled. */<br>
-  Â if (MAX2(image->NumSamples, 1) != mt->num_samples)<br>
+  Â if (MAX2(image->NumSamples, 1) != mt->surf.samples)<br>
  Â  Â  Â return false;<br>
<br>
  Â  return true;<br>
@@ -2004,8 +2004,8 @@ intel_miptree_alloc_aux(struct brw_context *brw,<br>
<span class=""><br>
  Â  case ISL_AUX_USAGE_MCS:<br>
  Â  Â  Â assert(_mesa_is_format_color_<wbr>format(mt->format));<br>
-  Â  Â  assert(mt->num_samples > 1);<br>
-  Â  Â  if (!intel_miptree_alloc_mcs(brw, mt, mt->num_samples))<br>
+  Â  Â  assert(mt->surf.samples > 1);<br>
+  Â  Â  if (!intel_miptree_alloc_mcs(brw, mt, mt->surf.samples))<br>
  Â  Â  Â  Â  return false;<br>
  Â  Â  Â return true;<br>
<br>
</span>@@ -2017,7 +2017,7 @@ intel_miptree_alloc_aux(struct brw_context *brw,<br>
<br>
  Â  case ISL_AUX_USAGE_CCS_E:<br>
  Â  Â  Â assert(_mesa_is_format_color_<wbr>format(mt->format));<br>
-  Â  Â  assert(mt->num_samples == 1);<br>
+  Â  Â  assert(mt->surf.samples == 1);<br>
<span class="">  Â  Â  Â if (!intel_miptree_alloc_ccs(brw, mt))<br>
  Â  Â  Â  Â  return false;<br>
  Â  Â  Â return true;<br>
</span>@@ -2066,7 +2066,7 @@ intel_miptree_sample_with_hiz(<wbr>struct brw_context *brw,<br>
<span class="">  Â  Â * There is no such blurb for 1D textures, but there is sufficient evidence<br>
  Â  Â * that this is broken on SKL+.<br>
  Â  Â */<br>
</span>-  Â return (mt->num_samples == 1 &&<br>
+  Â return (mt->surf.samples == 1 &&<br>
<span class="">  Â  Â  Â  Â  Â  mt->target != GL_TEXTURE_3D &&<br>
  Â  Â  Â  Â  Â  mt->target != GL_TEXTURE_1D /* gen9+ restriction */);<br>
 }<br>
</span>@@ -2126,7 +2126,7 @@ intel_miptree_check_color_<wbr>resolve(const struct brw_context *brw,<br>
<span class="">  Â  Â  Â  Â  Â (level == 0 && mt->first_level == 0 && mt->last_level == 0));<br>
<br>
  Â  /* Compression of arrayed msaa surfaces is supported. */<br>
-  Â if (mt->num_samples > 1)<br>
+  Â if (mt->surf.samples > 1)<br>
  Â  Â  Â return;<br>
<br>
  Â  /* Fast color clear is supported for non-msaa arrays only on Gen8+. */<br>
</span>@@ -2466,7 +2466,7 @@ intel_miptree_prepare_access(<wbr>struct brw_context *brw,<br>
<span class="">  Â  Â  Â if (!mt->mcs_buf)<br>
  Â  Â  Â  Â  return;<br>
<br>
-  Â  Â  if (mt->num_samples > 1) {<br>
+  Â  Â  if (mt->surf.samples > 1) {<br>
  Â  Â  Â  Â  /* Nothing to do for MSAA */<br>
  Â  Â  Â  Â  assert(aux_supported && fast_clear_supported);<br>
  Â  Â  Â } else {<br>
</span>@@ -2515,7 +2515,7 @@ intel_miptree_finish_write(<wbr>struct brw_context *brw,<br>
<span class="">  Â  Â  Â if (!mt->mcs_buf)<br>
  Â  Â  Â  Â  return;<br>
<br>
-  Â  Â  if (mt->num_samples > 1) {<br>
+  Â  Â  if (mt->surf.samples > 1) {<br>
  Â  Â  Â  Â  for (uint32_t a = 0; a < num_layers; a++) {<br>
  Â  Â  Â  Â  Â  Â intel_miptree_finish_mcs_<wbr>write(brw, mt, level, start_layer + a,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  written_with_aux);<br>
</span>@@ -2547,7 +2547,7 @@ intel_miptree_get_aux_state(<wbr>const struct intel_mipmap_tree *mt,<br>
<span class=""><br>
  Â  if (_mesa_is_format_color_format(<wbr>mt->format)) {<br>
  Â  Â  Â assert(mt->mcs_buf != NULL);<br>
</span>-  Â  Â  assert(mt->num_samples == 1 ||<br>
+  Â  Â  assert(mt->surf.samples == 1 ||<br>
<span class="">  Â  Â  Â  Â  Â  Â  mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
  Â  } else if (mt->format == MESA_FORMAT_S_UINT8) {<br>
  Â  Â  Â unreachable("Cannot get aux state for stencil");<br>
</span>@@ -2568,7 +2568,7 @@ intel_miptree_set_aux_state(<wbr>struct brw_context *brw,<br>
<span class=""><br>
  Â  if (_mesa_is_format_color_format(<wbr>mt->format)) {<br>
  Â  Â  Â assert(mt->mcs_buf != NULL);<br>
</span>-  Â  Â  assert(mt->num_samples == 1 ||<br>
+  Â  Â  assert(mt->surf.samples == 1 ||<br>
<span class="">  Â  Â  Â  Â  Â  Â  mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
  Â  } else if (mt->format == MESA_FORMAT_S_UINT8) {<br>
  Â  Â  Â unreachable("Cannot get aux state for stencil");<br>
</span>@@ -2623,7 +2623,7 @@ intel_miptree_prepare_texture_<wbr>slices(struct brw_context *brw,<br>
<span class=""> {<br>
  Â  bool aux_supported, clear_supported;<br>
  Â  if (_mesa_is_format_color_format(<wbr>mt->format)) {<br>
-  Â  Â  if (mt->num_samples > 1) {<br>
+  Â  Â  if (mt->surf.samples > 1) {<br>
  Â  Â  Â  Â  aux_supported = clear_supported = true;<br>
  Â  Â  Â } else {<br>
  Â  Â  Â  Â  aux_supported = can_texture_with_ccs(brw, mt, view_format);<br>
</span>@@ -2690,7 +2690,7 @@ intel_miptree_prepare_render(<wbr>struct brw_context *brw,<br>
<span class="">  Â  Â * enabled because otherwise the surface state will be programmed with<br>
  Â  Â * the linear equivalent format anyway.<br>
  Â  Â */<br>
</span>-  Â if (brw->gen == 9 && srgb_enabled && mt->num_samples == 1 &&<br>
+  Â if (brw->gen == 9 && srgb_enabled && mt->surf.samples == 1 &&<br>
<span class="">  Â  Â  Â  _mesa_get_srgb_format_linear(<wbr>mt->format) != mt->format) {<br>
<br>
  Â  Â  Â /* Lossless compression is not supported for SRGB formats, it<br>
</span>@@ -2753,7 +2753,7 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
<span class="">  Â  Â * reached for multisample buffers.<br>
  Â  Â */<br>
  Â  assert(mt->surf.msaa_layout == ISL_MSAA_LAYOUT_NONE ||<br>
</span>-  Â  Â  Â  Â  mt->num_samples == 1);<br>
+  Â  Â  Â  Â  mt->surf.samples == 1);<br>
<span class=""><br>
  Â  intel_miptree_prepare_access(<wbr>brw, mt, 0, INTEL_REMAINING_LEVELS,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 0, INTEL_REMAINING_LAYERS, false, false);<br>
</span>@@ -2931,7 +2931,7 @@ intel_update_r8stencil(struct brw_context *brw,<br>
<span class="">  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â src->logical_width0,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â src->logical_height0,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â src->logical_depth0,<br>
-  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  src->num_samples,<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  src->surf.samples,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â r8stencil_flags);<br>
  Â  Â  Â assert(mt->r8stencil_mt);<br>
  Â  }<br>
</span>@@ -3579,7 +3579,7 @@ intel_miptree_map(struct brw_context *brw,<br>
 {<br>
  Â  struct intel_miptree_map *map;<br>
<br>
-  Â assert(mt->num_samples == 1 || mt->surf.samples == 1);<br>
+  Â assert(mt->surf.samples == 1);<br>
<span class=""><br>
  Â  map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);<br>
  Â  if (!map){<br>
</span>@@ -3625,7 +3625,7 @@ intel_miptree_unmap(struct brw_context *brw,<br>
<span class=""> {<br>
  Â  struct intel_miptree_map *map = mt->level[level].slice[slice].<wbr>map;<br>
<br>
</span>-  Â assert(mt->num_samples == 1 || mt->surf.samples == 1);<br>
+  Â assert(mt->surf.samples == 1);<br>
<br>
  Â  if (!map)<br>
  Â  Â  Â return;<br>
@@ -3794,7 +3794,7 @@ intel_miptree_get_isl_surf(<wbr>struct brw_context *brw,<br>
<span class="">  Â  }<br>
<br>
  Â  surf->levels = mt->last_level - mt->first_level + 1;<br>
</span>-  Â surf->samples = mt->num_samples;<br>
+  Â surf->samples = mt->surf.samples;<br>
<div class="HOEnZb"><div class="h5"><br>
  Â  surf->size = 0; /* TODO */<br>
  Â  surf->alignment = 0; /* TODO */<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
index 89590d2ba2..fde9a022fd 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
@@ -414,12 +414,6 @@ struct intel_mipmap_tree<br>
  Â  /** Bytes per pixel (or bytes per block if compressed) */<br>
  Â  GLuint cpp;<br>
<br>
-  Â /**<br>
-  Â  * @see RENDER_SURFACE_STATE.<wbr>NumberOfMultisamples<br>
-  Â  * @see 3DSTATE_MULTISAMPLE.<wbr>NumberOfMultisamples<br>
-  Â  */<br>
-  Â GLuint num_samples;<br>
-<br>
  Â  bool compressed;<br>
<br>
  Â  /**<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_pixel_copy.c b/src/mesa/drivers/dri/i965/<wbr>intel_pixel_copy.c<br>
index 3ffd68c048..3f8df3002f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_pixel_copy.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_pixel_copy.c<br>
@@ -101,7 +101,7 @@ do_blit_copypixels(struct gl_context * ctx,<br>
  Â  Â  Â return false;<br>
  Â  }<br>
<br>
-  Â if (draw_irb->mt->num_samples > 1 || read_irb->mt->num_samples > 1) {<br>
+  Â if (draw_irb->mt->surf.samples > 1 || read_irb->mt->surf.samples > 1) {<br>
  Â  Â  Â perf_debug("glCopyPixels() fallback: multisampled buffers\n");<br>
  Â  Â  Â return false;<br>
  Â  }<br>
--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>