Search code examples
openglglsl

glTexImage2DMultiSample - fixedsamplelocations set on false, getting samples count


I use glTexImage2DMultiSample with fixedsamplelocations parameter set on false. Then texels may have different samples count. How can I check samples count for a texel in the fragment shader ? Is the only solution to use textureSamples (ARB_shader_texture_image_samples) ?


Solution

  • The sample count for an image is for the image, not for individual texels. So if some implementation assigns different numbers of samples to different texels, that's not something you can query. The implementation will have to behave as if it didn't do that, since all of OpenGL's APIs assume a fixed sample count for an image. This includes the APIs for reading and writing the current fragment's sample mask.