[Piglit] [PATCH v3 1/4] arb_texture_compression/invalid-formats: Add ASTC to list of formats
Nanley Chery
nanleychery at gmail.com
Wed Sep 16 13:22:55 PDT 2015
From: Nanley Chery <nanley.g.chery at intel.com>
ASTC formats are added to the list of formats that should not be returned by the
COMPRESSED_TEXTURE_FORMATS query.
v2. add astc test to all.py (Chad).
Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
tests/all.py | 5 +++
.../spec/arb_texture_compression/invalid-formats.c | 51 +++++++++++++++++++++-
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/tests/all.py b/tests/all.py
index 4fbe75b..748e27e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4154,6 +4154,11 @@ with profile.group_manager(
g(['oes_compressed_etc1_rgb8_texture-miptree'], 'miptree')
with profile.group_manager(
+ PiglitGLTest,
+ grouptools.join('spec', 'khr_texture_compression_astc')) as g:
+ g(['arb_texture_compression-invalid-formats', 'astc'], 'invalid formats')
+
+with profile.group_manager(
PiglitGLTest,
grouptools.join('spec', 'oes_compressed_paletted_texture')) as g:
g(['oes_compressed_paletted_texture-api'], 'basic API')
diff --git a/tests/spec/arb_texture_compression/invalid-formats.c b/tests/spec/arb_texture_compression/invalid-formats.c
index e67f00e..7a081bf 100644
--- a/tests/spec/arb_texture_compression/invalid-formats.c
+++ b/tests/spec/arb_texture_compression/invalid-formats.c
@@ -76,7 +76,7 @@ struct format_list {
/**
* Formats that are part of the extension but should not be exposed.
*/
- struct format_tuple bad[5];
+ struct format_tuple bad[29];
};
/**
@@ -267,6 +267,46 @@ static const struct format_list etc2_formats = {
};
/**
+ * Formats belonging to GL_KHR_texture_compression_astc_ldr
+ */
+static const struct format_list astc_formats = {
+ {
+ { NULL, 0 },
+ },
+ {
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_4x4_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_5x4_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_5x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_6x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_6x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_8x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_8x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_8x8_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_10x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_10x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_10x8_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_10x10_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_12x10_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_RGBA_ASTC_12x12_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR) },
+ { ENUM_AND_STRING(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR) },
+ { NULL, 0 },
+ }
+};
+
+/**
* List of all known compression methods to test
*
* The dummy first element is because this list is used by \c main to replace
@@ -284,6 +324,7 @@ const char *all_formats[] = {
"paletted",
"etc1",
"etc2",
+ "astc",
};
enum piglit_result
@@ -520,6 +561,14 @@ piglit_init(int argc, char **argv)
piglit_is_extension_supported("GL_ARB_ES3_compatibility"),
true)
&& pass;
+ } else if (strcmp(argv[i], "astc") == 0) {
+ pass = try_formats(&astc_formats,
+ compressed_formats,
+ num_compressed_formats,
+ check_errors,
+ piglit_is_extension_supported("GL_KHR_texture_compression_astc_ldr"),
+ false)
+ && pass;
} else {
fprintf(stderr,
"Unrecognized selection `%s'\n", argv[i]);
--
2.5.1
More information about the Piglit
mailing list