[Mesa-dev] [PATCH 04/16] i965/hsw: Adjust uploading default color for stencil surfaces

Jordan Justen jordan.l.justen at intel.com
Thu Aug 25 05:27:37 UTC 2016


On 2016-08-24 17:54:23, Kenneth Graunke wrote:
> On Wednesday, August 24, 2016 5:49:53 PM PDT Ian Romanick wrote:
> > On 08/24/2016 05:46 PM, Matt Turner wrote:
> > > On Wed, Aug 24, 2016 at 4:54 PM, Jordan Justen
> > > <jordan.l.justen at intel.com> wrote:
> > >> -         if (_mesa_format_has_color_component(format, i))
> > >> +         if (is_color ? _mesa_format_has_color_component(format, i) : i == 0)
> > > 
> > > This line kinda makes my head hurt. Not sure what to suggest.
> > 
> > Yeah... I wasn't sure that (is_color &&
> > _mesa_format_has_color_component(format, i)) || (!is_color && i == 0)
> > was actually better.
> 
> How about
> 
> static bool
> has_component(mesa_format format, int i)
> {
>    if (_mesa_is_format_color_format(format)
>       return _mesa_format_has_color_component(format, i);
> 
>    /* depth and stencil have only one component */
>    return i == 0;
> }

Looks good to me. I'll make this change.

Thanks,

-Jordan


More information about the mesa-dev mailing list