summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>2014-11-21 16:57:57 +0100
committerIago Toral Quiroga <itoral@igalia.com>2015-01-15 10:08:36 +0100
commit6716abaceccc74ee86055a5da82a8df7a1c4625e (patch)
tree2453212f623370cf241397062a59e6712e1cecf7
parent6c92c42d88fe87398292df024fc00dcbf7220243 (diff)
glean/pixelformats: restrict GL_ABGR_EXT format test to the types in the spec
Packed formats specs (which were all written after the GL_EXT_abgr) explicitly say that the packed formats can only be used with GL_RGB, GL_BGR, GL_RGBA, or GL_BGRA and do not mention GL_ABGR_EXT. NVIDIA allows it but AMD doesn't and Intel driver hasn't allowed it with UNSIGNED_SHORT_5_5_5_1 and UNSIGNED_INT_10_10_10_2 as of c471b09bf4. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r--tests/glean/tpixelformats.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/glean/tpixelformats.cpp b/tests/glean/tpixelformats.cpp
index 27881bfd2..9943e7348 100644
--- a/tests/glean/tpixelformats.cpp
+++ b/tests/glean/tpixelformats.cpp
@@ -612,6 +612,14 @@ PixelFormatsTest::CompatibleFormatAndType(GLenum format, GLenum datatype) const
if (format == GL_ABGR_EXT && !haveABGR)
return false;
+ // Special case: GL_ABGR_EXT can't be used with packed types
+ // because the packed formats specs (which were all written after the
+ // GL_EXT_abgr) explicitly say that the packed formats can only be used
+ // with GL_RGB, GL_BGR, GL_RGBA, or GL_BGRA and do not mention
+ // GL_ABGR_EXT.
+ if (format == GL_ABGR_EXT && IsPackedType(datatype))
+ return false;
+
if (format == GL_RG && !haveRG)
return false;