OSDN Git Service

added FLUSH_VERTICES() in _mesa_use_program()
authorBrian <brian@yutani.localnet.net>
Sat, 3 Feb 2007 18:35:02 +0000 (11:35 -0700)
committerBrian <brian@yutani.localnet.net>
Sat, 3 Feb 2007 18:35:02 +0000 (11:35 -0700)
src/mesa/shader/shader_api.c

index 1914adb..8429600 100644 (file)
@@ -842,6 +842,14 @@ _mesa_link_program(GLcontext *ctx, GLuint program)
 void
 _mesa_use_program(GLcontext *ctx, GLuint program)
 {
+   if (ctx->Shader.CurrentProgram &&
+       ctx->Shader.CurrentProgram->Name == program) {
+      /* no-op */
+      return;
+   }
+
+   FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
    /* unbind old */
    if (ctx->Shader.CurrentProgram) {
       ctx->Shader.CurrentProgram->RefCount--;