[Mesa-dev] [Piglit] [PATCH] ext_framebuffer_multisample: check for num_samples<=1

Brian Paul brianp at vmware.com
Mon Jan 28 07:54:08 PST 2013


[cross-posting this reply to the mesa-dev list]

On 01/27/2013 09:07 AM, Brian Paul wrote:
> On Sun, Jan 27, 2013 at 2:51 AM, Eric Anholt<eric at anholt.net>  wrote:
>> Brian Paul<brianp at vmware.com>  writes:
>>
>>> Even if GL_ARB_multisample is advertised, it's OK for the max number of
>>> samples to be zero.
>>
>> Huh?  The EXT_framebuffer_multisample spec says minmax of MAX_SAMPLES is
>> 1.
>
> And GL_ARB_framebuffer_object says it's zero.
>
> It looks like the piglit test is checking the wrong extension.  At
> line 364 we're calling
> piglit_require_extension("GL_ARB_framebuffer_object").  I don't see
> any checks for GL_EXT_framebuffer_multisample.  I was looking at
> GL_MAX_SAMPLES in the former, not the later.
>
> I guess the proper fix is to just check for the proper extension.


There's several things going on here.

First, the piglit test needs a 
piglit_require_extension("GL_EXT_framebuffer_multisample") check.

Second, I think we need to disable advertising this extension for 
swrast, softpipe and llvmpipe.

Third, I think we need to decide what GL_MAX_SAMPLES=1 really means.

I've been reading the various multisample-related extensions and none 
of them really says anything special about GL_MAX_SAMPLES=1.  But in 
some places (like the GLSL spec) you'll see the phrase 
"single-sampling" but it seems to mean the non-multisample / 
conventional rasterization case.

My thinking is that it would be theoretically possible to have 
single-sample multisampling (perhaps with a different sample position 
per pixel).

In any case, regardless of the number of samples per pixel, we still 
must obey centroid sampling mode (must interpolate at a point that 
lies in both the pixel and in the primitive being
rendered).  swrast, softpipe and llvmpipe don't support that so we 
really shouldn't advertise GL_MAX_SAMPLES=1 (it should be zero) so 
GL_EXT_framebuffer_multisample shouldn't be advertised for those drivers.

Most likely, the user's going to be disappointed if they want 
multisampling in their app and the driver only gives him GL_MAX_SAMPLES=1.

Does this sound reasonable?

-Brian


More information about the mesa-dev mailing list