summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.h
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-09-25 14:29:11 -0600
committerBrian <[email protected]>2007-09-25 14:29:11 -0600
commit40c543eb71368c646259afb87d5c76551f6b45b7 (patch)
tree1e0c89610cc347607580fb4044e08bb0a060739e /src/mesa/state_tracker/st_context.h
parentf9ed2fdaace0d4d7f091a4423a8638945e920b0d (diff)
Translate mesa vertex/fragment programs to TGSI programs at same time to do proper linking.
Previously, programs were translated independently during validation. The problem is the translation to TGSI format, which packs shader input/outputs into continuous slots, depends on which vertex program is being paired with which fragment shader. Now, we look at the outputs of the vertex program in conjunction with the inputs of the fragment shader to be sure the attributes match up correctly. The new 'linked_program_pair' class keeps track of the associations between vertex and fragment shaders. It's also the place where the TGSI tokens are kept since they're no longer per-program state but per-linkage. Still a few loose ends, like implementing some kind of hash/lookup table for linked_program_pairs.
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r--src/mesa/state_tracker/st_context.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 3713328eb14..24f0ff9aaf3 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -45,6 +45,8 @@ struct cso_blend;
#define ST_NEW_MESA 0x1 /* Mesa state has changed */
#define ST_NEW_FRAGMENT_PROGRAM 0x2
#define ST_NEW_VERTEX_PROGRAM 0x4
+#define ST_NEW_LINKAGE 0x8
+
struct st_state_flags {
GLuint mesa;
@@ -119,8 +121,8 @@ struct st_context
GLfloat polygon_offset_scale; /* ?? */
- /** Mapping from VERT_ATTRIB_x to post-transformed vertex slot */
- GLuint vertex_attrib_to_slot[VERT_RESULT_MAX];
+ /** Mapping from VERT_RESULT_x to post-transformed vertex slot */
+ const GLuint *vertex_result_to_slot;
struct st_vertex_program *vp; /**< Currently bound vertex program */
struct st_fragment_program *fp; /**< Currently bound fragment program */