From: Tom Stellard <thomas.stell...@amd.com> --- src/gallium/drivers/r300/compiler/radeon_program.h | 2 ++ src/gallium/drivers/r300/compiler/radeon_program_print.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/r300/compiler/radeon_program.h b/src/gallium/drivers/r300/compiler/radeon_program.h index 67be1b9..0bcf5d6 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program.h +++ b/src/gallium/drivers/r300/compiler/radeon_program.h @@ -29,6 +29,7 @@ #define __RADEON_PROGRAM_H_ #include <stdint.h> +#include <stdio.h> #include <string.h> #include "radeon_opcodes.h" @@ -208,6 +209,7 @@ void rc_remove_instruction(struct rc_instruction * inst); unsigned int rc_recompute_ips(struct radeon_compiler * c); void rc_print_program(const struct rc_program *prog); +void rc_print_program_file(const struct rc_program *prog, FILE *file); rc_swizzle rc_mask_to_swizzle(unsigned int mask); #endif diff --git a/src/gallium/drivers/r300/compiler/radeon_program_print.c b/src/gallium/drivers/r300/compiler/radeon_program_print.c index 29a349e..8b4c2b0 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_print.c +++ b/src/gallium/drivers/r300/compiler/radeon_program_print.c @@ -465,19 +465,24 @@ static void rc_print_pair_instruction(FILE * f, struct rc_instruction * fullinst */ void rc_print_program(const struct rc_program *prog) { + rc_print_program_file(prog, stderr); +} + +void rc_print_program_file(const struct rc_program *prog, FILE *file) +{ unsigned int linenum = 0; unsigned branch_depth = 0; struct rc_instruction *inst; - fprintf(stderr, "# Radeon Compiler Program\n"); + fprintf(file, "# Radeon Compiler Program\n"); for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { - fprintf(stderr, "%3d: ", linenum); + fprintf(file, "%3d: ", linenum); if (inst->Type == RC_INSTRUCTION_PAIR) - rc_print_pair_instruction(stderr, inst, &branch_depth); + rc_print_pair_instruction(file, inst, &branch_depth); else - rc_print_normal_instruction(stderr, inst, &branch_depth); + rc_print_normal_instruction(file, inst, &branch_depth); linenum++; } -- 1.8.1.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev