summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2013-03-08 14:37:00 -0800
committerAnuj Phogat <anuj.phogat@gmail.com>2013-03-19 11:13:04 -0700
commite43683a68ec94ba8f62e2bbe97bff6cd37c26d2a (patch)
tree8eff52aaa40609462c9a7592da3314dabcdb7eb3 /tests
parent0159bc7c6110f2eca940707fb85c27d6975ebdef (diff)
Fix etc2 test for format=COMPRESSED_R11_EAC
waffles-decompressed-etc2-r11-64x32-miptree.ktx contains per pixel RGBA data generated by ericsson's etcpack tool. While generating decompressed image for COMPRESSED_R11_EAC format, RED color data for each pixel is copied to GREEN and BLUE channels as well. Using this image for texturing in OpenGL ES 3.0 (internalFormat=GL_R8) causes GL_INVALID_OPERATION. This is because glTexImage2D() in GL ES 3.0 doesn't allow internalFormat = GL_R8 with format= GL_RGBA. To workaround this issue use internalFormat = GL_RGBA and mask all color channels except Red. Other option is to edit the waffles-decompressed-etc2-r11-64x32-miptree.ktx file and set all GREEN, BLUE components to zero. Considering the hassle involved in editing image file, I won't prefer that. This fixes the piglit failure on gles3 with COMPRESSED_R11_EAC format. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/spec/gles-3.0/oes_compressed_etc2_texture-miptree.c7
-rw-r--r--tests/spec/gles-3.0/waffles-decompressed-etc2-r11-64x32-miptree.ktxbin11016 -> 11016 bytes
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/spec/gles-3.0/oes_compressed_etc2_texture-miptree.c b/tests/spec/gles-3.0/oes_compressed_etc2_texture-miptree.c
index 0e29fd1a7..bfed1a518 100644
--- a/tests/spec/gles-3.0/oes_compressed_etc2_texture-miptree.c
+++ b/tests/spec/gles-3.0/oes_compressed_etc2_texture-miptree.c
@@ -199,6 +199,13 @@ piglit_init(int argc, char **argv)
decompressed_filename =
"waffles-decompressed-etc2-srgb8-alpha8-64x32-miptree.ktx";
} else if (strcmp(argv[1], "r11") == 0){
+ /* waffles-decompressed-etc2-r11-64x32-miptree.ktx contains
+ * per pixel RGBA data. But, glTexImage2D() in OpenGL ES 3.0
+ * doesn't allow internalFormat = GL_R8 with format= GL_RGBA.
+ * To workaround this issue use internalFormat = GL_RGBA and
+ * mask all the color channels except Red.
+ */
+ glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
compressed_filename =
"waffles-compressed-etc2-r11-64x32-miptree.ktx";
decompressed_filename =
diff --git a/tests/spec/gles-3.0/waffles-decompressed-etc2-r11-64x32-miptree.ktx b/tests/spec/gles-3.0/waffles-decompressed-etc2-r11-64x32-miptree.ktx
index 26315752f..f74e42b96 100644
--- a/tests/spec/gles-3.0/waffles-decompressed-etc2-r11-64x32-miptree.ktx
+++ b/tests/spec/gles-3.0/waffles-decompressed-etc2-r11-64x32-miptree.ktx
Binary files differ