[Mesa-dev] [PATCH] mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
Marek Olšák
maraeo at gmail.com
Tue May 31 06:23:19 PDT 2011
I couldn't find this being required by the spec.
---
src/mesa/main/shaderapi.c | 2 ++
src/mesa/main/uniforms.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 1e237a9..cbfbac8 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -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;
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 12fe7b5..715ac76 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -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)");
--
1.7.4.1
More information about the mesa-dev
mailing list