[Piglit] [PATCH] tests: restrict use of the GL_ABGR_EXT format to the types in the spec

Samuel Iglesias Gonsalvez siglesias at igalia.com
Mon Jan 12 00:59:12 PST 2015


GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_SHORT_1_5_5_5_REV and GL_UNSIGNED_SHORT_5_5_5_1 types
are not explicitly allowed to work with GL_ABGR_EXT format in
the GL spec nor GL_EXT_abgr spec.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
---
 tests/glean/tpixelformats.cpp            | 7 +++++++
 tests/texturing/texture-packed-formats.c | 4 ----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/glean/tpixelformats.cpp b/tests/glean/tpixelformats.cpp
index 27881bf..80d926a 100644
--- a/tests/glean/tpixelformats.cpp
+++ b/tests/glean/tpixelformats.cpp
@@ -618,6 +618,13 @@ PixelFormatsTest::CompatibleFormatAndType(GLenum format, GLenum datatype) const
 	if (datatype == GL_UNSIGNED_INT_5_9_9_9_REV && !haveTexSharedExp)
 		return false;
 
+	if (format == GL_ABGR_EXT &&
+	    (datatype == GL_UNSIGNED_INT_2_10_10_10_REV ||
+	     datatype == GL_UNSIGNED_INT_10_10_10_2 ||
+	     datatype == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+	     datatype == GL_UNSIGNED_SHORT_5_5_5_1))
+		return false;
+
 	const int formatComps = NumberOfComponentsInFormat(format);
 	const int typeComps = NumberOfComponentsInPackedType(datatype);
 	return formatComps == typeComps || typeComps == 0;
diff --git a/tests/texturing/texture-packed-formats.c b/tests/texturing/texture-packed-formats.c
index 1c92b1c..f63e5c2 100644
--- a/tests/texturing/texture-packed-formats.c
+++ b/tests/texturing/texture-packed-formats.c
@@ -97,10 +97,6 @@ static const struct pixel_format Formats[] = {
 	  GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x800f, 0x80f0 },
 	{ "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4_REV",
 	  GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0xf008, 0x0f08 },
-	{ "GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1",
-	  GL_ABGR_EXT, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0xf801, 0xf83e },
-	{ "GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV",
-	  GL_ABGR_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x800f, 0x7c0f },
 
 	{ "GL_RGB/GL_UNSIGNED_SHORT_5_6_5",
 	  GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, 0xf800, 0x7e0 },
-- 
2.1.0



More information about the Piglit mailing list