For example to set an int at location 1 to the value 0: uniform int 1 0 Previously only name could be used to set the uniform. --- tests/shaders/shader_runner.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index 6ec8f5c..7d8cc3f 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -1645,26 +1645,30 @@ set_uniform(const char *line, int ubo_array_index) double d[16]; int ints[16]; unsigned uints[16]; - GLuint prog; GLint loc; const char *type; - glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *) &prog); - type = eat_whitespace(line); line = eat_text(type); line = strcpy_to_space(name, eat_whitespace(line)); - if (set_ubo_uniform(name, type, line, ubo_array_index)) - return; + if (isdigit(name[0])) { + loc = strtol(name, NULL, 0); + } else { + GLuint prog; - loc = glGetUniformLocation(prog, name); - if (loc < 0) { - printf("cannot get location of uniform \"%s\"\n", - name); - piglit_report_result(PIGLIT_FAIL); - } + if (set_ubo_uniform(name, type, line, ubo_array_index)) + return; + + glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *) &prog); + loc = glGetUniformLocation(prog, name); + if (loc < 0) { + printf("cannot get location of uniform \"%s\"\n", + name); + piglit_report_result(PIGLIT_FAIL); + } + } if (string_match("float", type)) { get_floats(line, f, 1); -- 2.4.3 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit