From 574ba4b5f50bfe661427327cd792a8a200559376 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 23 Aug 2010 05:48:39 +0200 Subject: r300/compiler: implement elimination of unused constants Wine likes to create a *lot* of constants, exceeding the size of the constant file in hw. --- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c') diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index 5009ab9eed..997c0912d7 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -31,6 +31,7 @@ #include "radeon_swizzle.h" #include "radeon_emulate_branches.h" #include "radeon_emulate_loops.h" +#include "radeon_remove_constants.h" struct loop { int BgnLoop; @@ -993,6 +994,14 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c) debug_program_log(c, "after register allocation"); + if (c->Base.remove_unused_constants) { + rc_remove_unused_constants(&c->Base, + &c->code->constants_remap_table); + if (c->Base.Error) + return; + + debug_program_log(c, "after constants cleanup"); + } translate_vertex_program(c); if (c->Base.Error) -- cgit v1.2.3