diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-09-01 03:19:05 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-09-04 18:56:21 +0200 |
commit | 0b9f8361470564563dc54e6b13879e73182d353b (patch) | |
tree | 937017f9442d42ef14a638c8f151b146304c90b8 /src/mesa/drivers/dri/r300/compiler/radeon_compiler.h | |
parent | 9a9aa7daa84341daae6a18dd6c13b958979d2343 (diff) |
r300/compiler: refactor vertex shader compilation
First list compiler passes in an array, then run the new function rc_run_compiler.
Every backend may need a different set of passes.
This cleans up the mess in r3xx_compile_vertex_program.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_compiler.h')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/radeon_compiler.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index 1833fcebca..0f6ad278b1 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -123,6 +123,18 @@ struct r300_vertex_program_compiler { }; void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* c); -void r300_vertex_program_dump(struct r300_vertex_program_compiler * c); +void r300_vertex_program_dump(struct radeon_compiler *compiler, void *user); + +struct radeon_compiler_pass { + const char *name; /* Name of the pass. */ + int dump; /* Dump the program if Debug == 1? */ + int predicate; /* Run this pass? */ + void (*run)(struct radeon_compiler *c, void *user); /* The main entrypoint. */ + void *user; /* Optional parameter which is passed to the run function. */ +}; + +/* 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); #endif /* RADEON_COMPILER_H */ |