mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End

I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Marek Olšák 2011-05-31 14:59:44 +02:00
parent 37a85b1830
commit d69dc2e203
2 changed files with 6 additions and 0 deletions

View File

@ -1790,6 +1790,8 @@ _mesa_UseShaderProgramEXT(GLenum type, GLuint program)
GET_CURRENT_CONTEXT(ctx);
struct gl_shader_program *shProg = NULL;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!validate_shader_target(ctx, type)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glUseShaderProgramEXT(type)");
return;

View File

@ -855,6 +855,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
struct gl_uniform *uniform;
GLint elems, offset;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!shProg || !shProg->LinkStatus) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
return;
@ -1028,6 +1030,8 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
struct gl_uniform *uniform;
GLint offset;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!shProg || !shProg->LinkStatus) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glUniformMatrix(program not linked)");