summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-02-03 11:35:02 -0700
committerBrian <[email protected]>2007-02-03 11:35:02 -0700
commit00d63aafc6d938f13acc9b136ff210fb0bbb15f9 (patch)
tree5b3191c0f5749e7fe978c24f9d3fc13eadfba405 /src/mesa/shader/shader_api.c
parent8e0c6fc0be503bc13a2817c7a86c83d1e67e72b0 (diff)
added FLUSH_VERTICES() in _mesa_use_program()
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 1914adb54ca..842960099ea 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -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--;