demos: minor updates for shader_api.c test
Mesa's glGetUniformLocation() does support array indexes. Minor code reformatting. It would be great if this program were converted into a glean test...
This commit is contained in:
parent
2b4f0216bf
commit
b6ad7c8c4a
|
@ -113,7 +113,8 @@ static void test_uniform_size_type1(const char *glslType, GLenum glType, const c
|
||||||
GLenum type;
|
GLenum type;
|
||||||
GLint size;
|
GLint size;
|
||||||
|
|
||||||
printf(" Running subtest %s\n", glslType); fflush(stdout);
|
printf(" Running subtest %s\n", glslType);
|
||||||
|
fflush(stdout);
|
||||||
sprintf(buffer, "#version 120\nuniform %s m[60];\nvoid main() { gl_Position[0] = m[59]%s; }\n",
|
sprintf(buffer, "#version 120\nuniform %s m[60];\nvoid main() { gl_Position[0] = m[59]%s; }\n",
|
||||||
glslType, el);
|
glslType, el);
|
||||||
|
|
||||||
|
@ -169,7 +170,8 @@ static void test_attrib_size_type1(const char *glslType, GLenum glType, const ch
|
||||||
GLenum type;
|
GLenum type;
|
||||||
GLint size;
|
GLint size;
|
||||||
|
|
||||||
printf(" Running subtest %s\n", glslType); fflush(stdout);
|
printf(" Running subtest %s\n", glslType);
|
||||||
|
fflush(stdout);
|
||||||
sprintf(buffer, "#version 120\nattribute %s m;\nvoid main() { gl_Position[0] = m%s; }\n",
|
sprintf(buffer, "#version 120\nattribute %s m;\nvoid main() { gl_Position[0] = m%s; }\n",
|
||||||
glslType, el);
|
glslType, el);
|
||||||
|
|
||||||
|
@ -302,8 +304,6 @@ static void test_uniform_multiple_samplers(void)
|
||||||
assert_no_error();
|
assert_no_error();
|
||||||
program = make_program(NULL, "uniform sampler2D s[2];\nvoid main() { gl_FragColor = texture2D(s[1], vec2(0.0, 0.0)); }\n");
|
program = make_program(NULL, "uniform sampler2D s[2];\nvoid main() { gl_FragColor = texture2D(s[1], vec2(0.0, 0.0)); }\n");
|
||||||
location = glGetUniformLocation(program, "s[0]");
|
location = glGetUniformLocation(program, "s[0]");
|
||||||
if (location == -1) /* Mesa doesn't currently support indexing */
|
|
||||||
location = glGetUniformLocation(program, "s");
|
|
||||||
assert(location != -1);
|
assert(location != -1);
|
||||||
assert_no_error();
|
assert_no_error();
|
||||||
glUniform1iv(location, 2, values);
|
glUniform1iv(location, 2, values);
|
||||||
|
|
Loading…
Reference in New Issue