[Piglit] [PATCH 6/9] Add uint and uvec uniform support to shader_runner.
Chad Versace
chad at chad-versace.us
Wed Aug 17 15:34:12 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I found one minor fix. Otherwise, this is
Reviewed-by: Chad Versace <chad at chad-versace.us>
On 08/15/2011 11:45 AM, Paul Berry wrote:
> With this patch, shader_runner tests can now supply uniform values
> using types "uint" and "uvecN".
> ---
> tests/shaders/shader_runner.c | 30 ++++++++++++++++++++++++++++++
> 1 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 001f812..172fc34 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -647,11 +647,22 @@ get_ints(const char *line, int *ints, unsigned count)
>
>
> void
> +get_uints(const char *line, unsigned *uints, unsigned count)
> +{
> + unsigned i;
> +
> + for (i = 0; i < count; i++)
> + uints[i] = strtoul(line, (char **) &line, 0);
> +}
> +
> +
> +void
> set_uniform(const char *line)
> {
> char name[512];
> float f[16];
> int ints[16];
> + unsigned uints[16];
> GLuint prog;
> GLint loc;
> const char *type;
> @@ -677,6 +688,10 @@ set_uniform(const char *line)
> int val = atoi(line);
> piglit_Uniform1i(loc, val);
> return;
> + } else if (strncmp("uint", type, 3) == 0) {
^
s/3/4/
> + unsigned val = strtoul(line, NULL, 0);
> + piglit_Uniform1ui(loc, val);
> + return;
> } else if (strncmp("vec", type, 3) == 0) {
> switch (type[3]) {
> case '2':
> @@ -707,6 +722,21 @@ set_uniform(const char *line)
> piglit_Uniform4iv(loc, 1, ints);
> return;
> }
> + } else if (strncmp("uvec", type, 4) == 0) {
> + switch (type[4]) {
> + case '2':
> + get_uints(line, uints, 2);
> + piglit_Uniform2uiv(loc, 1, uints);
> + return;
> + case '3':
> + get_uints(line, uints, 3);
> + piglit_Uniform3uiv(loc, 1, uints);
> + return;
> + case '4':
> + get_uints(line, uints, 4);
> + piglit_Uniform4uiv(loc, 1, uints);
> + return;
> + }
> } else if ((strncmp("mat", type, 3) == 0)
> && (type[3] != '\0')
> && (type[4] == 'x')) {
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJOTEHkAAoJEAIvNt057x8i1vsP/2J3CB0mnkj1H31RRL0EYMBO
aRpWDcyuvwHQpI7fW0OnEvgiYhJvYJ9YvMtqeO+9i/okVLZZzBtPYqWdHgLR0Kww
ZjhMm8OMEwCe5r0bf1I2YtA3geiA7CIrfFgMJJMQ/+dZCVXaHDsxjPIE+PkfW0oa
l7RT94wwE4q3R42p+nkVW7J7gOrUs/imwYB3o62PoEoZbzKpaknbADb8rO+22+Dl
NnuPZK60aShOAO1zowRYgF6H4GPSkKOQNXahGzr1/lQikV7ihkOKP7iNv/xWlLeG
DH0P18Tr3CoVADn3mLs83epalggEy6krbh5B13D7eSl42Ma+QDJzA0l7ZnOmmyi8
czAYf/pyARpV/ooTj5JvGjBNp8zxMis1KxOX9aEMrFXkfuDpj2NJAY58lI7+C6eI
+l0S/icyy+k2DXh2LhdTkvUqMznxZDrCyLpUwKZ852i+q3zs4NwHJn+hahgpdp/t
uviewlZRewbaqEnAMKbGdGWWcux0DhLukwtn3Q2QSiRCDJQrm9fxew5dbePxr905
m0hrvOPtKOJevP3hN6i085k8olkFFoq/Avm0AxZJjqDHZ4zKxWzSrIbtt/A5jjmJ
2YON5I7dul6Nv0zDc/O6sm4TPQaucmWsf++8yuTrhfcTXozkXILvtTQFXSZrE7I/
z/DbObkvso+Tu2+qha7D
=WQHN
-----END PGP SIGNATURE-----
More information about the Piglit
mailing list