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

Olivier Galibert galibert at pobox.com
Tue Jun 12 03:27:37 PDT 2012


  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?

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

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

Fourth question: how does gl_SampleMask interact with all that when
more than one sample is evaluated.  And what does gl_SampleMaskIn look
like in the same case?

I hope you people can help me clarify all that stuff :-)

Best,

  OG.


More information about the mesa-dev mailing list