[Mesa-dev] Clarifications w.r.t MSAA

Christoph Bumiller e0425955 at student.tuwien.ac.at
Tue Jun 12 04:50:08 PDT 2012


On 06/12/2012 12:27 PM, Olivier Galibert wrote:
>   Hi all,
> 
> I'm getting a little lost in all the interactions between the
> different parts of the GL standards and what I understand of the
> expectations when it comes to MSAA.  It would be nice if I could have
> some clarifications.
> 
> I'll start with what I think I understand (and please correct me when
> I'm wrong) and add a number of questions.  I'll also ignore the
> "resolve" part, which isn't an issue (at least for me :-).
> 
> 
> MSAA is a variant on the supersampling theme where the coverage is
> supersampled but depth, stencil and color may or may not be.  The
> destination buffer has enough space to store the full results of a
> complete supersampling, but some of the values may be duplicated.
> 
> The variable MIN_SAMPLE_SHADING_VALUE allows the application to
> control the minimum number of values that have to be computed.  It can
> say for instance that in a 16xMSAA case at least 4 samples per pixel
> are required.
> 
> So let's take a case of 16xMSAA (say with the DX11 pattern) and let's
> look at the pipeline.  First the coverage is sampled for the 16 fixed
> positions, leaving C active samples.  Then there should be early depth
> testing then shading, or the other way around, depending on the
> shaders.
> 
> First question: how many depths should be computed, and for which
> coordinates? Which of these values is associated with which sample?

One for each sample point. The depth buffer will be multisampled as well.
Coverage sampling (CSAA) where you have extra coverage samples that do
NOT (necessarily) correspond to color sample locations are not covered
by the GL spec, it's vendor-specific.

> 
> Second question: how many samples should be shaded, and for which
> coordinates?  What is the impact of depth testing failure?

As many as the user requested via glMinSampleShading, and the sample
locations to choose seem to be up to the implementation.

If the depth test fails for all the samples associated with a fragment
shader invocation, you can probably choose not to run it, which should
not be noticeable.

> 
> Third question: what happens when a variable has a "sample" qualifier
> in the fragment shader?  Or "centroid"?



More information about the mesa-dev mailing list