<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 6, 2017 at 11:00 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad@kiwitree.net" target="_blank">chad@kiwitree.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Fri 26 May 2017, Jason Ekstrand wrote:<br>
> ---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>context.c       | 55 +++++----------------------<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 55 +++++++++++++++++++++++++++<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h |  6 +++<br>
>  3 files changed, 71 insertions(+), 45 deletions(-)<br>
<br>
</span><div><div class="gmail-h5">>  static void<br>
>  intel_update_state(struct gl_context * ctx, GLuint new_state)<br>
>  {<br>
> @@ -259,16 +224,16 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)<br>
>        /* We need inte_texture_object::_Format to be valid */<br>
>        intel_finalize_mipmap_tree(<wbr>brw, i);<br>
><br>
> -      if (intel_miptree_sample_with_<wbr>hiz(brw, tex_obj->mt))<br>
> -         intel_miptree_all_slices_<wbr>resolve_hiz(brw, tex_obj->mt);<br>
> -      else<br>
> -         intel_miptree_all_slices_<wbr>resolve_depth(brw, tex_obj->mt);<br>
> -      /* Sampling engine understands lossless compression and resolving<br>
> -       * those surfaces should be skipped for performance reasons.<br>
> -       */<br>
> -      const int flags = intel_texture_view_requires_<wbr>resolve(brw, tex_obj) ?<br>
> -                           0 : INTEL_MIPTREE_IGNORE_CCS_E;<br>
> -      intel_miptree_all_slices_<wbr>resolve_color(brw, tex_obj->mt, flags);<br>
> +      bool aux_supported;<br>
> +      intel_miptree_prepare_texture(<wbr>brw, tex_obj->mt, tex_obj->_Format,<br>
> +                                    &aux_supported);<br>
> +<br>
> +      if (!aux_supported && brw->gen >= 9 &&<br>
> +          intel_disable_rb_aux_buffer(<wbr>brw, tex_obj->mt->bo)) {<br>
> +         perf_debug("Sampling renderbuffer with non-compressible format - "<br>
> +                    "turning off compression");<br>
> +      }<br>
> +<br>
<br>
</div></div>I don't understand why intel_disable_rb_aux_buffer() is called here.<br>
Specifically, I don't understand why the code disables aux for<br>
a *framebuffer* attachment in response to the state of a *texture* view<br>
in the *same* draw call. There is hidden subtlety here.<br>
<br>
[time passes... tick tick tick]<br>
<br>
In general, the GL spec claims undefined behavior when simultaneuosly<br>
sampling and rendering to the same buffer. Self-blits are legal, though.<br>
So, it seems to me that intel_disable_rb_aux_buffer() is applicable here<br>
only during a glBlit* when src and dest are the same. Is that correct?<br>
Do there exist other applicable scenarios that I'm failing to see?<br></blockquote><div><br><a href="https://khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_barrier.txt">https://khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_barrier.txt</a><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Anyway, this is just a refactoring patch, so<br>
Reviewed-by: Chad Versace <<a href="mailto:chadversary@chromium.org">chadversary@chromium.org</a>><br>
</blockquote></div><br></div></div>