const struct st_tracked_state st_update_clip;
const struct st_tracked_state st_update_clear_color;
const struct st_tracked_state st_update_depth;
+const struct st_tracked_state st_update_tnl;
const struct st_tracked_state st_update_fs;
const struct st_tracked_state st_update_vs;
const struct st_tracked_state st_update_setup;
/**************************************************************************
*
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
/*
* Authors:
* Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
*/
#include "shader/prog_parameter.h"
+#include "tnl/t_vp_build.h"
#include "pipe/p_context.h"
#include "pipe/tgsi/mesa/mesa_to_tgsi.h"
#include "st_atom.h"
#include "st_program.h"
+
#define TGSI_DEBUG 0
static void compile_vs( struct st_context *st,
struct st_vertex_program *vp = NULL;
struct gl_program_parameter_list *params = NULL;
+#if 0
if (st->ctx->VertexProgram._MaintainTnlProgram)
_tnl_UpdateFixedFunctionProgram( st->ctx );
+#endif
if (st->ctx->Shader.CurrentProgram &&
st->ctx->Shader.CurrentProgram->LinkStatus &&
if (vp && params) {
/* load program's constants array */
+ /* XXX this should probably be done elsewhere/separately */
_mesa_load_state_parameters(st->ctx, params);
vp->constants.nr_constants = params->NumParameters;
},
.update = update_vs
};
+
+
+
+
+
+/**
+ * When TnL state has changed, need to generate new vertex program.
+ * This should be done before updating the vertes shader (vs) state.
+ */
+static void update_tnl( struct st_context *st )
+{
+ if (st->ctx->VertexProgram._MaintainTnlProgram)
+ _tnl_UpdateFixedFunctionProgram( st->ctx );
+}
+
+
+const struct st_tracked_state st_update_tnl = {
+ .dirty = {
+ .mesa = _NEW_PROGRAM | _NEW_LIGHT | _NEW_TEXTURE, /* XXX more? */
+ .st = ST_NEW_MESA, /* XXX correct? */
+ },
+ .update = update_tnl
+};