[Piglit] [PATCH 2/3] shader_runner: Add the ability to specify uniform matrices
Ian Romanick
idr at freedesktop.org
Thu Apr 28 14:55:44 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
Column major, naturally.
---
tests/shaders/shader_runner.c | 50 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 315841d..5e896a2 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -681,6 +681,56 @@ set_uniform(const char *line)
piglit_Uniform4fv(loc, 1, f);
return;
}
+ } else if ((strncmp("mat", type, 3) == 0)
+ && (type[3] != '\0')
+ && (type[4] == 'x')) {
+ switch (type[3]) {
+ case '2':
+ switch (type[5]) {
+ case '2':
+ get_floats(line, f, 4);
+ piglit_UniformMatrix2fv(loc, 1, GL_FALSE, f);
+ return;
+ case '3':
+ get_floats(line, f, 6);
+ piglit_UniformMatrix2x3fv(loc, 1, GL_FALSE, f);
+ return;
+ case '4':
+ get_floats(line, f, 8);
+ piglit_UniformMatrix2x4fv(loc, 1, GL_FALSE, f);
+ return;
+ }
+ case '3':
+ switch (type[5]) {
+ case '2':
+ get_floats(line, f, 6);
+ piglit_UniformMatrix3x2fv(loc, 1, GL_FALSE, f);
+ return;
+ case '3':
+ get_floats(line, f, 9);
+ piglit_UniformMatrix3fv(loc, 1, GL_FALSE, f);
+ return;
+ case '4':
+ get_floats(line, f, 12);
+ piglit_UniformMatrix3x4fv(loc, 1, GL_FALSE, f);
+ return;
+ }
+ case '4':
+ switch (type[5]) {
+ case '2':
+ get_floats(line, f, 8);
+ piglit_UniformMatrix4x2fv(loc, 1, GL_FALSE, f);
+ return;
+ case '3':
+ get_floats(line, f, 12);
+ piglit_UniformMatrix4x3fv(loc, 1, GL_FALSE, f);
+ return;
+ case '4':
+ get_floats(line, f, 16);
+ piglit_UniformMatrix4fv(loc, 1, GL_FALSE, f);
+ return;
+ }
+ }
}
strcpy_to_space(name, type);
--
1.7.4
More information about the Piglit
mailing list