diff options
author | Tapani Pälli <tapani.palli@intel.com> | 2015-02-27 11:30:53 +0200 |
---|---|---|
committer | Tapani Pälli <tapani.palli@intel.com> | 2015-03-02 08:01:32 +0200 |
commit | 0147c1743248f61c4452f380cee7956d45f3c635 (patch) | |
tree | 82df3b571364e377da98bc5c323eff54fae32993 /tests/spec/arb_program_interface_query | |
parent | e6309d223965b52c44590597abe4c490d4dcee10 (diff) |
arb_program_interface_query: add array to location test
Patch adds array to GetProgramResourceLocation test and 3 subtests
for invalid indexing of array. Case 2 fails on Nvidia GTX 660
(binary driver version 331.38).
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'tests/spec/arb_program_interface_query')
-rw-r--r-- | tests/spec/arb_program_interface_query/resource-location.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/tests/spec/arb_program_interface_query/resource-location.c b/tests/spec/arb_program_interface_query/resource-location.c index b9caded8f..ac2cd148a 100644 --- a/tests/spec/arb_program_interface_query/resource-location.c +++ b/tests/spec/arb_program_interface_query/resource-location.c @@ -103,11 +103,12 @@ static const char fs_text[] = "#extension GL_ARB_explicit_attrib_location : require\n" "#extension GL_ARB_explicit_uniform_location : require\n" "layout (location = 9) uniform vec4 color;\n" + "layout (location = 1) uniform float array[4];\n" "layout (location = 1) out vec4 output0;\n" "layout (location = 0) out vec4 output1;\n" "void main() {\n" - "output0 = color;\n" - "output1 = color;\n" + "output0 = color * array[2];\n" + "output1 = color * array[3];\n" "}"; static const char vs_subroutine_text[] = @@ -415,12 +416,33 @@ piglit_init(int argc, char **argv) pass = false; } + /* Test 3 illegal array cases referenced in the spec as 'bug 9254'. */ + if (glGetProgramResourceLocation(prog, GL_UNIFORM, "array[+1]") != -1) { + piglit_report_subtest_result(PIGLIT_FAIL, "array case 1"); + pass = false; + } + + if (glGetProgramResourceLocation(prog, GL_UNIFORM, "array[01]") != -1) { + piglit_report_subtest_result(PIGLIT_FAIL, "array case 2"); + pass = false; + } + + if (glGetProgramResourceLocation(prog, GL_UNIFORM, "array[ 0]") != -1) { + piglit_report_subtest_result(PIGLIT_FAIL, "array case 3"); + pass = false; + } + /* Valid inputs. */ - validate_location(prog, GL_UNIFORM, "color", 9); - validate_location(prog, GL_PROGRAM_INPUT, "input0", 3); - validate_location(prog, GL_PROGRAM_INPUT, "input1", 6); - validate_location(prog, GL_PROGRAM_OUTPUT, "output0", 1); - validate_location(prog, GL_PROGRAM_OUTPUT, "output1", 0); + validate_location(prog, GL_UNIFORM, "color", 9); + validate_location(prog, GL_PROGRAM_INPUT, "input0", 3); + validate_location(prog, GL_PROGRAM_INPUT, "input1", 6); + validate_location(prog, GL_PROGRAM_OUTPUT, "output0", 1); + validate_location(prog, GL_PROGRAM_OUTPUT, "output1", 0); + + /* Array indexing cases. */ + validate_location(prog, GL_UNIFORM, "array", 1); + validate_location(prog, GL_UNIFORM, "array[0]", 1); + validate_location(prog, GL_UNIFORM, "array[1]", 2); if (!piglit_check_gl_error(GL_NO_ERROR)) piglit_report_result(PIGLIT_FAIL); |