r300: flush stdout to get consistent debugging info
authorMaciej Cencora <m.cencora@gmail.com>
Thu, 23 Apr 2009 14:12:09 +0000 (16:12 +0200)
committerDave Airlie <airlied@linux.ie>
Mon, 27 Apr 2009 09:07:16 +0000 (19:07 +1000)
src/mesa/drivers/dri/r300/r300_fragprog_common.c
src/mesa/drivers/dri/r300/radeon_program_pair.c

index 3d4bd5db2177ec786cec7c09be8b12e620cfabf4..6eaad7655006375927e74326f74d5d6116cd2697 100644 (file)
@@ -214,8 +214,10 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
                compiler.program = _mesa_clone_program(ctx, &fp->Base);
 
                if (RADEON_DEBUG & DEBUG_PIXEL) {
+                       fflush(stdout);
                        _mesa_printf("Fragment Program: Initial program:\n");
                        _mesa_print_program(compiler.program);
+                       fflush(stdout);
                }
 
                insert_WPOS_trailer(&compiler);
@@ -240,6 +242,7 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
                if (RADEON_DEBUG & DEBUG_PIXEL) {
                        _mesa_printf("Fragment Program: After native rewrite:\n");
                        _mesa_print_program(compiler.program);
+                       fflush(stdout);
                }
 
                if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
@@ -263,6 +266,7 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
                if (RADEON_DEBUG & DEBUG_PIXEL) {
                        _mesa_printf("Compiler: after NqSSA-DCE:\n");
                        _mesa_print_program(compiler.program);
+                       fflush(stdout);
                }
 
                if (!r300->vtbl.FragmentProgramEmit(&compiler))
index 5c6594bc2e1800afa53ca4d82ffb8773246c59e9..906d36e522614deb35718420f32b0fad7dcb0010 100644 (file)
@@ -609,6 +609,7 @@ static void emit_all_tex(struct pair_state *s)
                if (s->Debug) {
                        _mesa_printf("   ");
                        _mesa_print_instruction(inst);
+                       fflush(stdout);
                }
                s->Error = s->Error || !s->Handler->EmitTex(s->UserData, inst);
        }