diff options
author | Brian Paul <[email protected]> | 2008-07-21 13:58:50 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-07-21 13:58:50 -0600 |
commit | fbf26e109b1e96aa4eeca018198ff0b5a71e557b (patch) | |
tree | 620c8b88f5ac24896447c4fcbfd8f98f17aa2bbc /src/mesa/shader/prog_parameter.c | |
parent | d8cbac5330cfcdf66c9448ee339975869097a262 (diff) |
mesa: assorted glsl uniform/attribute fixes
Fix incorrect uniform/attribute size query results.
Add missing error checking for glUniform, glUniformMatrix params
Fix an array size/allocation error.
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index be696385aaf..d87e8f6e15f 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -62,29 +62,6 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) } -static GLint -_mesa_fit_type_in_vec4(GLenum type) -{ - switch (type) { - case GL_FLOAT: - case GL_INT: - return 4; - break; - case GL_FLOAT_VEC2: - case GL_INT_VEC2: - return 2; - break; - case GL_FLOAT_VEC3: - case GL_INT_VEC3: - return 1; - break; - case GL_FLOAT_VEC4: - case GL_INT_VEC4: - default: - return 1; - } -} - /** * Add a new parameter to a parameter list. * Note that parameter values are usually 4-element GLfloat vectors. @@ -294,7 +271,7 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList, } else { i = _mesa_add_parameter(paramList, PROGRAM_UNIFORM, name, - size * _mesa_fit_type_in_vec4(datatype), datatype, NULL, NULL); + size, datatype, NULL, NULL); return i; } } @@ -363,7 +340,7 @@ _mesa_add_varying(struct gl_program_parameter_list *paramList, */ GLint _mesa_add_attribute(struct gl_program_parameter_list *paramList, - const char *name, GLint size, GLint attrib) + const char *name, GLint size, GLenum datatype, GLint attrib) { GLint i = _mesa_lookup_parameter_index(paramList, -1, name); if (i >= 0) { @@ -379,7 +356,7 @@ _mesa_add_attribute(struct gl_program_parameter_list *paramList, if (size < 0) size = 4; i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name, - size, GL_NONE, NULL, state); + size, datatype, NULL, state); } return i; } |