summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-10-09 11:00:32 +0200
committerIan Romanick <[email protected]>2014-11-10 04:25:39 -0800
commit5b9cf337b451a1229a3abc30aeb9c15393c8462c (patch)
tree47e80c163f347d9cdefd2c28b29d92ac47074684 /src
parentd388d8576f004cbc6e659ab7e7b0e9af938f7068 (diff)
mesa/main: Pass the data that _mesa_uniform actually wants
The GL_ enums were previously used because glsl_types.h couldn't be used in C code. That was fixed some time ago (and uniforms.c already includes glsl_types.h), so this is no longer necessary. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/uniform_query.cpp73
-rw-r--r--src/mesa/main/uniforms.c96
-rw-r--r--src/mesa/main/uniforms.h4
3 files changed, 54 insertions, 119 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index fcb14c4e2df..77217cbee5c 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -583,12 +583,12 @@ _mesa_propagate_uniforms_to_driver_storage(struct gl_uniform_storage *uni,
extern "C" void
_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
GLint location, GLsizei count,
- const GLvoid *values, GLenum type)
+ const GLvoid *values,
+ enum glsl_base_type basicType,
+ unsigned src_components)
{
unsigned offset;
unsigned components;
- unsigned src_components;
- enum glsl_base_type basicType;
struct gl_uniform_storage *const uni =
validate_uniform_parameters(ctx, shProg, location, count,
@@ -598,73 +598,6 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
/* Verify that the types are compatible.
*/
- switch (type) {
- case GL_FLOAT:
- basicType = GLSL_TYPE_FLOAT;
- src_components = 1;
- break;
- case GL_FLOAT_VEC2:
- basicType = GLSL_TYPE_FLOAT;
- src_components = 2;
- break;
- case GL_FLOAT_VEC3:
- basicType = GLSL_TYPE_FLOAT;
- src_components = 3;
- break;
- case GL_FLOAT_VEC4:
- basicType = GLSL_TYPE_FLOAT;
- src_components = 4;
- break;
- case GL_UNSIGNED_INT:
- basicType = GLSL_TYPE_UINT;
- src_components = 1;
- break;
- case GL_UNSIGNED_INT_VEC2:
- basicType = GLSL_TYPE_UINT;
- src_components = 2;
- break;
- case GL_UNSIGNED_INT_VEC3:
- basicType = GLSL_TYPE_UINT;
- src_components = 3;
- break;
- case GL_UNSIGNED_INT_VEC4:
- basicType = GLSL_TYPE_UINT;
- src_components = 4;
- break;
- case GL_INT:
- basicType = GLSL_TYPE_INT;
- src_components = 1;
- break;
- case GL_INT_VEC2:
- basicType = GLSL_TYPE_INT;
- src_components = 2;
- break;
- case GL_INT_VEC3:
- basicType = GLSL_TYPE_INT;
- src_components = 3;
- break;
- case GL_INT_VEC4:
- basicType = GLSL_TYPE_INT;
- src_components = 4;
- break;
- case GL_BOOL:
- case GL_BOOL_VEC2:
- case GL_BOOL_VEC3:
- case GL_BOOL_VEC4:
- case GL_FLOAT_MAT2:
- case GL_FLOAT_MAT2x3:
- case GL_FLOAT_MAT2x4:
- case GL_FLOAT_MAT3x2:
- case GL_FLOAT_MAT3:
- case GL_FLOAT_MAT3x4:
- case GL_FLOAT_MAT4x2:
- case GL_FLOAT_MAT4x3:
- case GL_FLOAT_MAT4:
- default:
- _mesa_problem(NULL, "Invalid type in %s", __func__);
- return;
- }
-
if (uni->type->is_sampler()) {
components = 1;
} else {
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index c30710772c7..f7d5e89d956 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -151,7 +151,7 @@ void GLAPIENTRY
_mesa_Uniform1f(GLint location, GLfloat v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_FLOAT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GLSL_TYPE_FLOAT, 1);
}
void GLAPIENTRY
@@ -161,7 +161,7 @@ _mesa_Uniform2f(GLint location, GLfloat v0, GLfloat v1)
GLfloat v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_FLOAT, 2);
}
void GLAPIENTRY
@@ -172,7 +172,7 @@ _mesa_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_FLOAT, 3);
}
void GLAPIENTRY
@@ -185,14 +185,14 @@ _mesa_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_FLOAT, 4);
}
void GLAPIENTRY
_mesa_Uniform1i(GLint location, GLint v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GLSL_TYPE_INT, 1);
}
void GLAPIENTRY
@@ -202,7 +202,7 @@ _mesa_Uniform2i(GLint location, GLint v0, GLint v1)
GLint v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_INT, 2);
}
void GLAPIENTRY
@@ -213,7 +213,7 @@ _mesa_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_INT, 3);
}
void GLAPIENTRY
@@ -225,63 +225,63 @@ _mesa_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_INT, 4);
}
void GLAPIENTRY
_mesa_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_FLOAT, 1);
}
void GLAPIENTRY
_mesa_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_FLOAT, 2);
}
void GLAPIENTRY
_mesa_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_FLOAT, 3);
}
void GLAPIENTRY
_mesa_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_FLOAT, 4);
}
void GLAPIENTRY
_mesa_Uniform1iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_INT, 1);
}
void GLAPIENTRY
_mesa_Uniform2iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_INT, 2);
}
void GLAPIENTRY
_mesa_Uniform3iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_INT, 3);
}
void GLAPIENTRY
_mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_INT, 4);
}
/** Same as above with direct state access **/
@@ -292,7 +292,7 @@ _mesa_ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1f");
- _mesa_uniform(ctx, shProg, location, 1, &v0, GL_FLOAT);
+ _mesa_uniform(ctx, shProg, location, 1, &v0, GLSL_TYPE_FLOAT, 1);
}
void GLAPIENTRY
@@ -304,7 +304,7 @@ _mesa_ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
v[0] = v0;
v[1] = v1;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2f");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_FLOAT, 2);
}
void GLAPIENTRY
@@ -318,7 +318,7 @@ _mesa_ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
v[1] = v1;
v[2] = v2;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3f");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_FLOAT, 3);
}
void GLAPIENTRY
@@ -333,7 +333,7 @@ _mesa_ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
v[2] = v2;
v[3] = v3;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4f");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_FLOAT, 4);
}
void GLAPIENTRY
@@ -343,7 +343,7 @@ _mesa_ProgramUniform1i(GLuint program, GLint location, GLint v0)
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1i");
- _mesa_uniform(ctx, shProg, location, 1, &v0, GL_INT);
+ _mesa_uniform(ctx, shProg, location, 1, &v0, GLSL_TYPE_INT, 1);
}
void GLAPIENTRY
@@ -355,7 +355,7 @@ _mesa_ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
v[0] = v0;
v[1] = v1;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2i");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC2);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_INT, 2);
}
void GLAPIENTRY
@@ -369,7 +369,7 @@ _mesa_ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1,
v[1] = v1;
v[2] = v2;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3i");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC3);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_INT, 3);
}
void GLAPIENTRY
@@ -384,7 +384,7 @@ _mesa_ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1,
v[2] = v2;
v[3] = v3;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4i");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC4);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_INT, 4);
}
void GLAPIENTRY
@@ -395,7 +395,7 @@ _mesa_ProgramUniform1fv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1fv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_FLOAT, 1);
}
void GLAPIENTRY
@@ -406,7 +406,7 @@ _mesa_ProgramUniform2fv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform2fv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC2);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_FLOAT, 2);
}
void GLAPIENTRY
@@ -417,7 +417,7 @@ _mesa_ProgramUniform3fv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform3fv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC3);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_FLOAT, 3);
}
void GLAPIENTRY
@@ -428,7 +428,7 @@ _mesa_ProgramUniform4fv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform4fv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC4);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_FLOAT, 4);
}
void GLAPIENTRY
@@ -439,7 +439,7 @@ _mesa_ProgramUniform1iv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1iv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_INT);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_INT, 1);
}
void GLAPIENTRY
@@ -450,7 +450,7 @@ _mesa_ProgramUniform2iv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform2iv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC2);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_INT, 2);
}
void GLAPIENTRY
@@ -461,7 +461,7 @@ _mesa_ProgramUniform3iv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform3iv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC3);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_INT, 3);
}
void GLAPIENTRY
@@ -472,7 +472,7 @@ _mesa_ProgramUniform4iv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform4iv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC4);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_INT, 4);
}
@@ -481,7 +481,7 @@ void GLAPIENTRY
_mesa_Uniform1ui(GLint location, GLuint v0)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GLSL_TYPE_UINT, 1);
}
void GLAPIENTRY
@@ -491,7 +491,7 @@ _mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1)
GLuint v[2];
v[0] = v0;
v[1] = v1;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_UINT, 2);
}
void GLAPIENTRY
@@ -502,7 +502,7 @@ _mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
v[0] = v0;
v[1] = v1;
v[2] = v2;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_UINT, 3);
}
void GLAPIENTRY
@@ -514,35 +514,35 @@ _mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
v[1] = v1;
v[2] = v2;
v[3] = v3;
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GLSL_TYPE_UINT, 4);
}
void GLAPIENTRY
_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_UINT, 1);
}
void GLAPIENTRY
_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_UINT, 2);
}
void GLAPIENTRY
_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_UINT, 3);
}
void GLAPIENTRY
_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GLSL_TYPE_UINT, 4);
}
@@ -583,7 +583,7 @@ _mesa_ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1ui");
- _mesa_uniform(ctx, shProg, location, 1, &v0, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, shProg, location, 1, &v0, GLSL_TYPE_UINT, 1);
}
void GLAPIENTRY
@@ -596,7 +596,7 @@ _mesa_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
v[1] = v1;
shProg = _mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform2ui");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_UINT, 2);
}
void GLAPIENTRY
@@ -611,7 +611,7 @@ _mesa_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1,
v[2] = v2;
shProg = _mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform3ui");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_UINT, 3);
}
void GLAPIENTRY
@@ -626,7 +626,7 @@ _mesa_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1,
v[2] = v2;
v[3] = v3;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4ui");
- _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, shProg, location, 1, v, GLSL_TYPE_UINT, 4);
}
void GLAPIENTRY
@@ -637,7 +637,7 @@ _mesa_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform1uiv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_UINT, 1);
}
void GLAPIENTRY
@@ -648,7 +648,7 @@ _mesa_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform2uiv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC2);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_UINT, 2);
}
void GLAPIENTRY
@@ -659,7 +659,7 @@ _mesa_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform3uiv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC3);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_UINT, 3);
}
void GLAPIENTRY
@@ -670,7 +670,7 @@ _mesa_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform4uiv");
- _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC4);
+ _mesa_uniform(ctx, shProg, location, count, value, GLSL_TYPE_UINT, 4);
}
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index 6575a52f4a5..0a9ee7de92c 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -265,7 +265,9 @@ _mesa_get_uniform_location(struct gl_shader_program *shProg,
void
_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shader_program,
GLint location, GLsizei count,
- const GLvoid *values, GLenum type);
+ const GLvoid *values,
+ enum glsl_base_type basicType,
+ unsigned src_components);
void
_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,