summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-10-28 14:32:49 +0000
committerBrian Paul <[email protected]>2005-10-28 14:32:49 +0000
commitb5ee368baf6472a79d250f0be418200760f4b43d (patch)
tree5851de5f58d12b73c43636bf05ded26385fb8c00 /src/mesa/tnl
parentf51bf9e23c4b41ada5edeae91b31f64319534e48 (diff)
TNL module needs to implement ctx->Driver.ProgramStringNotify() function
so that calls to glProgramStringARB() to specify a new program causes the TNL-attached data to get recomputed.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c18
-rw-r--r--src/mesa/tnl/tnl.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 08b9ffc8898..8b168356770 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -43,6 +43,7 @@
#include "t_pipeline.h"
#include "t_vb_arbprogram.h"
+
#define DISASSEM 0
/*--------------------------------------------------------------------------- */
@@ -1459,3 +1460,20 @@ const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage =
validate_vertex_program, /* validate */
run_arb_vertex_program /* run */
};
+
+
+/**
+ * Called via ctx->Driver.ProgramStringNotify() after a new vertex program
+ * string has been parsed.
+ */
+void
+_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program)
+{
+ if (target == GL_VERTEX_PROGRAM_ARB) {
+ /* free any existing tnl data hanging off the program */
+ struct vertex_program *vprog = (struct vertex_program *) program;
+ if (vprog->TnlData) {
+ free_tnl_data(vprog);
+ }
+ }
+}
diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h
index d04310fb53e..428fe12788a 100644
--- a/src/mesa/tnl/tnl.h
+++ b/src/mesa/tnl/tnl.h
@@ -83,5 +83,7 @@ _tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value );
extern void
_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value );
+extern void
+_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program);
#endif