summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_program.c
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-10-01 06:25:23 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-10-03 10:33:38 -0400
commita7e997cfc5d909eebbc16ba5b0362e9778f01561 (patch)
tree63d147b3bf38ce81803c16d9f18bcc43ec36ef18 /src/mesa/state_tracker/st_cb_program.c
parent5e4309ee92560caed70ff6975c4a59aaa5d86542 (diff)
Get rid of ST_NEW_SHADER flag and the dependency on _NEW_PROGRAM
which is being hit all the time. Done by Keith really.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_program.c')
-rw-r--r--src/mesa/state_tracker/st_cb_program.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 8df8b263d3..1902c8d7d6 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -43,7 +43,6 @@
#include "st_program.h"
#include "st_atom_shader.h"
-#include "tnl/tnl.h"
#include "pipe/tgsi/mesa/tgsi_mesa.h"
@@ -57,7 +56,14 @@ static void st_bind_program( GLcontext *ctx,
{
struct st_context *st = st_context(ctx);
- st->dirty.st |= ST_NEW_SHADER;
+ switch (target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
+ break;
+ }
}
@@ -70,7 +76,8 @@ static void st_use_program( GLcontext *ctx,
{
struct st_context *st = st_context(ctx);
- st->dirty.st |= ST_NEW_SHADER;
+ st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
+ st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
_mesa_use_program(ctx, program);
}
@@ -114,8 +121,6 @@ static struct gl_program *st_new_program( GLcontext *ctx,
default:
return _mesa_new_program(ctx, target, id);
}
-
- st->dirty.st |= ST_NEW_SHADER;
}
@@ -175,6 +180,9 @@ static void st_program_string_notify( GLcontext *ctx,
}
stfp->param_state = stfp->Base.Base.Parameters->StateFlags;
+
+ if (st->fp == stfp)
+ st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
}
else if (target == GL_VERTEX_PROGRAM_ARB) {
struct st_vertex_program *stvp = (struct st_vertex_program *) prog;
@@ -189,12 +197,10 @@ static void st_program_string_notify( GLcontext *ctx,
stvp->param_state = stvp->Base.Base.Parameters->StateFlags;
- /* Also tell tnl about it:
- */
- _tnl_program_string(ctx, target, prog);
- }
+ if (st->vp == stvp)
+ st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
- st->dirty.st |= ST_NEW_SHADER;
+ }
}