c->Program.InputsRead = program->InputsRead;
}
+
+/**
+ * Print program to stderr, default options.
+ */
+void rc_print_program(const struct rc_program *prog)
+{
+ GLuint indent = 0;
+ GLuint linenum = 1;
+ struct rc_instruction *inst;
+
+ fprintf(stderr, "# Radeon Compiler Program\n");
+
+ for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) {
+ fprintf(stderr, "%3d: ", linenum);
+
+ /* Massive hack: We rely on the fact that the printers do not actually
+ * use the gl_program argument (last argument) in debug mode */
+ indent = _mesa_fprint_instruction_opt(
+ stderr, &inst->I,
+ indent, PROG_PRINT_DEBUG, 0);
+
+ linenum++;
+ }
+}
struct radeon_compiler;
struct rc_instruction;
+struct rc_program;
enum {
PROGRAM_BUILTIN = PROGRAM_FILE_MAX /**< not a real register, but a special swizzle constant */
struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after);
void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program);
+void rc_print_program(const struct rc_program *prog);
#endif
/**
* Print a single vertex/fragment program instruction.
*/
-static GLint
+GLint
_mesa_fprint_instruction_opt(FILE *f,
const struct prog_instruction *inst,
GLint indent,
extern void
_mesa_print_instruction(const struct prog_instruction *inst);
+extern GLint
+_mesa_fprint_instruction_opt(FILE *f,
+ const struct prog_instruction *inst,
+ GLint indent,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog);
+
extern GLint
_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
gl_prog_print_mode mode,