mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Check that our MSAA sample count is supported in GL texture zoo test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user