summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/arbprogram.c10
-rw-r--r--src/mesa/main/nvprogram.c9
-rw-r--r--src/mesa/main/program.c5
3 files changed, 23 insertions, 1 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 56aa615263..ab27e08677 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -56,6 +56,7 @@ _mesa_EnableVertexAttribArrayARB(GLuint index)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
ctx->Array.VertexAttrib[index].Enabled = GL_TRUE;
ctx->Array._Enabled |= _NEW_ARRAY_ATTRIB(index);
ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index);
@@ -74,6 +75,7 @@ _mesa_DisableVertexAttribArrayARB(GLuint index)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
ctx->Array.VertexAttrib[index].Enabled = GL_FALSE;
ctx->Array._Enabled &= ~_NEW_ARRAY_ATTRIB(index);
ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index);
@@ -189,6 +191,8 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
struct vertex_program *prog = ctx->VertexProgram.Current;
@@ -241,6 +245,8 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
if (index >= ctx->Const.MaxFragmentProgramEnvParams) {
@@ -296,6 +302,8 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
{
GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
if (!ctx->_CurrentProgram)
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -333,6 +341,8 @@ _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index,
struct program *prog;
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
if ((target == GL_FRAGMENT_PROGRAM_NV
&& ctx->Extensions.NV_fragment_program) ||
(target == GL_FRAGMENT_PROGRAM_ARB
diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index d982d3d261..d32cb7f2b5 100644
--- a/src/mesa/main/nvprogram.c
+++ b/src/mesa/main/nvprogram.c
@@ -69,6 +69,8 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
vprog = (struct vertex_program *)
_mesa_HashLookup(ctx->Shared->Programs, id);
@@ -514,6 +516,8 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
return;
}
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (prog && prog->Target != 0 && prog->Target != target) {
@@ -599,6 +603,7 @@ _mesa_ProgramParameter4fNV(GLenum target, GLuint index,
if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) {
if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) {
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w);
}
else {
@@ -700,6 +705,8 @@ _mesa_TrackMatrixNV(GLenum target, GLuint address,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) {
if (address & 0x3) {
/* addr must be multiple of four */
@@ -762,6 +769,8 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glProgramNamedParameterNV");
diff --git a/src/mesa/main/program.c b/src/mesa/main/program.c
index 83bbb20492..aca9be979d 100644
--- a/src/mesa/main/program.c
+++ b/src/mesa/main/program.c
@@ -798,6 +798,9 @@ _mesa_BindProgram(GLenum target, GLuint id)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
+ /* texture state is dependent on current fragment and vertex programs */
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_TEXTURE);
+
if ((target == GL_VERTEX_PROGRAM_NV
&& ctx->Extensions.NV_vertex_program) ||
(target == GL_VERTEX_PROGRAM_ARB
@@ -899,7 +902,7 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids)
{
GLint i;
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (n < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glDeleteProgramsNV" );