aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_compiler.c')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_compiler.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
index 935dc9b0a80..4aff69c8683 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
@@ -350,3 +350,27 @@ void rc_transform_fragment_face(struct radeon_compiler *c, unsigned face)
}
}
}
+
+/* Executes a list of compiler passes given in the parameter 'list'. */
+void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list,
+ const char *shader_name)
+{
+ if (c->Debug) {
+ fprintf(stderr, "%s: before compilation\n", shader_name);
+ rc_print_program(&c->Program);
+ }
+
+ for (unsigned i = 0; list[i].name; i++) {
+ if (list[i].predicate) {
+ list[i].run(c, list[i].user);
+
+ if (c->Error)
+ return;
+
+ if (c->Debug && list[i].dump) {
+ fprintf(stderr, "%s: after '%s'\n", shader_name, list[i].name);
+ rc_print_program(&c->Program);
+ }
+ }
+ }
+}