summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-27 17:51:48 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-27 17:52:24 +0100
commitfd20d1c7e8bbe2f40d73679b1514023772cfd8f6 (patch)
treef040a504d570fa081ece9db7f3ec20bbe4903d74
parent660fee8351542dadc0d5550164e753f7c2d67261 (diff)
draw: add disabled debug code
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c15
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c28
2 files changed, 41 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index e37256b1ff..cf87cde996 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -41,6 +41,8 @@ struct pt_emit {
struct translate_cache *cache;
unsigned prim;
+
+ const struct vertex_info *vinfo;
};
void draw_pt_emit_prepare( struct pt_emit *emit,
@@ -71,7 +73,7 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
/* Must do this after set_primitive() above:
*/
- vinfo = draw->render->get_vertex_info(draw->render);
+ emit->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
/* Translate from pipeline vertices to hw vertices.
@@ -245,6 +247,17 @@ void draw_pt_emit_linear(struct pt_emit *emit,
vertex_count,
hw_verts);
+ if (0) {
+ unsigned i;
+ for (i = 0; i < vertex_count; i++) {
+ debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
+ draw_dump_emitted_vertex( emit->vinfo,
+ (const uint8_t *)hw_verts +
+ translate->key.output_stride * i );
+ }
+ }
+
+
render->draw_arrays(render, start, count);
render->release_vertices(render,
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
index 43d7095f76..85d0bdfcab 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
@@ -60,6 +60,9 @@ struct fetch_shade_emit {
struct draw_vs_varient_key key;
struct draw_vs_varient *active;
+
+
+ const struct vertex_info *vinfo;
};
@@ -85,7 +88,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
/* Must do this after set_primitive() above:
*/
- vinfo = draw->render->get_vertex_info(draw->render);
+ fse->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
@@ -267,6 +270,18 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
0,
count );
+ if (0) {
+ unsigned i;
+ for (i = 0; i < count; i++) {
+ debug_printf("\n\n%s vertex %d: (stride %d, offset %d)\n", __FUNCTION__, i,
+ fse->key.output_stride,
+ fse->key.output_stride * i);
+
+ draw_dump_emitted_vertex( fse->vinfo,
+ (const uint8_t *)hw_verts + fse->key.output_stride * i );
+ }
+ }
+
draw->render->release_vertices( draw->render,
hw_verts,
@@ -311,6 +326,17 @@ fse_run(struct draw_pt_middle_end *middle,
draw_elts,
draw_count );
+ if (0) {
+ unsigned i;
+ for (i = 0; i < fetch_count; i++) {
+ debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
+ draw_dump_emitted_vertex( fse->vinfo,
+ (const uint8_t *)hw_verts +
+ fse->key.output_stride * i );
+ }
+ }
+
+
draw->render->release_vertices( draw->render,
hw_verts,
fse->key.output_stride,