diff options
author | Tom Stellard <tstellar@gmail.com> | 2010-06-11 23:09:36 -0700 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-07-03 04:27:09 +0200 |
commit | 697d666d7860b3bdced32ca7fde9dea38f67da15 (patch) | |
tree | 3969cfde48c0bae7f0d763fe4080195012c320da /src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | |
parent | 91c37599f621a0ec498c0f0add14f16470ca852b (diff) |
r300/compiler: Handle loops in deadcode analysis.
This also allows us to split the loop emulation into two phases. A
tranformation phase which either unrolls loops or prepares them to be
emulated, and the emulation phase which unrolls remaining loops until the
instruction limit is reached. The second phase is completed after the
deadcode analysis in order to get a more accurate count of the number of
instructions in the body of loops.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index e984797e2d..bd8d63246a 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -593,6 +593,8 @@ static struct rc_swizzle_caps r300_vertprog_swizzle_caps = { void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) { + struct emulate_loop_state loop_state; + compiler->Base.SwizzleCaps = &r300_vertprog_swizzle_caps; addArtificialOutputs(compiler); @@ -602,10 +604,14 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) /* XXX Ideally this should be done only for r3xx, but since * we don't have branching support for r5xx, we use the emulation * on all chipsets. */ + rc_transform_unroll_loops(&compiler->Base, &loop_state); + + debug_program_log(compiler, "after transform loops"); + if (compiler->Base.is_r500){ - rc_emulate_loops(&compiler->Base, R500_VS_MAX_ALU); + rc_emulate_loops(&loop_state, R500_VS_MAX_ALU); } else { - rc_emulate_loops(&compiler->Base, R300_VS_MAX_ALU); + rc_emulate_loops(&loop_state, R300_VS_MAX_ALU); } debug_program_log(compiler, "after emulate loops"); |