<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 17, 2017 at 6:34 AM, 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">This helps to drop dependency to miptree::total_height which is<br>
used in brw_miptree_get_vertical_<wbr>slice_pitch().<br>
<br>
This is also readily compatible once miptree itself is isl<br>
based.<br>
<br>
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>tex_layout.c       |  2 +-<br>
 src/mesa/drivers/dri/i965/brw_<wbr>wm_surface_state.c | 24 ++++++++++++++++++++++--<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h    |  9 ---------<br>
 3 files changed, 23 insertions(+), 12 deletions(-)<br>
<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 d06d654797..c76e87bc06 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>
@@ -309,7 +309,7 @@ brw_miptree_get_horizontal_<wbr>slice_pitch(const struct brw_context *brw,<br>
    }<br>
 }<br>
<br>
-unsigned<br>
+static unsigned<br>
 brw_miptree_get_vertical_<wbr>slice_pitch(const struct brw_context *brw,<br>
                                      const struct intel_mipmap_tree *mt,<br>
                                      unsigned level)<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 da5c5128c1..55bb61b598 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>
@@ -1632,6 +1632,27 @@ update_buffer_image_param(<wbr>struct brw_context *brw,<br>
    param->stride[0] = _mesa_get_format_bytes(u->_<wbr>ActualFormat);<br>
 }<br>
<br>
+static unsigned<br>
+get_vertical_slice_pitch(<wbr>const struct brw_context *brw,<br>
+                         const struct intel_mipmap_tree *mt,<br>
+                         unsigned level)<br>
+{<br>
+   struct isl_surf surf;<br>
+<br>
+   intel_miptree_get_isl_surf(<wbr>brw, mt, &surf);<br>
+<br>
+   if ((brw->gen < 9 && mt->target == GL_TEXTURE_3D) ||<br>
+       (brw->gen == 4 && mt->target == GL_TEXTURE_CUBE_MAP)) {<br>
+      const struct isl_extent3d image_align_sa =<br>
+         isl_surf_get_image_alignment_<wbr>sa(&surf);<br>
+<br>
+      return ALIGN_NPOT(minify(surf.phys_<wbr>level0_sa.height, level),<br>
+                        image_align_sa.h);<br>
+   }<br>
+<br>
+   return surf.array_pitch_el_rows;<br>
+}<br></blockquote><div><br></div><div>Why not just switch us over to using isl_surf_fill_image_param?  I was meaning to do that but it just never happened.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 static void<br>
 update_texture_image_param(<wbr>struct brw_context *brw,<br>
                            struct gl_image_unit *u,<br>
@@ -1658,8 +1679,7 @@ update_texture_image_param(<wbr>struct brw_context *brw,<br>
    param->stride[1] = mt->pitch / mt->cpp;<br>
    param->stride[2] =<br>
       brw_miptree_get_horizontal_<wbr>slice_pitch(brw, mt, u->Level);<br>
-   param->stride[3] =<br>
-      brw_miptree_get_vertical_<wbr>slice_pitch(brw, mt, u->Level);<br>
+   param->stride[3] = get_vertical_slice_pitch(brw, mt, u->Level);<br>
<br>
    if (mt->tiling == I915_TILING_X) {<br>
       /* An X tile is a rectangular block of 512x8 bytes. */<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 9098c39116..291050d72e 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>
@@ -986,15 +986,6 @@ brw_miptree_get_horizontal_<wbr>slice_pitch(const struct brw_context *brw,<br>
                                        const struct intel_mipmap_tree *mt,<br>
                                        unsigned level);<br>
<br>
-/**<br>
- * Vertical distance from one slice to the next in the two-dimensional miptree<br>
- * layout.<br>
- */<br>
-unsigned<br>
-brw_miptree_get_vertical_<wbr>slice_pitch(const struct brw_context *brw,<br>
-                                     const struct intel_mipmap_tree *mt,<br>
-                                     unsigned level);<br>
-<br>
 bool<br>
 brw_miptree_layout(struct brw_context *brw,<br>
                    struct intel_mipmap_tree *mt,<br>
<span class="HOEnZb"><font color="#888888">--<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>
</font></span></blockquote></div><br></div></div>