[Mesa-dev] multisample clears

Dave Airlie airlied at gmail.com
Mon Mar 4 14:23:02 PST 2013

On Mon, Mar 4, 2013 at 11:47 PM, Marek Olšák <maraeo at gmail.com> wrote:
> On Mon, Mar 4, 2013 at 4:54 AM, Dave Airlie <airlied at gmail.com> wrote:
>> I've been playing with softpipe msaa on and off, but I hit a problem
>> with the clears and am just wondering if the state tracker should be
>> doing something like this.
>> Or maybe only if any bound buffer has nr_samples > 1, or fallback to
>> the non-quad draw method.
>> I can't see how else the driver could distinguish a multisample clear.
>> The other problem I have and not figuring out is if rendering to a
>> buffer with multisample off, then turning it on is meant to be
>> meaningful, if you have to clear
>> the buffer in between, then with this fixed it should be cool.
>> Dave.
>> From e1ee59d87ba42d8a58be640ee1fd2b952414f45e Mon Sep 17 00:00:00 2001
>> From: Dave Airlie <airlied at redhat.com>
>> Date: Mon, 4 Mar 2013 13:39:17 +1000
>> Subject: [PATCH] st/mesa: enable multisample in clear quad code
>> Not sure if this is correct at all
> For clears, blits, and the like, multisampling doesn't have to be
> enabled, which means pixel values are stored in all samples regardless
> of sample positions.
> Multisampling can be problematic if the rendered quad doesn't cover
> whole pixels (floating-point precision may play a role, not sure), so
> it's better not to enable it.

Yeah I thought about it a bit more and I think you are right, I was
being premature in my optimisation,
in that if I had a multisample buffer with say 4 samples and I was
rendering non-multisampled into it
I was only using one sample and storing how many I'd used. However I
should just replicate samples
at this point and look towards optimising it later if possible.


More information about the mesa-dev mailing list