Control FS TGSI dumping with GALLIUM_DUMP_FS env variable.
authormichal <michal@michal-laptop.(none)>
Sun, 28 Oct 2007 14:27:02 +0000 (14:27 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Sun, 28 Oct 2007 16:53:11 +0000 (16:53 +0000)
src/mesa/pipe/softpipe/sp_context.c
src/mesa/pipe/softpipe/sp_context.h
src/mesa/pipe/softpipe/sp_state_fs.c

index 53c4b03756aea50965daa3dc005712a45b271615..22493f47036a8d479aaad9adf95445da3cc8a541 100644 (file)
@@ -292,6 +292,8 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
    softpipe->use_sse = FALSE;
 #endif
 
+   softpipe->dump_fs = getenv( "GALLIUM_DUMP_FS" ) != NULL;
+
    softpipe->pipe.winsys = pipe_winsys;
    softpipe->pipe.destroy = softpipe_destroy;
 
index 548151b378e05352598135b0aa91a7c11ca9edc0..720297653fe11fc516e3fff378cd8b8da9f8ec9b 100644 (file)
@@ -166,6 +166,7 @@ struct softpipe_context {
    struct softpipe_tile_cache *tex_cache[PIPE_MAX_SAMPLERS];
 
    int use_sse : 1;
+   int dump_fs : 1;
 };
 
 
index a94ec1e92ca42c52dc48cf6378dbd9e0bede6750..ad8ab561ef6bc207669d36c3c66bbae1adb31f1b 100644 (file)
@@ -46,6 +46,12 @@ void * softpipe_create_fs_state(struct pipe_context *pipe,
    struct sp_fragment_shader_state *state = malloc(sizeof(struct sp_fragment_shader_state));
    state->shader = *templ;
 
+   if( softpipe->dump_fs ) {
+      tgsi_dump(
+         state->shader.tokens,
+         0 );
+   }
+
 #if defined(__i386__) || defined(__386__)
    if (softpipe->use_sse) {
       x86_init_func( &state->sse2_program );