[Mesa-dev] [PATCH 1/2] softpipe: don't attempt to blend integer formats.

Jose Fonseca jfonseca at vmware.com
Sun Jan 29 15:34:25 PST 2012



----- Original Message -----
> On 01/29/2012 06:26 PM, Brian Paul wrote:
> > On Sun, Jan 29, 2012 at 9:35 AM, Dave Airlie <airlied at gmail.com>
> > wrote:
> >> From: Dave Airlie <airlied at redhat.com>
> >>
> >> This blocks blending in the simple path, need to look at the more
> >> complicated paths.
> >>
> >> Signed-off-by: Dave Airlie <airlied at redhat.com>
> >> ---
> >>  src/gallium/drivers/softpipe/sp_quad_blend.c |    3 ++-
> >>  1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c
> >> b/src/gallium/drivers/softpipe/sp_quad_blend.c
> >> index d546b14..d2a5269 100644
> >> --- a/src/gallium/drivers/softpipe/sp_quad_blend.c
> >> +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
> >> @@ -1155,7 +1155,8 @@ choose_blend_quad(struct quad_stage *qs,
> >>             softpipe->blend->rt[0].colormask == 0xf &&
> >>             softpipe->framebuffer.nr_cbufs == 1)
> >>    {
> >> -      if (!blend->rt[0].blend_enable) {
> >> +      if (!blend->rt[0].blend_enable ||
> >> +
> >>         util_format_is_pure_integer(softpipe->framebuffer.cbufs[0]->format))
> >> {
> >>          qs->run = single_output_color;
> >>       }
> >>       else if (blend->rt[0].rgb_src_factor ==
> >>       blend->rt[0].alpha_src_factor &&
> >> --
> > 
> > How about checking for integer color buffers in the state tracker
> > and
> > turning off blending (and alpha test) there?

My feeling too.

> That's a waste of CPU time.

I sincerely doubt CPU time would be even measurable, as this could easily be done once per fbo, i.e., extremely low frequency.

> Sane users will have disabled blending on them already, and for the
> rest, they can rely on the hardware to ignore blending for integer
> render targets (at least NV hardware does it automatically, telling
> from
> the RT format; they're nice that way).

Even if some hardware already ignores integer blending, given that this means _zero_ performance improvement per fragment or primitive, I don't think that it justifies having to force upon the sanitization upon every other driver.  IMH, doing this once in Mesa would mean one less gotcha for driver implementers to worry about...

Jose


More information about the mesa-dev mailing list