summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_feedback.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-25 14:29:11 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-25 14:29:11 -0600
commit40c543eb71368c646259afb87d5c76551f6b45b7 (patch)
tree1e0c89610cc347607580fb4044e08bb0a060739e /src/mesa/pipe/draw/draw_feedback.c
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/pipe/draw/draw_feedback.c')
-rw-r--r--src/mesa/pipe/draw/draw_feedback.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/pipe/draw/draw_feedback.c b/src/mesa/pipe/draw/draw_feedback.c
index 3b8400233e..ee54db0ad5 100644
--- a/src/mesa/pipe/draw/draw_feedback.c
+++ b/src/mesa/pipe/draw/draw_feedback.c
@@ -78,11 +78,9 @@ feedback_vertex(struct draw_stage *stage, const struct vertex_header *vertex)
* we can either address output buffer 0 (for interleaving) or
* output buffer i (for non-interleaved).
*/
-#if 0
for (i = 0; i < feedback->num_attribs; i++) {
- const uint attr = feedback->attrib[i];
- const uint slot = stage->draw->vertex_info.attrib_to_slot[attr];
- const float *src = attr ? vertex->data[slot] : vertex->clip;
+ const uint slot = feedback->attrib[i];
+ const float *src = slot ? vertex->data[slot] : vertex->clip;
const uint size = feedback->size[i];
float *dest = fs->dest[i * select];
@@ -104,7 +102,6 @@ feedback_vertex(struct draw_stage *stage, const struct vertex_header *vertex)
}
fs->dest[i * select] += size;
}
-#endif
fs->num_vert_emitted++;
}