summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_program.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-06 20:53:28 +0100
committerBrian <brian.paul@tungstengraphics.com>2007-08-06 20:53:28 +0100
commit6da9234fd437f97267e7831f034c78b31156d939 (patch)
treea272c747c910a58cb2a74ca7fbdae059af2437d1 /src/mesa/state_tracker/st_cb_program.c
parent8ebf91d15eeb6f19d19580f6319477aaad4df3fd (diff)
New st_init_*_functions() to initialize the driver functions table.
We need to do these initializations before initializing the Mesa context because context init involves creating texture/program/etc objects.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_program.c')
-rw-r--r--src/mesa/state_tracker/st_cb_program.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 6da2aeb2f2..ed47c12066 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -32,7 +32,6 @@
#include "st_context.h"
#include "st_program.h"
-
#include "glheader.h"
#include "macros.h"
#include "enums.h"
@@ -44,6 +43,11 @@
#include "pipe/tgsi/mesa/tgsi_mesa.h"
+/* Counter to track program string changes:
+ */
+static GLuint program_id = 0;
+
+
static void st_bind_program( GLcontext *ctx,
GLenum target,
struct gl_program *prog )
@@ -70,7 +74,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
case GL_VERTEX_PROGRAM_ARB: {
struct st_vertex_program *prog = CALLOC_STRUCT(st_vertex_program);
- prog->id = st->program_id++;
+ prog->id = program_id++;
prog->dirty = 1;
return _mesa_init_vertex_program( ctx,
@@ -84,7 +88,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
{
struct st_fragment_program *prog = CALLOC_STRUCT(st_fragment_program);
- prog->id = st->program_id++;
+ prog->id = program_id++;
prog->dirty = 1;
return _mesa_init_fragment_program( ctx,
@@ -124,7 +128,7 @@ static void st_program_string_notify( GLcontext *ctx,
if (prog == &ctx->FragmentProgram._Current->Base)
st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
- p->id = st->program_id++;
+ p->id = program_id++;
p->param_state = p->Base.Base.Parameters->StateFlags;
}
else if (target == GL_VERTEX_PROGRAM_ARB) {
@@ -133,7 +137,7 @@ static void st_program_string_notify( GLcontext *ctx,
if (prog == &ctx->VertexProgram._Current->Base)
st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
- p->id = st->program_id++;
+ p->id = program_id++;
p->param_state = p->Base.Base.Parameters->StateFlags;
/* Also tell tnl about it:
@@ -144,15 +148,8 @@ static void st_program_string_notify( GLcontext *ctx,
-void st_init_cb_program( struct st_context *st )
+void st_init_program_functions(struct dd_function_table *functions)
{
- struct dd_function_table *functions = &st->ctx->Driver;
-
- /* Need these flags:
- */
- st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- st->ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
-
#if 0
assert(functions->ProgramStringNotify == _tnl_program_string);
#endif
@@ -162,9 +159,3 @@ void st_init_cb_program( struct st_context *st )
functions->IsProgramNative = st_is_program_native;
functions->ProgramStringNotify = st_program_string_notify;
}
-
-
-void st_destroy_cb_program( struct st_context *st )
-{
-}
-