<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 7:20 AM, 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"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Jul 19, 2016 at 5:56 AM, Iago Toral <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Mon, 2016-07-18 at 22:16 -0700, Jason Ekstrand wrote:<br>
> The intel_get_image_dims helper function handles some image dimension<br>
> sanitization for us for things such as 1-D array textures. We should<br>
> probably be using it here.<br>
><br>
> Signed-off-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
> Cc: "12.0 11.2 11.1" <<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a>><br>
> ---<br>
> src/mesa/drivers/dri/i965/intel_tex.c | 2 ++<br>
> 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/intel_tex.c<br>
> b/src/mesa/drivers/dri/i965/intel_tex.c<br>
> index 8c32fe3..d3e24f4 100644<br>
> --- a/src/mesa/drivers/dri/i965/intel_tex.c<br>
> +++ b/src/mesa/drivers/dri/i965/intel_tex.c<br>
> @@ -141,6 +141,8 @@ intel_alloc_texture_storage(struct gl_context<br>
> *ctx,<br>
> !intel_miptree_match_image(intel_texobj->mt, first_image) ||<br>
> intel_texobj->mt->last_level != levels - 1) {<br>
> intel_miptree_release(&intel_texobj->mt);<br>
> +<br>
> + intel_get_image_dims(first_image, &width, &height, &depth);<br>
<br>
</span>I don't think we want this. This code calls intel_miptree_create below,<br>
which then calls miptree_create and that<br>
calls intel_miptree_create_layout, which has this code:<br>
<br>
if (target == GL_TEXTURE_1D_ARRAY) {<br>
/* ... */<br>
assert(height0 == 1 || depth0 == 1);<br>
if (height0 > 1) {<br>
depth0 = height0;<br>
height0 = 1;<br>
}<br>
}<br></blockquote><div><br></div></div></div><div>Are you serious????? "1-D Arrays are hard. Let's just make sure it works in either case". Wow...<br><br></div><div>I'll see if I can't delete that code.<span class="HOEnZb"><font color="#888888"><br></font></span></div></div></div></div></blockquote><div><br></div><div>Ok, I just sent out a v2 that deletes that bit of magic and hackery.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>--Jason<br></div></font></span><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Maybe we should just call the function in intel_miptree_create_layout<br>
instead?<br>
<span><font color="#888888"><br>
Iago<br>
</font></span><div><div><br>
> intel_texobj->mt = intel_miptree_create(brw, texobj->Target,<br>
> first_image-<br>
> >TexFormat,<br>
> 0, levels - 1,</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>