[Mesa-dev] [v2 3/6] i965: Track non-compressible sampling of renderbuffers

Pohjolainen, Topi topi.pohjolainen at gmail.com
Tue Sep 6 17:26:04 UTC 2016


On Tue, Sep 06, 2016 at 08:24:11AM -0700, Jason Ekstrand wrote:
>    On Tue, Sep 6, 2016 at 8:16 AM, Pohjolainen, Topi
>    <[1]topi.pohjolainen at gmail.com> wrote:
> 
>      On Tue, Sep 06, 2016 at 07:54:16AM -0700, Jason Ekstrand wrote:
>      >    On Tue, Sep 6, 2016 at 12:28 AM, Topi Pohjolainen
>      >    <[1][2]topi.pohjolainen at gmail.com> wrote:
>      >
>      >      Signed-off-by: Topi Pohjolainen
>      <[2][3]topi.pohjolainen at intel.com>
> 
>    >      ---
>    >       src/mesa/drivers/dri/i965/brw_context.c          | 16
>    >      ++++++++++++++++
>    >       src/mesa/drivers/dri/i965/brw_context.h          | 10
>    ++++++++++
>    >       src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 12
>    ++++++++++--
>    >       3 files changed, 36 insertions(+), 2 deletions(-)
>    >      diff --git a/src/mesa/drivers/dri/i965/brw_context.c
>    >      b/src/mesa/drivers/dri/i965/brw_context.c
>    >      index b880b4f..c5c6fdd 100644
>    >      --- a/src/mesa/drivers/dri/i965/brw_context.c
>    >      +++ b/src/mesa/drivers/dri/i965/brw_context.c
>    >      @@ -197,6 +197,22 @@ intel_texture_view_requires_resolve(struct
>    >      brw_context *brw,
>    >                     _mesa_get_format_name(intel_tex->_Format),
>    >                     _mesa_get_format_name(intel_tex->mt->format));
>    >      +   const struct gl_framebuffer *fb = brw->ctx.DrawBuffer;
>    >      +   for (unsigned i = 0; i < fb->_NumColorDrawBuffers; i++) {
>    >      +      const struct intel_renderbuffer *irb =
>    >      +         intel_renderbuffer(fb->_ColorDrawBuffers[i]);
>    >      +
>    >      +      /* In case the same surface is also used for rendering
>    one
>    >      needs to
>    >      +       * disable the compression.
>    >      +       */
>    >      +      brw->draw_aux_buffer_disabled[i] = intel_tex->mt->bo ==
>    >      irb->mt->bo;
> 
>      This loop goes thru all render surfaces and explicitly sets the
>      flag. In
>      other words all flags are reset before uploading state - no need for
>      separate memset.
> 
>    Ugh... then it is busted if you have multiple render targets *or*
>    multiple textures where the one being rendered to isn't the last one.
>    Only the render buffer for the last bound texture will get the
>    buffer_aux_buffer_disabled[] bit set.  We really need a reset and
>    set-of-disable-needed model.

Fully agree, I started re-reading and realized the same. I wonder how I got
this even working...


More information about the mesa-dev mailing list