summaryrefslogtreecommitdiff
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 4ff032d4ec..f47f213ac8 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1517,12 +1517,14 @@ static void
_mesa_link_program(GLcontext *ctx, GLuint program)
{
struct gl_shader_program *shProg;
+ struct gl_transform_feedback_object *obj =
+ ctx->TransformFeedback.CurrentObject;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram");
if (!shProg)
return;
- if (ctx->TransformFeedback.Active && shProg == ctx->Shader.CurrentProgram) {
+ if (obj->Active && shProg == ctx->Shader.CurrentProgram) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glLinkProgram(transform feedback active");
return;
@@ -1591,8 +1593,10 @@ void
_mesa_use_program(GLcontext *ctx, GLuint program)
{
struct gl_shader_program *shProg;
+ struct gl_transform_feedback_object *obj =
+ ctx->TransformFeedback.CurrentObject;
- if (ctx->TransformFeedback.Active) {
+ if (obj->Active) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glUseProgram(transform feedback active)");
return;
@@ -1749,7 +1753,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
/* check that the sampler (tex unit index) is legal */
if (texUnit >= ctx->Const.MaxTextureImageUnits) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "glUniform1(invalid sampler/tex unit index)");
+ "glUniform1(invalid sampler/tex unit index for '%s')",
+ param->Name);
return;
}
@@ -1797,7 +1802,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
/* non-array: count must be at most one; count == 0 is handled by the loop below */
if (count > 1) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glUniform(uniform is not an array)");
+ "glUniform(uniform '%s' is not an array)",
+ param->Name);
return;
}
}
@@ -1860,14 +1866,15 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
return; /* The standard specifies this as a no-op */
if (location < -1) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location=%d)",
+ location);
return;
}
split_location_offset(&location, &offset);
if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location=%d)", location);
return;
}