<div dir="ltr">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 2:29 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday, July 19, 2017 12:53:45 PM PDT Topi Pohjolainen wrote:<br>
> CC: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
> CC: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><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>wm_surface_state.c | 16 +++++++++++++---<br>
>  1 file changed, 13 insertions(+), 3 deletions(-)<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 ab6b9cdd29..bc06949116 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,17 @@ 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_image_num_layers(const struct intel_mipmap_tree *mt, GLenum target,<br>
> +                     unsigned level)<br>
> +{<br>
> +   if (target == GL_TEXTURE_CUBE_MAP)<br>
> +      return 6;<br>
> +<br>
> +   return target == GL_TEXTURE_3D ?<br>
> +      minify(mt->logical_depth0, level) : mt->logical_depth0;<br>
> +}<br>
> +<br>
>  static void<br>
>  update_image_surface(struct brw_context *brw,<br>
>                       struct gl_image_unit *u,<br>
> @@ -1660,9 +1671,8 @@ update_image_surface(struct brw_context *brw,<br>
>        } else {<br>
>           struct intel_texture_object *intel_obj = intel_texture_object(obj);<br>
>           struct intel_mipmap_tree *mt = intel_obj->mt;<br>
> -         const unsigned num_layers = (!u->Layered ? 1 :<br>
> -                                      obj->Target == GL_TEXTURE_CUBE_MAP ? 6 :<br>
> -                                      mt->logical_depth0);<br>
> +         const unsigned num_layers = u->Layered ?<br>
> +            get_image_num_layers(mt, obj->Target, u->Level) : 1;<br>
><br>
>           struct isl_view view = {<br>
>              .format = format,<br>
><br>
<br>
</div></div>Reviewed-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><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>
<br></blockquote></div><br></div>