I have determined that a texture that uses 1 for the sample count when glTextureStorage2DMultisample is called will produce a texture that reports the sample count is 2 in a shader. Card is an Nvidia GEForce 1080.
This code produces a green screen:
if (textureSamples(ColorBuffer) == 2) outColor = vec4(0,1,0,1);
Is this “1x” texture consuming the same memory and bandwidth as a 2x multisample texture? The spec makes it sounds as if 1x is supported:
samples specifies the number of samples to be used for the texture and must be greater than zero and less than or equal to the value of GL_MAX_SAMPLES.
glTexStorage2DMultisample - OpenGL 4 Reference Pages
When testing on an AMD 570, this does not happen. On this card textureSamples() returns 1.
So it appears the Nvidia 1080 at least does not actually support 1x MS textures, although the spec says integers above zero are supported.
That appears to be a bug in driver. What happen if you solicit 0 or more than 1 samples? My first think has been than the driver was doing some thing like (1 << sampleCount), where the result for a sampleCount == 0 would be 1, and the result for a sampleCount == 1 would be 2.
I have been using 2x, 4x, 8x, 16x, and 32x MSAA on this card for years with no apparent problems. However, I have never checked the actual result of textureSamples() for those settings.
Supplying 0 for the number of samples should fail, but I have never tried it.