<div dir="ltr">Oh dear, hacks on both sides. Sorry for this nonsense.<div><br></div><div>Series is:-</div><div><br></div><div>Reviewed-by: Chris Forbes <<a href="mailto:chrisforbes@google.com">chrisforbes@google.com</a>></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 5:16 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From the Sky Lake PRM:<br>
<br>
   "For SURFTYPE_CUBE: For Sampling Engine Surfaces and Typed Data Port<br>
   Surfaces, the range of this field is [0,340], indicating the number of<br>
   cube array elements (equal to the number of underlying 2D array elements<br>
   divided by 6). For other surfaces, this field must be zero."<br>
<br>
In other words, the depth field for cube maps is in number of cubes not<br>
number of 2-D slices so we need to divide by 6.  It appears as if we've<br>
been doing this wrong ever since we first added cube map arrays for Sandy<br>
Bridge.  We've also had a shader hack to divide the size Z dimension of<br>
cube maps by 6 in the textureSize call.  This is completely bogus and the<br>
only reason for it is that we've been setting the depth six times too<br>
large.<br>
<br>
This little series fixes this.  In order to keep things back-portable,<br>
patch 3 comes in two versions.  Version (a) is based on pre-ISL and should<br>
be backportable to 12.0 or maybe even 11.2 or 11.1.  Version (b) on the<br>
other hand is based on top of the ISL work and can be applied on master.<br>
<br>
Cc: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
<br>
Jason Ekstrand (3):<br>
  i965: Use intel_get_image_dims in alloc_texture_storage<br>
  i965/miptree: Set logical_depth0 == 6 for cube maps<br>
  i965: Correctly set RENDER_SURFACE_STATE::Depth for cube map textures<br>
<br>
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp          | 21 +++++----------------<br>
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |  6 +++++-<br>
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c |  3 ++-<br>
 src/mesa/drivers/dri/i965/gen8_surface_state.c    |  3 ++-<br>
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c     | 14 ++++++++++----<br>
 src/mesa/drivers/dri/i965/intel_tex.c             |  2 ++<br>
 6 files changed, 26 insertions(+), 23 deletions(-)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.5.0.400.gff86faf<br>
<br>
_______________________________________________<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/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>