[Mesa-dev] [PATCH 01/10] glsl: Add C-callable fprint_ir function.

Matt Turner mattst88 at gmail.com
Tue May 13 14:52:05 PDT 2014


---
 src/glsl/ir.h                 | 3 +++
 src/glsl/ir_print_visitor.cpp | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 6c7c60a..ef4a12d 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -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
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index 6f370b9..0a7695a 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -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)
-- 
1.8.3.2



More information about the mesa-dev mailing list