This is a step toward removing TGSI_ATTRIB_ tokens.
Basically, when translating Mesa programs to TGSI programs, pass in input and
output register re-maps, plus interpolation info.
There's some known breakage (cubemap.c) so more to be done...
}
}
+
+/**
+ * Fetch vertex attributes for 'count' vertices.
+ */
void draw_vertex_fetch( struct draw_context *draw,
struct tgsi_exec_machine *machine,
const unsigned *elts,
{
unsigned j;
-
- /* load machine inputs */
+ /* loop over vertices */
for (j = 0; j < count; j++) {
- unsigned attr;
- for (attr = 0; attr < 16; attr++) {
- if (draw->vertex_shader.inputs_read & (1 << attr)) {
- unsigned buf = draw->vertex_element[attr].vertex_buffer_index;
- const void *src
- = (const void *) ((const ubyte *) draw->mapped_vbuffer[buf]
- + draw->vertex_buffer[buf].buffer_offset
- + draw->vertex_element[attr].src_offset
- + elts[j] * draw->vertex_buffer[buf].pitch);
- float p[4];
+ uint attr;
+ /* loop over vertex attributes (vertex shader inputs) */
+ for (attr = 0; attr < draw->vertex_shader.num_inputs; attr++) {
+
+ unsigned buf = draw->vertex_element[attr].vertex_buffer_index;
+ const void *src
+ = (const void *) ((const ubyte *) draw->mapped_vbuffer[buf]
+ + draw->vertex_buffer[buf].buffer_offset
+ + draw->vertex_element[attr].src_offset
+ + elts[j] * draw->vertex_buffer[buf].pitch);
+ float p[4];
- fetch_attrib4(src, draw->vertex_element[attr].src_format, p);
+ fetch_attrib4(src, draw->vertex_element[attr].src_format, p);
- machine->Inputs[attr].xyzw[0].f[j] = p[0]; /*X*/
- machine->Inputs[attr].xyzw[1].f[j] = p[1]; /*Y*/
- machine->Inputs[attr].xyzw[2].f[j] = p[2]; /*Z*/
- machine->Inputs[attr].xyzw[3].f[j] = p[3]; /*W*/
- }
+ machine->Inputs[attr].xyzw[0].f[j] = p[0]; /*X*/
+ machine->Inputs[attr].xyzw[1].f[j] = p[1]; /*Y*/
+ machine->Inputs[attr].xyzw[2].f[j] = p[2]; /*Z*/
+ machine->Inputs[attr].xyzw[3].f[j] = p[3]; /*W*/
}
}
}
draw_vertex_fetch( draw, &machine, elts, count );
-
/* run shader */
if( draw->vertex_shader.executable != NULL ) {
#if defined(USE_X86_ASM) || defined(SLANG_X86)
vOut[j]->data[0][2] = z * scale[2] + trans[2];
vOut[j]->data[0][3] = w;
- /* remaining attributes are packed into sequential post-transform
+ /* Remaining attributes are packed into sequential post-transform
* vertex attrib slots.
+ * Skip 0 since we just did it above.
+ * Subtract two because of the VERTEX_HEADER, CLIP_POS attribs.
*/
- for (slot = 1; slot < draw->vertex_info.num_attribs; slot++) {
+ for (slot = 1; slot < draw->vertex_info.num_attribs - 2; slot++) {
vOut[j]->data[slot][0] = machine.Outputs[slot].xyzw[0].f[j];
vOut[j]->data[slot][1] = machine.Outputs[slot].xyzw[1].f[j];
vOut[j]->data[slot][2] = machine.Outputs[slot].xyzw[2].f[j];
vOut[j]->data[slot][3] = machine.Outputs[slot].xyzw[3].f[j];
+ /*
+ printf("output %d: %f %f %f %f\n", slot,
+ vOut[j]->data[slot][0],
+ vOut[j]->data[slot][1],
+ vOut[j]->data[slot][2],
+ vOut[j]->data[slot][3]);
+ */
}
} /* loop over vertices */
}
unsigned outputs_written; /**< TGSI_ATTRIB_ bits */
const struct tgsi_token *tokens;
void *executable;
+
+ uint num_inputs;
+ uint num_outputs;
};
struct pipe_depth_stencil_state
float a = setup->ebot.dy * majda - botda * setup->emaj.dy;
float b = setup->emaj.dx * botda - majda * setup->ebot.dx;
+ /*
+ printf("tri persp %d,%d: %f %f %f\n", slot, i,
+ setup->vmin->data[slot][i],
+ setup->vmid->data[slot][i],
+ setup->vmax->data[slot][i]
+ );
+ */
+
assert(slot < TGSI_ATTRIB_MAX);
assert(i <= 3);
}\r
\r
\r
+#if 01\r
uint\r
tgsi_mesa_translate_vertex_input_mask(GLbitfield mask)\r
{\r
}\r
return tgsiMask;\r
}\r
-\r
+#endif\r
\r
uint\r
tgsi_mesa_translate_vertex_output_mask(GLbitfield mask)\r
GLuint processor,\r
GLuint file,\r
GLuint index,\r
- GLbitfield usage_bitmask )\r
+ GLbitfield usage_bitmask,\r
+ const GLuint inputMapping[],\r
+ const GLuint outputMapping[])\r
{\r
GLuint mapped_index;\r
GLuint i;\r
* etc.\r
*/\r
assert( index < 32 );\r
+ if (inputMapping) {\r
+ printf("New map %d input %d to %d\n", processor, index,\r
+ inputMapping[index]);\r
+ return inputMapping[index];\r
+ }\r
+\r
assert( usage_bitmask & (1 << index) );\r
mapped_index = 0;\r
for( i = 0; i < index; i++ ) {\r
mapped_index++;\r
}\r
}\r
- printf("Map input %d to %d\n", index, mapped_index);\r
+ printf("Map %d input %d to %d\n", processor, index, mapped_index);\r
break;\r
\r
case TGSI_FILE_OUTPUT:\r
mapped_index++;\r
}\r
}\r
+ printf("Map VP output from %d to %d\n", index, mapped_index);\r
+ assert(outputMapping[index] == mapped_index);\r
}\r
break;\r
\r
struct tgsi_full_instruction *fullinst,\r
GLuint inputs_read,\r
GLuint outputs_written,\r
+ const GLuint inputMapping[],\r
+ const GLuint outputMapping[],\r
GLuint preamble_size,\r
GLuint processor )\r
{\r
processor,\r
fulldst->DstRegister.File,\r
inst->DstReg.Index,\r
- outputs_written\r
+ outputs_written,\r
+ NULL,\r
+ outputMapping\r
);\r
fulldst->DstRegister.WriteMask = convert_writemask( inst->DstReg.WriteMask );\r
\r
processor,\r
fullsrc->SrcRegister.File,\r
inst->SrcReg[i].Index,\r
- inputs_read );\r
+ inputs_read,\r
+ inputMapping,\r
+ outputMapping );\r
\r
for( j = 0; j < 4; j++ ) {\r
GLuint swz;\r
return decl;\r
}\r
\r
+\r
+/**\r
+ * Convert Mesa fragment program to TGSI format.\r
+ * \param inputMapping array to map original Mesa fragment program inputs\r
+ * registers to TGSI generic input indexes\r
+ * \param interpMode array[FRAG_ATTRIB_x] of TGSI_INTERPOLATE_LINEAR/PERSP.\r
+ *\r
+ */\r
GLboolean\r
tgsi_mesa_compile_fp_program(\r
const struct gl_fragment_program *program,\r
+ const GLuint inputMapping[],\r
+ const GLuint interpMode[],\r
+ const GLuint outputMapping[],\r
struct tgsi_token *tokens,\r
GLuint maxTokens )\r
{\r
struct tgsi_processor *processor;\r
struct tgsi_full_declaration fulldecl;\r
struct tgsi_full_instruction fullinst;\r
+ /*\r
struct tgsi_full_dst_register *fulldst;\r
struct tgsi_full_src_register *fullsrc;\r
+ */\r
GLuint inputs_read;\r
GLboolean reads_wpos;\r
GLuint preamble_size = 0;\r
/*\r
* Declare input attributes. Note that we do not interpolate fragment position.\r
*/\r
-\r
+ reads_wpos = 1;\r
/* Fragment position. */\r
if( reads_wpos ) {\r
fulldecl = make_frag_input_decl(\r
for( i = 1; i < 32; i++ ) {\r
if( inputs_read & (1 << i) ) {\r
count++;\r
+ fulldecl = make_frag_input_decl(count,\r
+ count,\r
+ interpMode[i],\r
+ TGSI_WRITEMASK_XYZW );\r
+ ti += tgsi_build_full_declaration(&fulldecl,\r
+ &tokens[ti],\r
+ header,\r
+ maxTokens - ti );\r
}\r
- }\r
- if( count > 0 ) {\r
- fulldecl = make_frag_input_decl(\r
- 1,\r
- 1 + count - 1,\r
- TGSI_INTERPOLATE_PERSPECTIVE,\r
- TGSI_WRITEMASK_XYZW );\r
- ti += tgsi_build_full_declaration(\r
- &fulldecl,\r
- &tokens[ti],\r
- header,\r
- maxTokens - ti );\r
- }\r
+ } \r
\r
/*\r
* Declare output attributes.\r
&fullinst,\r
inputs_read,\r
~0, /*outputs_written*/\r
+ inputMapping,\r
+ outputMapping,\r
preamble_size,\r
TGSI_PROCESSOR_FRAGMENT ) ) {\r
assert( i == program->Base.NumInstructions - 1 );\r
GLboolean\r
tgsi_mesa_compile_vp_program(\r
const struct gl_vertex_program *program,\r
+ const GLuint inputMapping[],\r
+ const GLuint outputMapping[],\r
struct tgsi_token *tokens,\r
- GLuint maxTokens )\r
+ GLuint maxTokens)\r
{\r
GLuint i, ti;\r
struct tgsi_header *header;\r
&fullinst,\r
inputs_read,\r
outputs_written,\r
+ inputMapping,\r
+ outputMapping,\r
0,\r
TGSI_PROCESSOR_VERTEX ) ) {\r
assert( i == program->Base.NumInstructions - 1 );\r
GLboolean\r
tgsi_mesa_compile_fp_program(\r
const struct gl_fragment_program *program,\r
+ const GLuint inputMapping[],\r
+ const GLuint interpMode[],\r
+ const GLuint outputMapping[],\r
struct tgsi_token *tokens,\r
GLuint maxTokens );\r
\r
GLboolean\r
tgsi_mesa_compile_vp_program(\r
const struct gl_vertex_program *program,\r
+ const GLuint inputMapping[],\r
+ const GLuint outputMapping[],\r
struct tgsi_token *tokens,\r
GLuint maxTokens );\r
\r
#include "st_atom.h"
#include "st_program.h"
-#define TGSI_DEBUG 0
+#define TGSI_DEBUG 1
static void compile_fs( struct st_context *st )
{
+ /* Map FRAG_RESULT_COLR to output 1, map FRAG_RESULT_DEPR to output 0 */
+ static const GLuint outputMapping[2] = {1, 0};
struct st_fragment_program *fp = st->fp;
struct pipe_shader_state fs;
struct pipe_shader_state *cached;
+ GLuint interpMode[16]; /* XXX size? */
+ GLuint i;
+
+ for (i = 0; i < 16; i++) {
+ if (fp->Base.Base.InputsRead & (1 << i)) {
+ if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1) {
+ interpMode[i] = TGSI_INTERPOLATE_LINEAR;
+ }
+ else {
+ interpMode[i] = TGSI_INTERPOLATE_PERSPECTIVE;
+ }
+ }
+ }
/* XXX: fix static allocation of tokens:
*/
- tgsi_mesa_compile_fp_program( &fp->Base, fp->tokens, ST_FP_MAX_TOKENS );
+ tgsi_mesa_compile_fp_program( &fp->Base, NULL, interpMode,
+ outputMapping,
+ fp->tokens, ST_FP_MAX_TOKENS );
memset(&fs, 0, sizeof(fs));
fs.inputs_read
fp->fsx = cached;
if (TGSI_DEBUG)
- tgsi_dump( fp->tokens, TGSI_DUMP_VERBOSE );
+ tgsi_dump( fp->tokens, 0/*TGSI_DUMP_VERBOSE*/ );
fp->dirty = 0;
}
-/* translate shader to TGSI format
-*/
+/**
+ * Translate Mesa shader to TGSI format
+ */
static void compile_vs( struct st_context *st )
{
struct st_vertex_program *vp = st->vp;
struct pipe_shader_state vs;
struct pipe_shader_state *cached;
+ GLuint i;
+
+ memset(&vs, 0, sizeof(vs));
+
+ /*
+ * Determine how many inputs there are.
+ * Also, compute two look-up tables that map between Mesa VERT_ATTRIB_x
+ * values and TGSI generic input indexes.
+ */
+ for (i = 0; i < MAX_VERTEX_PROGRAM_ATTRIBS; i++) {
+ if (vp->Base.Base.InputsRead & (1 << i)) {
+ vp->input_to_index[i] = vs.num_inputs;
+ vp->index_to_input[vs.num_inputs] = i;
+ vs.num_inputs++;
+ }
+ }
+
+ /*
+ * Determine output register mapping.
+ */
+ for (i = 0; i < VERT_RESULT_MAX; i++) {
+ if (vp->Base.Base.OutputsWritten & (1 << i)) {
+ vp->output_to_index[i] = vs.num_outputs;
+ vp->index_to_output[vs.num_outputs] = i;
+ vs.num_outputs++;
+ }
+ }
+
+
/* XXX: fix static allocation of tokens:
*/
- tgsi_mesa_compile_vp_program( &vp->Base, vp->tokens, ST_FP_MAX_TOKENS );
+ tgsi_mesa_compile_vp_program( &vp->Base,
+ vp->input_to_index,
+ vp->output_to_index,
+ vp->tokens, ST_FP_MAX_TOKENS );
- memset(&vs, 0, sizeof(vs));
+#if 01
vs.inputs_read
= tgsi_mesa_translate_vertex_input_mask(vp->Base.Base.InputsRead);
+#endif
vs.outputs_written
= tgsi_mesa_translate_vertex_output_mask(vp->Base.Base.OutputsWritten);
+
vs.tokens = &vp->tokens[0];
cached = st_cached_shader_state(st, &vs);
+
vp->vs = cached;
if (TGSI_DEBUG)
const struct st_tracked_state st_update_vs = {
.name = "st_update_vs",
.dirty = {
- .mesa = 0,
+ .mesa = _NEW_PROGRAM,
.st = ST_NEW_VERTEX_PROGRAM,
},
.update = update_vs
* Create a simple fragment shader that just passes through the fragment color.
*/
static struct st_fragment_program *
-make_color_shader(struct st_context *st)
+make_frag_shader(struct st_context *st)
{
+ static const GLuint outputMapping[] = { 1, 0 };
GLcontext *ctx = st->ctx;
struct st_fragment_program *stfp;
struct gl_program *p;
GLboolean b;
+ GLuint interpMode[16];
+ GLuint i;
+
+ /* XXX temporary */
+ for (i = 0; i < 16; i++)
+ interpMode[i] = TGSI_INTERPOLATE_LINEAR;
p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
if (!p)
stfp = (struct st_fragment_program *) p;
/* compile into tgsi format */
- b = tgsi_mesa_compile_fp_program(&stfp->Base,
+ b = tgsi_mesa_compile_fp_program(&stfp->Base, NULL, interpMode,
+ outputMapping,
stfp->tokens, ST_FP_MAX_TOKENS);
assert(b);
static struct st_vertex_program *
make_vertex_shader(struct st_context *st)
{
+ /* Map VERT_ATTRIB_POS to 0, VERT_ATTRIB_COLOR0 to 1 */
+ static const GLuint inputMapping[4] = { 0, 0, 0, 1 };
+ /* Map VERT_RESULT_HPOS to 0, VERT_RESULT_COL0 to 1 */
+ static const GLuint outputMapping[2] = { 0, 1 };
+
GLcontext *ctx = st->ctx;
struct st_vertex_program *stvp;
struct gl_program *p;
stvp = (struct st_vertex_program *) p;
/* compile into tgsi format */
b = tgsi_mesa_compile_vp_program(&stvp->Base,
+ inputMapping,
+ outputMapping,
stvp->tokens, ST_FP_MAX_TOKENS);
assert(b);
struct pipe_shader_state fs;
const struct pipe_shader_state *cached;
if (!stfp) {
- stfp = make_color_shader(st);
+ stfp = make_frag_shader(st);
}
memset(&fs, 0, sizeof(fs));
fs.inputs_read = tgsi_mesa_translate_fragment_input_mask(stfp->Base.Base.InputsRead);
static struct st_fragment_program *
make_fragment_shader(struct st_context *st)
{
+ static const GLuint outputMapping[2] = { 1, 0 };
GLcontext *ctx = st->ctx;
struct st_fragment_program *stfp;
struct gl_program *p;
GLboolean b;
+ GLuint interpMode[16];
+ GLuint i;
+
+ /* XXX temporary */
+ for (i = 0; i < 16; i++)
+ interpMode[i] = TGSI_INTERPOLATE_LINEAR;
p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
if (!p)
stfp = (struct st_fragment_program *) p;
/* compile into tgsi format */
- b = tgsi_mesa_compile_fp_program(&stfp->Base,
+ b = tgsi_mesa_compile_fp_program(&stfp->Base, NULL, interpMode,
+ outputMapping,
stfp->tokens, ST_FP_MAX_TOKENS);
assert(b);
static struct st_vertex_program *
make_vertex_shader(struct st_context *st)
{
+ /* Map VERT_RESULT_HPOS to 0, VERT_RESULT_TEX0 to 1 */
+ static const GLuint outputMapping[] = { 0, 0, 0, 0, 1 };
GLcontext *ctx = st->ctx;
struct st_vertex_program *stvp;
struct gl_program *p;
stvp = (struct st_vertex_program *) p;
/* compile into tgsi format */
- b = tgsi_mesa_compile_vp_program(&stvp->Base,
+ b = tgsi_mesa_compile_vp_program(&stvp->Base, NULL,
+ outputMapping,
stvp->tokens, ST_FP_MAX_TOKENS);
assert(b);
#include "tnl/t_vp_build.h"
-#include "st_context.h"
#include "st_atom.h"
-#include "st_draw.h"
+#include "st_context.h"
#include "st_cb_bufferobjects.h"
+#include "st_draw.h"
+#include "st_program.h"
+
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
GLuint max_index)
{
struct pipe_context *pipe = ctx->st->pipe;
- GLuint attr, i;
- GLbitfield attrsNeeded;
+ const struct st_vertex_program *vp = ctx->st->vp;
+ const struct pipe_shader_state *vs;
const unsigned attr0_offset = (unsigned) arrays[0]->Ptr;
+ GLboolean needDefaultAttribs = GL_FALSE;
+ GLuint attr;
st_validate_state(ctx->st);
- update_default_attribs_buffer(ctx);
- /* this must be after state validation */
- attrsNeeded = ctx->st->state.vs->inputs_read;
+ /* must do this after state validation! */
+ vs = ctx->st->state.vs;
+
+ /* loop over TGSI shader inputs */
+ for (attr = 0; attr < vs->num_inputs; attr++) {
+ const GLuint mesaAttr = vp->index_to_input[attr];
+ struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
- /* tell pipe about the vertex array element/attributes */
- for (attr = 0; attr < 16; attr++) {
struct pipe_vertex_buffer vbuffer;
struct pipe_vertex_element velement;
velement.vertex_buffer_index = 0;
velement.src_format = 0;
- if (attrsNeeded & (1 << attr)) {
- const GLuint mesaAttr = tgsi_attrib_to_mesa_attrib(attr);
- struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
-
- if (bufobj && bufobj->Name) {
- struct st_buffer_object *stobj = st_buffer_object(bufobj);
- /* Recall that for VBOs, the gl_client_array->Ptr field is
- * really an offset from the start of the VBO, not a pointer.
- */
- unsigned offset = (unsigned) arrays[mesaAttr]->Ptr;
-
- assert(stobj->buffer);
-
- vbuffer.buffer = stobj->buffer;
- vbuffer.buffer_offset = attr0_offset; /* in bytes */
- vbuffer.pitch = arrays[mesaAttr]->StrideB; /* in bytes */
- vbuffer.max_index = 0; /* need this? */
-
- velement.src_offset = offset - attr0_offset; /* bytes */
- velement.vertex_buffer_index = attr;
- velement.dst_offset = 0; /* need this? */
- velement.src_format = pipe_vertex_format(arrays[mesaAttr]->Type,
- arrays[mesaAttr]->Size);
- assert(velement.src_format);
- }
- else {
- /* use the default attribute buffer */
- vbuffer.buffer = ctx->st->default_attrib_buffer;
- vbuffer.buffer_offset = 0;
- vbuffer.pitch = 0; /* must be zero! */
- vbuffer.max_index = 1;
-
- velement.src_offset = attr * 4 * sizeof(GLfloat);
- velement.vertex_buffer_index = attr;
- velement.dst_offset = 0;
- velement.src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- }
+ if (bufobj && bufobj->Name) {
+ struct st_buffer_object *stobj = st_buffer_object(bufobj);
+ /* Recall that for VBOs, the gl_client_array->Ptr field is
+ * really an offset from the start of the VBO, not a pointer.
+ */
+ unsigned offset = (unsigned) arrays[mesaAttr]->Ptr;
+
+ assert(stobj->buffer);
+
+ vbuffer.buffer = stobj->buffer;
+ vbuffer.buffer_offset = attr0_offset; /* in bytes */
+ vbuffer.pitch = arrays[mesaAttr]->StrideB; /* in bytes */
+ vbuffer.max_index = 0; /* need this? */
+
+ velement.src_offset = offset - attr0_offset; /* bytes */
+ velement.vertex_buffer_index = attr;
+ velement.dst_offset = 0; /* need this? */
+ velement.src_format = pipe_vertex_format(arrays[mesaAttr]->Type,
+ arrays[mesaAttr]->Size);
+ assert(velement.src_format);
+ }
+ else {
+ /* use the default attribute buffer */
+ needDefaultAttribs = GL_TRUE;
+
+ vbuffer.buffer = ctx->st->default_attrib_buffer;
+ vbuffer.buffer_offset = 0;
+ vbuffer.pitch = 0; /* must be zero! */
+ vbuffer.max_index = 1;
+
+ velement.src_offset = mesaAttr * 4 * sizeof(GLfloat);
+ velement.vertex_buffer_index = attr;
+ velement.dst_offset = 0;
+ velement.src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
}
if (attr == 0)
pipe->set_vertex_element(pipe, attr, &velement);
}
+ if (needDefaultAttribs) {
+ update_default_attribs_buffer(ctx);
+ }
+
+
/* do actual drawing */
if (ib) {
/* indexed primitive */
struct gl_buffer_object *bufobj = ib->obj;
struct pipe_buffer_handle *bh = NULL;
- unsigned indexSize;
+ unsigned indexSize, i;
if (bufobj && bufobj->Name) {
/* elements/indexes are in a real VBO */
}
else {
/* non-indexed */
+ GLuint i;
for (i = 0; i < nr_prims; i++) {
pipe->draw_arrays(pipe, prims[i].mode, prims[i].start, prims[i].count);
}
struct st_vertex_program
{
- struct gl_vertex_program Base;
- GLboolean error; /* If program is malformed for any reason. */
+ struct gl_vertex_program Base; /**< The Mesa vertex program */
+ GLboolean error; /**< Set if program is malformed for any reason. */
- GLuint id; /* String id, for tracking
- * ProgramStringNotify changes.
- */
+ GLuint id; /**< String id, for tracking ProgramStringNotify changes. */
+
+ /** maps a Mesa VERT_ATTRIB_x to a packed TGSI input index */
+ GLuint input_to_index[MAX_VERTEX_PROGRAM_ATTRIBS];
+ /** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */
+ GLuint index_to_input[MAX_VERTEX_PROGRAM_ATTRIBS];
+
+ GLuint output_to_index[MAX_VERTEX_PROGRAM_ATTRIBS];
+ GLuint index_to_output[MAX_VERTEX_PROGRAM_ATTRIBS];
+ /** The program in TGSI format */
struct tgsi_token tokens[ST_FP_MAX_TOKENS];
GLboolean dirty;