diff --git a/util/test/demos/gl/gl_texture_zoo.cpp b/util/test/demos/gl/gl_texture_zoo.cpp index 63df5a850..2156f5bb8 100644 --- a/util/test/demos/gl/gl_texture_zoo.cpp +++ b/util/test/demos/gl/gl_texture_zoo.cpp @@ -328,7 +328,7 @@ void main() bool QueryFormatBool(GLenum target, GLenum format, GLenum pname) { GLint param = 0; - glGetInternalformativ(target, format, pname, 4, ¶m); + glGetInternalformativ(target, format, pname, sizeof(param), ¶m); return param != 0; } @@ -338,6 +338,13 @@ void main() test.canDepth = QueryFormatBool(test.target, test.fmt.internalFormat, GL_DEPTH_RENDERABLE); test.canStencil = QueryFormatBool(test.target, test.fmt.internalFormat, GL_STENCIL_RENDERABLE); + GLint numSamples = 0; + glGetInternalformativ(test.target, test.fmt.internalFormat, GL_NUM_SAMPLE_COUNTS, + sizeof(numSamples), &numSamples); + + GLint samples[8]; + glGetInternalformativ(test.target, test.fmt.internalFormat, GL_SAMPLES, sizeof(samples), samples); + Vec4i dimensions(texWidth, texHeight, texDepth); bool isCompressed = @@ -349,6 +356,17 @@ void main() if(isCompressed && (test.dim == 1 || test.dim == 3 || test.isRect || test.isMSAA)) return; + // if the format is MSAA check we have our sample count + if(test.isMSAA) + { + bool found = false; + for(GLint i = 0; i < numSamples; i++) + found |= (samples[i] == texSamples); + + if(!found) + return; + } + // any format that supports MSAA but can't be rendered to is unsupported if(!test.canRender && !test.canDepth && !test.canStencil && test.isMSAA) return;