Test passes on Nvidia GTX 660 (binary driver version 331.38).
Signed-off-by: Tapani Pälli <[email protected]>
---
tests/all.py | 1 +
.../arb_program_interface_query/CMakeLists.gl.txt | 1 +
.../arb_program_interface_query/resource-index.c | 210 +++++++++++++++++++++
3 files changed, 212 insertions(+)
create mode 100644 tests/spec/arb_program_interface_query/resource-index.c
diff --git a/tests/all.py b/tests/all.py
index 8b9426a..d19b20a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2049,6 +2049,7 @@ for test_type in ('shader', 'api'):
arb_program_interface_query = spec['ARB_program_interface_query']
add_plain_test(arb_program_interface_query,
['arb_program_interface_query-resource-location'])
+add_plain_test(arb_program_interface_query,
['arb_program_interface_query-resource-index'])
# Group ARB_explicit_uniform_location
arb_explicit_uniform_location = spec['ARB_explicit_uniform_location']
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 6fb7eaf..2028553 100644
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
)
piglit_add_executable (arb_program_interface_query-resource-location
resource-location.c)
+piglit_add_executable (arb_program_interface_query-resource-index
resource-index.c)
diff --git a/tests/spec/arb_program_interface_query/resource-index.c
b/tests/spec/arb_program_interface_query/resource-index.c
new file mode 100644
index 0000000..a496c65
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/resource-index.c
@@ -0,0 +1,210 @@
+/*
+ * Copyright © 2015 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.
+ */
+
+/**
+ * \file resource-index.c
+ *
+ * Tests GetProgramResourceIndex interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ * "The command returns the unsigned integer index assigned to a
+ * resource named <name> in the interface type <programInterface> of
+ * program object <program>. The error INVALID_ENUM is generated if
+ * <programInterface> is ATOMIC_COUNTER_BUFFER, since active atomic
+ * counter buffer resources are not assigned name strings.
+ *
+ * If <name> exactly matches the name string of one of the active
+ * resources for <programInterface>, the index of the matched
+ * resource is returned. Additionally, if <name> would exactly match
+ * the name string of an active resource if "[0]" were appended to <name>,
+ * the index of the matched resource is returned. Otherwise, <name> is
+ * considered not to be the name of an active resource, and INVALID_INDEX
+ * is returned. Note that if an interface enumerates a single active
+ * resource list entry for an array variable (e.g., "a[0]"), a <name>
+ * identifying any array element other than the first (e.g., "a[1]")
+ * is not considered to match.
+ *
+ * For the interface TRANSFORM_FEEDBACK_VARYING, the value INVALID_INDEX
+ * should be returned when querying the index assigned to the special
+ * names "gl_NextBuffer", "gl_SkipComponents1", "gl_SkipComponents2",
+ * "gl_SkipComponents3", and "gl_SkipComponents4".
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_compat_version = 32;
+ config.supports_gl_core_version = 32;