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

Dave Airlie airlied at gmail.com
Sun Jan 29 10:39:21 PST 2012


On Sun, Jan 29, 2012 at 5:51 PM, Dave Airlie <airlied at gmail.com> wrote:
> On Sun, Jan 29, 2012 at 5:26 PM, Brian Paul <brian.e.paul at gmail.com> 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?
>>
>> If you have integer buffers and try to enable blending with a hardware
>> driver, does hardware typically no-opt the blend or does the driver
>> have to disable blending?
>
> Just not sure about the case where you bind multiple color buffers,
> some blendable, some integer (I think that is legal).
>
> For r600 at least we have to set a blend bypass bit on the CB setup
> for int types, similiar to what I'm doing here in softpipe really.
>

So I'm not sure why we couldn't force rt[x] blending to 0 for all CBs
with integer formats, but if the gallium interface reflects the
hardware I see no real reason to do it that way, and at least for r600
hw seems to take per-MRT blend enable flags separate from CB blend
bypass.

Dave.


More information about the mesa-dev mailing list