This makes some fairly simple changes to the existing tests to also work
with GL_OES_viewport_array, which presents largely identical
functionality. All of the tests continue to pass with desktop GL, and
also work with my soon-to-be-posted GL ES implementation for mesa.
Signed-off-by: Ilia Mirkin
---
tests/all.py | 16 +
tests/spec/arb_viewport_array/bounds.c | 23 ++
tests/spec/arb_viewport_array/clear.c | 5 ++
.../spec/arb_viewport_array/depth_range_indices.c | 27 ++-
tests/spec/arb_viewport_array/minmax.c | 9 +++
tests/spec/arb_viewport_array/queries.c| 15 +++-
tests/spec/arb_viewport_array/render_depthrange.c | 52 +++---
tests/spec/arb_viewport_array/render_scissor.c | 28 ++--
tests/spec/arb_viewport_array/render_viewport.c| 48 +
tests/spec/arb_viewport_array/render_viewport_2.c | 37 +++---
tests/spec/arb_viewport_array/scissor_check.c | 82 --
tests/spec/arb_viewport_array/scissor_indices.c| 5 ++
tests/spec/arb_viewport_array/viewport_indices.c | 22 ++
13 files changed, 274 insertions(+), 95 deletions(-)
diff --git a/tests/all.py b/tests/all.py
index fc77335..bc400e6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2813,6 +2813,22 @@ with profile.group_manager(
with profile.group_manager(
PiglitGLTest,
+grouptools.join('spec', 'oes_viewport_array')) as g:
+g(['arb_viewport_array-viewport-indices_gles3'], 'viewport-indices')
+g(['arb_viewport_array-depthrange-indices_gles3'], 'depthrange-indices')
+g(['arb_viewport_array-scissor-check_gles3'], 'scissor-check')
+g(['arb_viewport_array-scissor-indices_gles3'], 'scissor-indices')
+g(['arb_viewport_array-bounds_gles3'], 'bounds')
+g(['arb_viewport_array-queries_gles3'], 'queries')
+g(['arb_viewport_array-minmax_gles3'], 'minmax')
+g(['arb_viewport_array-render-viewport_gles3'], 'render-viewport')
+g(['arb_viewport_array-render-viewport-2_gles3'], 'render-viewport-2')
+g(['arb_viewport_array-render-depthrange_gles3'], 'render-depthrange')
+g(['arb_viewport_array-render-scissor_gles3'], 'render-scissor')
+g(['arb_viewport_array-clear_gles3'], 'clear')
+
+with profile.group_manager(
+PiglitGLTest,
grouptools.join('spec', 'nv_vertex_program2_option')) as g:
g(['vp-address-03'], run_concurrent=False)
g(['vp-address-05'], run_concurrent=False)
diff --git a/tests/spec/arb_viewport_array/bounds.c
b/tests/spec/arb_viewport_array/bounds.c
index b34d962..9a8e869 100644
--- a/tests/spec/arb_viewport_array/bounds.c
+++ b/tests/spec/arb_viewport_array/bounds.c
@@ -34,6 +34,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_compat_version = 32;
config.supports_gl_core_version = 32;
+ config.supports_gl_es_version = 31;
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
@@ -143,12 +144,20 @@ static bool
depth_range_bounds(GLint maxVP)
{
bool pass = true;
+#ifdef PIGLIT_USE_OPENGL
GLdouble dr[2], drGet[2];
+#else
+ GLfloat dr[2], drGet[2];
+#endif
int i;
/* intial values for near, far are 0.0, 1.0 repsectively */
for (i = 0; i < maxVP; i++) {
+#ifdef PIGLIT_USE_OPENGL
glGetDoublei_v(GL_DEPTH_RANGE, i, dr);
+#else
+ glGetFloati_v(GL_DEPTH_RANGE, i, dr);
+#endif
if (dr[0] != 0.0 || dr[1] != 1.0) {
printf("depth_range default value wrong for idx %d\n",
i);
@@ -160,14 +169,24 @@ depth_range_bounds(GLint maxVP)
/* test clamping of depth_range values */
dr[0] = -0.001;
dr[1] = 2.0;
+#ifdef PIGLIT_USE_OPENGL
glDepthRangeArrayv(0, 1, dr);
glGetDoublei_v(GL_DEPTH_RANGE, 0, drGet);
+#else
+ glDepthRangeArrayfvOES(0, 1, dr);
+ glGetFloati_vOES(GL_DEPTH_RANGE, 0, drGet);
+#endif
if (drGet[0] != 0.0 || drGet[1] != 1.0) {
printf("depth_range clamping failed glDepthRangeArrayv\n");
pass = false;
}
+#ifdef PIGLIT_USE_OPENGL
glDepthRangeIndexed(1, dr[0], dr[1]);
glGetDoublei_v(GL_DEPTH_RANGE, 1, drGet);
+#else
+ glDepthRangeIndexedfOES(1, dr[0], dr[1]);
+ glGetFloati_vOES(GL_DEPTH_RANGE, 1, drGet);
+#endif
if (drGet[0] != 0.0 || drGet[1] != 1.0) {
printf("depth_range clamping failed glDepthRangeIndexed\n");
pass = false;
@@ -251,7 +270,11 @@ piglit_init(int argc, char **argv)
bool pass = true;
GLint maxVP;
+#ifdef PIGLIT_USE_OPENGL
piglit_require_extension("GL_ARB_viewport_array");
+#else
+ piglit_require_extension("GL_OES_viewport_array");
+#endif
glGetIntegerv(GL_MAX_VIEWPORTS, &maxVP);
if (!piglit_check_gl_error(GL_NO_ERROR)) {
diff --git a/tests/spec/arb_viewport_array/clear.c
b/tests/