<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 21, 2017 at 2:48 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"><div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 12:35 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">Fixes dEQP-EGL.functional.image.rend<wbr>er_multiple_contexts.<br>
gles2_renderbuffer_stencil_ste<wbr>ncil_buffer<br>
<br>
CC: Mark Janes <<a href="mailto:mark.a.janes@intel.com" target="_blank">mark.a.janes@intel.com</a>><br>
CC: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
CC: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>><br>
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com" target="_blank">topi.pohjolainen@intel.com</a>><br></blockquote></div></div></div></div></blockquote><div><br></div><div>I went ahead and pushed the patch because I wanted to be able to rebase on top of all your ISL work.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 src/mesa/drivers/dri/i965/int<wbr>el_mipmap_tree.c | 19 ++++++++++++++++---<br>
 1 file changed, 16 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/in<wbr>tel_mipmap_tree.c b/src/mesa/drivers/dri/i965/in<wbr>tel_mipmap_tree.c<br>
index abc7f989db..69b02ead78 100644<br>
--- a/src/mesa/drivers/dri/i965/in<wbr>tel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/in<wbr>tel_mipmap_tree.c<br>
@@ -897,7 +897,22 @@ intel_miptree_create_for_bo(st<wbr>ruct brw_context *brw,<br>
 {<br>
    struct intel_mipmap_tree *mt;<br>
    uint32_t tiling, swizzle;<br>
-   GLenum target;<br>
+   const GLenum target = depth > 1 ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D;<br>
+<br>
+   if (brw->gen == 6 && format == MESA_FORMAT_S_UINT8) {<br>
+      mt = make_surface(brw, target, MESA_FORMAT_S_UINT8,<br>
+                        0, 0, width, height, depth, 1, ISL_TILING_W,<br>
+                        ISL_SURF_USAGE_STENCIL_BIT |<br>
+                        ISL_SURF_USAGE_TEXTURE_BIT,<br>
+                        BO_ALLOC_FOR_RENDER, bo);<br>
+      if (!mt)<br>
+         return NULL;<br>
+<br>
+      assert(bo->size >= mt->surf.size);<br>
+<br>
+      brw_bo_reference(bo);<br>
+      return mt;<br>
+   }<br>
<br>
    brw_bo_get_tiling(bo, &tiling, &swizzle);<br>
<br>
@@ -912,8 +927,6 @@ intel_miptree_create_for_bo(st<wbr>ruct brw_context *brw,<br>
     */<br>
    assert(pitch >= 0);<br>
<br>
-   target = depth > 1 ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D;<br>
-<br>
    /* The BO already has a tiling format and we shouldn't confuse the lower<br>
     * layers by making it try to find a tiling format again.<br>
     */<br>
<span class="m_-1739782362751299131HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>