#include "main/glheader.h"
#include "main/context.h"
-#include "main/dispatch.h"
#include "main/shaderapi.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
struct gl_program *prog)
{
GLbitfield mask = prog->SamplersUsed;
- gl_shader_stage prog_stage =
+ ASSERTED gl_shader_stage prog_stage =
_mesa_program_enum_to_shader_stage(prog->Target);
- MAYBE_UNUSED struct gl_linked_shader *shader =
- shProg->_LinkedShaders[prog_stage];
GLuint s;
- assert(shader);
+ assert(shProg->_LinkedShaders[prog_stage]);
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
shProg = _mesa_lookup_shader_program_err(ctx, programObj,
"glGetUniformLocation");
- if (!shProg)
+ if (!shProg || !name)
return -1;
/* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
* "If program has not been successfully linked, the error
* INVALID_OPERATION is generated."
*/
- if (shProg->data->LinkStatus == linking_failure) {
+ if (shProg->data->LinkStatus == LINKING_FAILURE) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetUniformLocation(program not linked)");
return -1;
return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
}
+GLint GLAPIENTRY
+_mesa_GetUniformLocation_no_error(GLuint programObj, const GLcharARB *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program(ctx, programObj);
+
+ return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
+}
+
GLuint GLAPIENTRY
_mesa_GetUniformBlockIndex(GLuint program,
const GLchar *uniformBlockName)