more bug fixing, error checking

This commit is contained in:
Brian
2007-03-13 16:50:24 -06:00
parent 98650bdf89
commit 52363954bf
+7 -2
View File
@@ -912,6 +912,11 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
}
}
if (count < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glUniform(count < 0)");
return;
}
switch (type) {
case GL_FLOAT:
case GL_INT:
@@ -945,13 +950,13 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
type == GL_INT_VEC2 ||
type == GL_INT_VEC3 ||
type == GL_INT_VEC4) {
const GLint *iValues = (const GLint *) values;
const GLint *iValues = ((const GLint *) values) + k * elems;
for (i = 0; i < elems; i++) {
uniformVal[i] = (GLfloat) iValues[i];
}
}
else {
const GLfloat *fValues = (const GLfloat *) values;
const GLfloat *fValues = ((const GLfloat *) values) + k * elems;
for (i = 0; i < elems; i++) {
uniformVal[i] = fValues[i];
}