<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 17, 2017 at 6:35 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">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 24 ++++++++++++++++++++----<br>
1 file changed, 20 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index b692d55abb..ca36936cb9 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -340,6 +340,25 @@ unwind:<br>
return false;<br>
}<br>
<br>
+static bool<br>
+needs_stencil(const struct brw_context *brw,<br>
+ struct intel_mipmap_tree *mt,<br>
+ mesa_format format, uint32_t layout_flags)<br></blockquote><div><br></div><div>Maybe call this "needs_separate_stencil" just to be a bit more clear?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+{<br>
+<br>
+ if (layout_flags & MIPTREE_LAYOUT_FOR_BO)<br>
+ return false;<br>
+<br>
+ if (_mesa_get_format_base_format(<wbr>format) != GL_DEPTH_STENCIL)<br>
+ return false;<br>
+<br>
+ if (brw->must_use_separate_<wbr>stencil)<br>
+ return true;<br>
+<br>
+ return brw->has_separate_stencil &&<br>
+ intel_miptree_supports_hiz(<wbr>brw, mt);<br>
+}<br>
+<br>
/**<br>
* @param for_bo Indicates that the caller is<br>
* intel_miptree_create_for_bo(). If true, then do not create<br>
@@ -519,10 +538,7 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
mt->physical_height0 = height0;<br>
mt->physical_depth0 = depth0;<br>
<br>
- if (!(layout_flags & MIPTREE_LAYOUT_FOR_BO) &&<br>
- _mesa_get_format_base_format(<wbr>format) == GL_DEPTH_STENCIL &&<br>
- (brw->must_use_separate_<wbr>stencil ||<br>
- (brw->has_separate_stencil && intel_miptree_supports_hiz(<wbr>brw, mt)))) {<br>
+ if (needs_stencil(brw, mt, format, layout_flags)) {<br>
uint32_t stencil_flags = MIPTREE_LAYOUT_ACCELERATED_<wbr>UPLOAD;<br>
if (brw->gen == 6) {<br>
stencil_flags |= MIPTREE_LAYOUT_TILING_ANY;<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>