[Mesa-stable] [Mesa-dev] [PATCH 3/4] i965: Replace draw_aux_buffer_disabled with draw_aux_usage

Jason Ekstrand jason at jlekstrand.net
Wed Jan 24 19:20:38 UTC 2018


On Wed, Jan 24, 2018 at 11:13 AM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> On Wednesday, January 24, 2018 2:03:41 AM PST Jason Ekstrand wrote:
> > Instead of keeping an array of booleans, we now hang onto an array of
> > isl_aux_usage enums.  This means that the thing we are passing from
> > brw_draw.c to surface state setup is the thing that surface state setup
> > actually needs instead of an input to compute what it needs.
> >
> > Cc: mesa-stable at lists.freedesktop.org
> [snip]
> > @@ -497,7 +498,8 @@ brw_predraw_resolve_inputs(struct brw_context *brw,
> bool rendering)
> >  }
> >
> >  static void
> > -brw_predraw_resolve_framebuffer(struct brw_context *brw)
> > +brw_predraw_resolve_framebuffer(struct brw_context *brw,
> > +                                bool *draw_aux_buffer_disabled)
> >  {
> >     struct gl_context *ctx = &brw->ctx;
> >     struct intel_renderbuffer *depth_irb;
> > @@ -550,7 +552,8 @@ brw_predraw_resolve_framebuffer(struct brw_context
> *brw)
> >        enum isl_aux_usage aux_usage =
> >           intel_miptree_render_aux_usage(brw, irb->mt, isl_format,
> >                                          blend_enabled,
> > -                                        brw->draw_aux_buffer_disabled[
> i]);
> > +                                        draw_aux_buffer_disabled[i]);
> > +      brw->draw_aux_usage[i] = aux_usage;
>
> I'm concerned this might break compute shaders.  Sure, they don't have
> renderbuffers.  However, the code to emit SURFACE_STATEs for textures
> calls brw_aux_surface_disabled which brw->draw_aux_usage[].  It only
> accesses elements 0..fb->_NumColorDrawBuffers-1, but I suspect there's
> still a framebuffer bound when doing a compute dispatch - it's just
> not relevant.
>

Compute shaders will never call this as it is the framebuffer funciton.
They only call predraw_resolve_inputs.


> This appears to be the only place that sets brw->draw_aux_usage[],
> and it isn't called for compute shaders.
>
> I'd say to just whack it back to "don't override things", but that
> means knowing what the actual usage is, which sounds painful...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20180124/fca3b627/attachment.html>


More information about the mesa-stable mailing list