<div dir="ltr">I don't really like this being in texture validation.  It has nothing to do with texture validation.  Instead, we should put it in brw_predraw_resolve_inputs and do it as a pre-pass.  This would let us store astc5x5_present as a local variable.  Also, I don't think we need texture_with_auxiliary_present for anything since our solution is to resolve those.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 27, 2018 at 1:30 AM,  <span dir="ltr"><<a href="mailto:kevin.rogovin@intel.com" target="_blank">kevin.rogovin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Kevin Rogovin <<a href="mailto:kevin.rogovin@intel.com">kevin.rogovin@intel.com</a>><br>
<br>
Signed-off-by: Kevin Rogovin <<a href="mailto:kevin.rogovin@intel.com">kevin.rogovin@intel.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_tex_validate.c | 15 +++++++++++++++<br>
 1 file changed, 15 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_tex_validate.c b/src/mesa/drivers/dri/i965/<wbr>intel_tex_validate.c<br>
index eaa60ba..2bf6c65 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_tex_validate.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_tex_validate.c<br>
@@ -179,6 +179,8 @@ brw_validate_textures(struct brw_context *brw)<br>
    struct gl_context *ctx = &brw->ctx;<br>
    const int max_enabled_unit = ctx->Texture._<wbr>MaxEnabledTexImageUnit;<br>
<br>
+   brw->astc5x5_wa.texture_<wbr>astc5x5_present = false;<br>
+   brw->astc5x5_wa.texture_with_<wbr>auxilary_present = false;<br>
    for (int unit = 0; unit <= max_enabled_unit; unit++) {<br>
       struct gl_texture_object *tex_obj = ctx->Texture.Unit[unit]._<wbr>Current;<br>
<br>
@@ -194,5 +196,18 @@ brw_validate_textures(struct brw_context *brw)<br>
<br>
       intel_update_max_level(tex_<wbr>obj, sampler);<br>
       intel_finalize_mipmap_tree(<wbr>brw, tex_obj);<br>
+<br>
+      /* ASTC5x5 workaround needs to know if textures in use have<br>
+       * auxilary in buffers and/or a texture in use is ASTC5x5<br>
+       */<br>
+      struct intel_texture_object *tex = intel_texture_object(tex_obj);<br>
+      struct intel_mipmap_tree *mt = tex->mt;<br>
+      if (mt && mt->aux_usage != ISL_AUX_USAGE_NONE) {<br>
+         brw->astc5x5_wa.texture_with_<wbr>auxilary_present = true;<br>
+      }<br>
+      if (tex->_Format == MESA_FORMAT_RGBA_ASTC_5x5 ||<br>
+          tex->_Format == MESA_FORMAT_SRGB8_ALPHA8_ASTC_<wbr>5x5) {<br>
+         brw->astc5x5_wa.texture_<wbr>astc5x5_present = true;<br>
+      }<br>
    }<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<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>