glsl: Add C-callable fprint_ir function.
authorMatt Turner <mattst88@gmail.com>
Tue, 13 May 2014 01:16:22 +0000 (18:16 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 15 May 2014 22:45:39 +0000 (15:45 -0700)
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir.h
src/glsl/ir_print_visitor.cpp

index 6c7c60a27d9d1a3fb2e97ed4440095a545ecc745..ef4a12d60ef1220cb46b010af2d80fde2104316b 100644 (file)
@@ -2348,6 +2348,9 @@ extern "C" {
 extern void _mesa_print_ir(FILE *f, struct exec_list *instructions,
                            struct _mesa_glsl_parse_state *state);
 
+extern void
+fprint_ir(FILE *f, const void *instruction);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
index 6f370b9711d52f83559df15b72b56a49f8ab284a..0a7695ae1f6a2a9a5a827031bd9391f854c64187 100644 (file)
@@ -76,6 +76,13 @@ _mesa_print_ir(FILE *f, exec_list *instructions,
    fprintf(f, "\n)");
 }
 
+void
+fprint_ir(FILE *f, const void *instruction)
+{
+   const ir_instruction *ir = (const ir_instruction *)instruction;
+   ir->fprint(f);
+}
+
 } /* extern "C" */
 
 ir_print_visitor::ir_print_visitor(FILE *f)