[v2,11/15] nv_conditional_render: port clear-test to gles2

Submitted by Erik Faye-Lund on Nov. 7, 2018, 9:14 p.m.

Details

Message ID 20181107211420.7355-12-erik.faye-lund@collabora.com
State New
Headers show
Series "port NV_conditional_render tests to GLES3" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Erik Faye-Lund Nov. 7, 2018, 9:14 p.m.
This test can relatively easily be ported to gles2, so let's do that for
better test-coverage.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
---
 tests/opengl.py                               |  1 +
 .../CMakeLists.gles2.txt                      |  1 +
 tests/spec/nv_conditional_render/clear.c      | 19 +++++++++++++++++++
 3 files changed, 21 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/opengl.py b/tests/opengl.py
index 41aead3f7..5595521c2 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3808,6 +3808,7 @@  with profile.test_list.group_manager(
     g(['nv_conditional_render-blitframebuffer'], 'blitframebuffer')
     g(['nv_conditional_render-blitframebuffer_gles3'], 'blitframebuffer_gles3')
     g(['nv_conditional_render-clear'], 'clear')
+    g(['nv_conditional_render-clear_gles2'], 'clear_gles2')
     g(['nv_conditional_render-copypixels'], 'copypixels')
     g(['nv_conditional_render-copyteximage'], 'copyteximage')
     g(['nv_conditional_render-copytexsubimage'], 'copytexsubimage')
diff --git a/tests/spec/nv_conditional_render/CMakeLists.gles2.txt b/tests/spec/nv_conditional_render/CMakeLists.gles2.txt
index cb4a87098..926ff7f30 100644
--- a/tests/spec/nv_conditional_render/CMakeLists.gles2.txt
+++ b/tests/spec/nv_conditional_render/CMakeLists.gles2.txt
@@ -3,5 +3,6 @@  link_libraries(piglitutil_${piglit_target_api})
 piglit_add_executable (nv_conditional_render-begin-while-active_gles2 begin-while-active.c common.c)
 piglit_add_executable (nv_conditional_render-begin-zero_gles2 begin-zero.c)
 piglit_add_executable (nv_conditional_render-blitframebuffer_gles3 blitframebuffer.c common.c)
+piglit_add_executable (nv_conditional_render-clear_gles2 clear.c common.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/nv_conditional_render/clear.c b/tests/spec/nv_conditional_render/clear.c
index 2ad24eea5..c62bf7a69 100644
--- a/tests/spec/nv_conditional_render/clear.c
+++ b/tests/spec/nv_conditional_render/clear.c
@@ -43,12 +43,23 @@ 
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
+#ifdef PIGLIT_USE_OPENGL
 	config.supports_gl_compat_version = 10;
+#else // PIGLIT_USE_OPENGL_ES2
+	config.supports_gl_es_version = 20;
+#endif
+
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
 	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
+#ifndef PIGLIT_USE_OPENGL
+
+static GLint prog_green;
+
+#endif
+
 enum piglit_result
 piglit_display(void)
 {
@@ -62,7 +73,11 @@  piglit_display(void)
 	gen_queries(1, &q);
 
 	/* Generate query pass: draw top half of screen. */
+#ifdef PIGLIT_USE_OPENGL
 	glColor4f(0.0, 1.0, 0.0, 0.0);
+#else
+	glUseProgram(prog_green);
+#endif
 	query_rect_top(q);
 
 	/* Conditional render that should draw bottom half of screen. */
@@ -93,4 +108,8 @@  void
 piglit_init(int argc, char **argv)
 {
 	piglit_require_extension("GL_NV_conditional_render");
+
+#ifndef PIGLIT_USE_OPENGL
+	prog_green = build_green_program();
+#endif
 }