summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-08 14:37:03 -0700
committerBrian Paul <brianp@vmware.com>2009-12-08 14:37:05 -0700
commite24d9421124543ad042527ff8d9d6d0b0d451f52 (patch)
tree172a6442cda16a1ba2580db0d04d48054950982c
parent002d88e1a508c23402f082a0eb02f5ba88bd90fa (diff)
shaderAPI: move some assertions, clean-ups
-rw-r--r--src/glean/tshaderapi.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/glean/tshaderapi.cpp b/src/glean/tshaderapi.cpp
index 662428c..1769bfd 100644
--- a/src/glean/tshaderapi.cpp
+++ b/src/glean/tshaderapi.cpp
@@ -271,8 +271,6 @@ ShaderAPITest::test_uniform_size_type1(const char *glslType, GLenum glType, cons
char buffer[1024];
GLuint program;
GLint active, i;
- GLenum type;
- GLint size;
//printf(" Running subtest %s\n", glslType);
//fflush(stdout);
@@ -283,17 +281,16 @@ ShaderAPITest::test_uniform_size_type1(const char *glslType, GLenum glType, cons
glGetProgramiv_func(program, GL_ACTIVE_UNIFORMS, &active);
assert_no_error();
for (i = 0; i < active; i++) {
- size = -1;
- type = 0;
+ GLint size = -1;
+ GLenum type = 0;
glGetActiveUniform_func(program, i, sizeof(buffer), NULL,
&size, &type, buffer);
assert_no_error();
+ assert(type == glType);
+ assert(size == 60);
if (strncmp(buffer, "m", 1) == 0)
break;
}
- assert(i < active); /* Otherwise the compiler optimised it out */
- assert(type == glType);
- assert(size == 60);
}
@@ -333,8 +330,6 @@ ShaderAPITest::test_attrib_size_type1(const char *glslType, GLenum glType, const
char buffer[1024];
GLuint program;
GLint active, i;
- GLenum type;
- GLint size;
//printf(" Running subtest %s\n", glslType);
//fflush(stdout);
@@ -345,17 +340,17 @@ ShaderAPITest::test_attrib_size_type1(const char *glslType, GLenum glType, const
glGetProgramiv_func(program, GL_ACTIVE_ATTRIBUTES, &active);
assert_no_error();
for (i = 0; i < active; i++) {
- size = -1;
- type = -1;
+ GLint size = -1;
+ GLenum type = 0;
glGetActiveAttrib_func(program, i, sizeof(buffer), NULL,
&size, &type, buffer);
assert_no_error();
+ assert(type == glType);
+ assert(size == 1);
if (strncmp(buffer, "m", 1) == 0)
break;
}
assert(i < active); /* Otherwise the compiler optimised it out */
- assert(type == glType);
- assert(size == 1);
}