[Piglit] [PATCH 2/4] arb_texture_storage_multisample fix sample count in tex-storage.c

Brian Paul brianp at vmware.com
Fri Oct 13 16:07:49 UTC 2017


Use GL_MAX_COLOR_TEXTURE_SAMPLES as sample count for
glTextureStorage2DMultisample().  Allows the test to pass on llvmpipe.
---
 tests/spec/arb_texture_storage_multisample/tex-storage.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_texture_storage_multisample/tex-storage.c b/tests/spec/arb_texture_storage_multisample/tex-storage.c
index 77f6046..949be32 100644
--- a/tests/spec/arb_texture_storage_multisample/tex-storage.c
+++ b/tests/spec/arb_texture_storage_multisample/tex-storage.c
@@ -79,13 +79,16 @@ check_immutable(void)
 {
 	GLuint tex;
 	GLint param;
+	GLint max_samples;
+
+	glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &max_samples);
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex);
 
 	/* specify storage for the texture, and mark it immutable-format */
 	glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE,
-				  4, GL_RGBA8, 64, 64, GL_TRUE);
+				  max_samples, GL_RGBA8, 64, 64, GL_TRUE);
 
 	if (!piglit_check_gl_error(GL_NO_ERROR)) {
 		piglit_report_subtest_result(PIGLIT_FAIL, "immutable");
@@ -110,7 +113,7 @@ check_immutable(void)
 
 	/* calling TexStorage2DMultisample again on the same texture should fail */
 	glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE,
-				  4, GL_RGBA8, 32, 32, GL_TRUE);
+				  max_samples, GL_RGBA8, 32, 32, GL_TRUE);
 
 	if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
 		printf("expected respecifying an immutable-format texture (with TexStorage*Multisample) to fail\n");
@@ -120,7 +123,7 @@ check_immutable(void)
 
 	/* calling TexImage2DMultisample should fail too */
 	glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE,
-				4, GL_RGBA8, 32, 32, GL_TRUE);
+				max_samples, GL_RGBA8, 32, 32, GL_TRUE);
 
 	if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
 		printf("expected respecifying an immutable-format texture (with TexImage*Multisample) to fail\n");
-- 
1.9.1



More information about the Piglit mailing list