[Piglit] [PATCH v2 6/6] s3tc-errors: port to gles20
Erik Faye-Lund
erik.faye-lund at collabora.com
Fri Oct 26 13:03:08 UTC 2018
The glGetTexLevelParameteriv-function wasn't added to gles before
gles31, so let's just skip those tests on earlier versions. This
allows us to also run this test on gles20.
Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
tests/texturing/s3tc-errors.c | 51 ++++++++++++++++++-----------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index 4401dd23c..7e9bfa8b5 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -39,7 +39,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
#ifdef PIGLIT_USE_OPENGL
config.supports_gl_compat_version = 11;
#else // PIGLIT_USE_OPENGL_ES2
- config.supports_gl_es_version = 31;
+ config.supports_gl_es_version = 20;
#endif
config.window_width = 200;
@@ -196,34 +196,37 @@ test_format(int width, int height, GLfloat *image, GLenum requested_format)
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
pass = check_rendering(width, height) && pass;
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED,
- &is_compressed);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT,
- &format);
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
- GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
- &compressed_size);
+ if (!piglit_is_gles() || piglit_get_gl_version() >= 31) {
- pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED,
+ &is_compressed);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
+ GL_TEXTURE_INTERNAL_FORMAT, &format);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
+ GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
+ &compressed_size);
- if (!is_compressed) {
- printf("Image was not compressed\n");
- pass = false;
- }
+ pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
- if (format != requested_format) {
- printf("Internal Format mismatch. Found: 0x%04x Expected: 0x%04x\n",
- format, requested_format);
- pass = false;
- }
+ if (!is_compressed) {
+ printf("Image was not compressed\n");
+ pass = false;
+ }
+
+ if (format != requested_format) {
+ printf("Internal Format mismatch. Found: 0x%04x Expected: 0x%04x\n",
+ format, requested_format);
+ pass = false;
+ }
- expected_size = piglit_compressed_image_size(requested_format, width,
- height);
+ expected_size = piglit_compressed_image_size(requested_format,
+ width, height);
- if (compressed_size != expected_size) {
- printf("Compressed image size mismatch. Found: %u Expected: %u\n",
- compressed_size, expected_size);
- pass = false;
+ if (compressed_size != expected_size) {
+ printf("Compressed image size mismatch. Found: %u Expected: %u\n",
+ compressed_size, expected_size);
+ pass = false;
+ }
}
#ifdef PIGLIT_USE_OPENGL
--
2.17.2
More information about the Piglit
mailing list