<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Originally, I had the entire astc and aux checking in a dedicated function; would that be more preferable?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-Kevin<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Jason Ekstrand [mailto:jason@jlekstrand.net]
<br>
<b>Sent:</b> Tuesday, March 6, 2018 6:02 PM<br>
<b>To:</b> Rogovin, Kevin <kevin.rogovin@intel.com><br>
<b>Cc:</b> ML mesa-dev <mesa-dev@lists.freedesktop.org><br>
<b>Subject:</b> Re: [Mesa-dev] [PATCH v3 3/7] i965: set ASTC5x5 workaround texture type tracking on texture validate<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, Feb 27, 2018 at 1:30 AM, <<a href="mailto:kevin.rogovin@intel.com" target="_blank">kevin.rogovin@intel.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">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/intel_tex_validate.c | 15 +++++++++++++++<br>
 1 file changed, 15 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c<br>
index eaa60ba..2bf6c65 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_tex_validate.c<br>
+++ b/src/mesa/drivers/dri/i965/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._MaxEnabledTexImageUnit;<br>
<br>
+   brw->astc5x5_wa.texture_astc5x5_present = false;<br>
+   brw->astc5x5_wa.texture_with_auxilary_present = false;<br>
    for (int unit = 0; unit <= max_enabled_unit; unit++) {<br>
       struct gl_texture_object *tex_obj = ctx->Texture.Unit[unit]._Current;<br>
<br>
@@ -194,5 +196,18 @@ brw_validate_textures(struct brw_context *brw)<br>
<br>
       intel_update_max_level(tex_obj, sampler);<br>
       intel_finalize_mipmap_tree(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_auxilary_present = true;<br>
+      }<br>
+      if (tex->_Format == MESA_FORMAT_RGBA_ASTC_5x5 ||<br>
+          tex->_Format == MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5) {<br>
+         brw->astc5x5_wa.texture_astc5x5_present = true;<br>
+      }<br>
    }<br>
 }<br>
<span class="hoenzb"><span style="color:#888888">--</span></span><span style="color:#888888"><br>
<span class="hoenzb">2.7.4</span><br>
<br>
<span class="hoenzb">_______________________________________________</span><br>
<span class="hoenzb">mesa-dev mailing list</span><br>
<span class="hoenzb"><a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a></span><br>
<span class="hoenzb"><a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></span></span><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>