[Piglit] [PATCH 3/5] Allow 2d array and 3d textures on OpenGL ES 3.x

Anuj Phogat anuj.phogat at gmail.com
Mon Mar 21 18:54:11 UTC 2016


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 tests/util/piglit-util-gl.c | 6 ++++++
 tests/util/piglit-util-gl.h | 5 +++++
 tests/util/piglit_ktx.c     | 7 +++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index d636810..e350d49 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -50,6 +50,12 @@ bool piglit_is_gles(void)
 	return strncmp("OpenGL ES", version_string, 9) == 0;
 }
 
+bool piglit_is_gles3(void)
+{
+	const char *version_string = (const char *) glGetString(GL_VERSION);
+	return strncmp("OpenGL ES 3", version_string, 11) == 0;
+}
+
 int piglit_get_gl_version(void)
 {
 	const char *version_string = (const char *) glGetString(GL_VERSION);
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index 00c106b..91cf7e8 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -51,6 +51,11 @@ extern bool piglit_is_core_profile;
 bool piglit_is_gles(void);
 
 /**
+ * Determine if the API is OpenGL ES 3.x.
+ */
+bool piglit_is_gles3(void);
+
+/**
  * \brief Get version of OpenGL or OpenGL ES API.
  *
  * Returned version is multiplied by 10 to make it an integer.  So for
diff --git a/tests/util/piglit_ktx.c b/tests/util/piglit_ktx.c
index d47a2ed..9050a6f 100644
--- a/tests/util/piglit_ktx.c
+++ b/tests/util/piglit_ktx.c
@@ -678,11 +678,14 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
 				     info->gl_type,
 				     img->data);
 		break;
-	case GL_TEXTURE_2D_ARRAY:
-	case GL_TEXTURE_3D:
 	case GL_TEXTURE_CUBE_MAP_ARRAY:
 		if (piglit_is_gles())
 			goto unsupported_on_gles;
+		break;
+	case GL_TEXTURE_2D_ARRAY:
+	case GL_TEXTURE_3D:
+		if (piglit_is_gles() && !piglit_is_gles3())
+			goto unsupported_on_gles;
 		else if (info->gl_type == 0)
 			glCompressedTexImage3D(info->target,
 					       level,
-- 
2.5.0



More information about the Piglit mailing list