Mesa (master): draw: Add GALLIUM_DUMP_VS environment variable.

Michał Król michal at kemper.freedesktop.org
Fri Jan 15 06:52:34 UTC 2010


Module: Mesa
Branch: master
Commit: f7748d72b46465d807cf4209892d73af62485738
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7748d72b46465d807cf4209892d73af62485738

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Fri Jan 15 07:28:18 2010 +0100

draw: Add GALLIUM_DUMP_VS environment variable.

Add GALLIUM_DUMP_VS to dump the vertex shader to the console like
GALLIUM_DUMP_FS in softpipe.

---

 src/gallium/auxiliary/draw/draw_private.h |    2 ++
 src/gallium/auxiliary/draw/draw_vs.c      |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h
index 2a11b8c..d5e1c0c 100644
--- a/src/gallium/auxiliary/draw/draw_private.h
+++ b/src/gallium/auxiliary/draw/draw_private.h
@@ -172,6 +172,8 @@ struct draw_context
 
    boolean force_passthrough; /**< never clip or shade */
 
+   boolean dump_vs;
+
    double mrd;  /**< minimum resolvable depth value, for polygon offset */
 
    /* pipe state that we need: */
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 3553689..60b4dd9 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -83,6 +83,10 @@ draw_create_vertex_shader(struct draw_context *draw,
 {
    struct draw_vertex_shader *vs;
 
+   if (draw->dump_vs) {
+      tgsi_dump(shader->tokens, 0);
+   }
+
    vs = draw_create_vs_llvm( draw, shader );
    if (!vs) {
       vs = draw_create_vs_sse( draw, shader );
@@ -152,6 +156,8 @@ draw_delete_vertex_shader(struct draw_context *draw,
 boolean 
 draw_vs_init( struct draw_context *draw )
 {
+   draw->dump_vs = debug_get_bool_option("GALLIUM_DUMP_VS", FALSE);
+
    draw->vs.machine = tgsi_exec_machine_create();
    if (!draw->vs.machine)
       return FALSE;




More information about the mesa-commit mailing list