[Piglit] [PATCH] arb_program_interface_query: added subtests to getprogramresourceindex

asimiklit.work at gmail.com asimiklit.work at gmail.com
Fri Aug 31 14:02:05 UTC 2018


From: Andrii Simiklit <andrii.simiklit at globallogic.com>

Added test cases to test arb_program_interface_query-getprogramresourceindex
to check the 'glGetProgramResourceIndex' function more deeper.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92822
Signed-off-by: Andrii Simiklit <andrii.simiklit at globallogic.com>
---
 tests/spec/arb_program_interface_query/common.h     | 20 ++++++++++++++++++++
 .../getprogramresourceindex.c                       | 21 +++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/tests/spec/arb_program_interface_query/common.h b/tests/spec/arb_program_interface_query/common.h
index 371b033..34478f3 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -63,6 +63,26 @@ static const char vs_aofa[] =
 	"	gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n"
 	"}";
 
+static const char vs_aofa_const_int[] =
+	"#version 150\n"
+	"#extension GL_ARB_arrays_of_arrays : require\n"
+	"in vec4 vs_input2[2][2];\n"
+	"in vec4 vs_input3[2][2][2];\n"
+	"void main() {\n"
+	"	int idx = 1;\n"
+	"	gl_Position = vs_input2[idx][0] + vs_input3[idx][idx][0];\n"
+	"}";
+
+static const char vs_aofa_variable_int[] =
+	"#version 150\n"
+	"#extension GL_ARB_arrays_of_arrays : require\n"
+	"in vec4 vs_input2[2][2];\n"
+	"in vec4 vs_input3[2][2][2];\n"
+	"void main() {\n"
+	"	uint idx = uint(vs_input2[0][0].x);\n"
+	"	gl_Position = vs_input2[idx][0] + vs_input3[idx][1][0];\n"
+	"}";
+
 static const char vs_std[] =
 	"#version 150\n"
 	"struct vs_struct {\n"
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
index 16b38e2..be7d646 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourceindex.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -169,6 +169,27 @@ static const struct subtest_index_t index_subtests[] = {
 	{   vs_aofa,              GL_PROGRAM_INPUT,    "vs_input2[0][0]",  true, -1, GL_NO_ERROR },
 	{   vs_aofa,              GL_PROGRAM_INPUT,    "vs_input2[1][0]", false, -1, GL_NO_ERROR },
 	{   vs_aofa,              GL_PROGRAM_INPUT,    "vs_input2[0][1]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,          "vs_input2", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,       "vs_input2[0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,    "vs_input2[0][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,       "vs_input2[1]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,    "vs_input2[1][0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,    "vs_input2[0][1]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,    "vs_input3[0][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT, "vs_input3[0][1][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT, "vs_input3[1][0][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT,    "vs_input3[1][1]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_const_int,    GL_PROGRAM_INPUT, "vs_input3[1][1][0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,          "vs_input2", false, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,       "vs_input2[0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,    "vs_input2[0][0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,    "vs_input2[1][0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,    "vs_input2[0][1]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,    "vs_input3[0][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT, "vs_input3[0][1][0]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT, "vs_input3[1][0][0]", false, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT,    "vs_input3[1][1]",  true, -1, GL_NO_ERROR },
+	{   vs_aofa_variable_int, GL_PROGRAM_INPUT, "vs_input3[1][1][0]",  true, -1, GL_NO_ERROR },
 	{    vs_sub,          GL_VERTEX_SUBROUTINE,                "vss",  true, -1, GL_NO_ERROR },
 	{    vs_sub,          GL_VERTEX_SUBROUTINE,               "vss2",  true, -1, GL_NO_ERROR },
 	{ vs_subidx,          GL_VERTEX_SUBROUTINE,            "vss_idx",  true,  5, GL_NO_ERROR },
-- 
2.7.4



More information about the Piglit mailing list