This consists of tests adapted from Khronos conformance suite and
Android surface flinger. While the former deals with getters/setters,
enumrations and simple sampling of texture based images, the latter
addresses bilinear sampling of non-GPU written subsampled UV-planes
and conversion from YUV to RGB.
The original Android test consist of two YV12 formatted textures,
one of size 64x64 and another of size 64x66. Both represent checker
board pattern each YUV component having value 63 or 191. Here I have
only the first but I'm planning to adopt the latter also if the approach
I have taken is reasonable. Instead of filling in the entire pattern I
have only written those YUV-components that are actually checked (a
dozen odd pixels) while the rest are initialised to zero. In addition
I used calculated floating point values instead of the hardcoded found
in the original. There, however, I ended up in deviations and I would
appreciate if people understanding the domain of YUV to RGB conversion
better could take a good look.
In the implementation that I have written for mesa/i965 I have also
support for NV12 format. Whereas YV12 (YVU420) has separate U- and
V-planes, NV12 has them combined into one. Hence I would like to have
the same tests for NV12 as for YV12 if acceptable.
The tests are written only for ES2 contexts, I haven't looked into
how I would separate the tests not dealing with external sampler
(samplerExternalOES is only defined for ES 2.x).
Signed-off-by: Topi Pohjolainen topi.pohjolai...@intel.com
---
tests/spec/CMakeLists.txt |1 +
.../oes_egl_image_external/CMakeLists.gles2.txt| 16 +
tests/spec/oes_egl_image_external/CMakeLists.txt |3 +
.../oes_egl_image_external.c | 776
4 files changed, 796 insertions(+)
create mode 100644 tests/spec/oes_egl_image_external/CMakeLists.gles2.txt
create mode 100644 tests/spec/oes_egl_image_external/CMakeLists.txt
create mode 100644 tests/spec/oes_egl_image_external/oes_egl_image_external.c
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 96b5a61..485cf5e 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -66,6 +66,7 @@ add_subdirectory (ext_texture_array)
add_subdirectory (ext_texture_integer)
add_subdirectory (arb_draw_buffers)
add_subdirectory (oes_draw_texture)
+add_subdirectory (oes_egl_image_external)
add_subdirectory (arb_blend_func_extended)
add_subdirectory (ext_unpack_subimage)
add_subdirectory (arb_vertex_array_object)
diff --git a/tests/spec/oes_egl_image_external/CMakeLists.gles2.txt
b/tests/spec/oes_egl_image_external/CMakeLists.gles2.txt
new file mode 100644
index 000..1ae1792
--- /dev/null
+++ b/tests/spec/oes_egl_image_external/CMakeLists.gles2.txt
@@ -0,0 +1,16 @@
+#add_definitions(-DSOURCE_DIR=${piglit_SOURCE_DIR}/)
+
+include_directories(
+ ${OPENGL_INCLUDE_PATH}
+ )
+
+link_libraries(
+ ${OPENGL_egl_LIBRARY}
+ piglitutil_gles2
+ )
+
+piglit_add_executable(oes_egl_image_external_gles2
+ oes_egl_image_external.c
+ )
+
+# vim: ft=cmake:
diff --git a/tests/spec/oes_egl_image_external/CMakeLists.txt
b/tests/spec/oes_egl_image_external/CMakeLists.txt
new file mode 100644
index 000..d9d41f2
--- /dev/null
+++ b/tests/spec/oes_egl_image_external/CMakeLists.txt
@@ -0,0 +1,3 @@
+if(OPENGL_egl_LIBRARY)
+ piglit_include_target_api()
+endif(OPENGL_egl_LIBRARY)
diff --git a/tests/spec/oes_egl_image_external/oes_egl_image_external.c
b/tests/spec/oes_egl_image_external/oes_egl_image_external.c
new file mode 100644
index 000..b04c72c
--- /dev/null
+++ b/tests/spec/oes_egl_image_external/oes_egl_image_external.c
@@ -0,0 +1,776 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Author: Topi Pohjolainen topi.pohjolai...@intel.com
+ */
+
+/** @file