Test valid and invalid queries using glGetFLoati_v and glGetDoublei_v.
Also test correct queries of GL_SCISSOR_TEST default value and
settable values.
Tested on Nvidia Quadro 600 and all tests pass.
---
tests/all.tests | 1 +
tests/spec/arb_viewport_array/CMakeLists.gl.txt | 1 +
tests/spec/arb_viewport_array/queries.c | 159
++++++++++++++++++++++++
3 files changed, 161 insertions(+)
create mode 100644 tests/spec/arb_viewport_array/queries.c
diff --git a/tests/all.tests b/tests/all.tests
index 4b035d3..06c9d8c 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1735,6 +1735,7 @@ arb_viewport_array['viewport-indices'] =
concurrent_test('arb_viewport_array-vie
arb_viewport_array['depthrange-indices'] =
concurrent_test('arb_viewport_array-depthrange-indices')
arb_viewport_array['scissor-indices'] =
concurrent_test('arb_viewport_array-scissor-indices')
arb_viewport_array['bounds'] =
concurrent_test('arb_viewport_array-bounds')
+arb_viewport_array['queries'] =
concurrent_test('arb_viewport_array-queries')
nv_vertex_program = Group()
spec['NV_vertex_program'] = nv_vertex_program
diff --git a/tests/spec/arb_viewport_array/CMakeLists.gl.txt
b/tests/spec/arb_viewport_array/CMakeLists.gl.txt
index e508102..ab149f8 100644
--- a/tests/spec/arb_viewport_array/CMakeLists.gl.txt
+++ b/tests/spec/arb_viewport_array/CMakeLists.gl.txt
@@ -13,5 +13,6 @@
piglit_add_executable(arb_viewport_array-viewport-indices
viewport_indices.c)
piglit_add_executable(arb_viewport_array-depthrange-indices
depth_range_indices.c)
piglit_add_executable(arb_viewport_array-scissor-indices
scissor_indices.c)
piglit_add_executable(arb_viewport_array-bounds bounds.c)
+piglit_add_executable(arb_viewport_array-queries queries.c)
# vim: ft=cmake:
diff --git a/tests/spec/arb_viewport_array/queries.c
b/tests/spec/arb_viewport_array/queries.c
new file mode 100644
index 0000000..13ba563
--- /dev/null
+++ b/tests/spec/arb_viewport_array/queries.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright © 2013 LunarG, Inc.
+ *
+ * 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: Jon Ashburn <j...@lunarg.com>
+ */
+/**
+ * Test valid and invalid queries using glGetFloati_v and
glGetDoublei_v.
+ * NOTE: "index" parameter validity is tested in the depthrange-indices
+ * and viewport-indices tests for the glGet*i_v(). The "bounds" test
+ * does test some valid queries using glGet*i_v().
+ * Also test GL_SCISSOR_TEST default value and settable value can be
+ * correctly queried.
+ */
+
+#include "piglit-util-gl-common.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_compat_version = 32;
+ config.supports_gl_core_version = 32;
+
+ config.window_visual = PIGLIT_GL_VISUAL_RGBA |
PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+ return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+ bool pass = true;
+ GLint maxVP;
+ GLboolean scEnabled;
+ GLdouble vald[4] = {0.0, 0.0, 0.0, 0.0};
+ GLfloat valf[4] = {0.0, 0.0, 0.0, 0.0};
+ GLint vali[4] = {0, 0, 0, 0};
+ int i;
+ GLenum tokens[] = {GL_MAX_VIEWPORTS, GL_VIEWPORT_SUBPIXEL_BITS,
+ GL_VIEWPORT_BOUNDS_RANGE, GL_LAYER_PROVOKING_VERTEX,
+ GL_VIEWPORT_INDEX_PROVOKING_VERTEX};
+ GLenum indexedTokens[] = {GL_VIEWPORT, GL_DEPTH_RANGE,
GL_SCISSOR_BOX};