summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-08-23 05:48:39 +0200
committerMarek Olšák <maraeo@gmail.com>2010-08-25 02:44:28 +0200
commit574ba4b5f50bfe661427327cd792a8a200559376 (patch)
treee553edcd2139cd7ff628fe8f939c46d3b55a7eda /src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
parent4b9b2a3cdc6a809b2e583a21b888ed59e5c20aec (diff)
r300/compiler: implement elimination of unused constants
Wine likes to create a *lot* of constants, exceeding the size of the constant file in hw.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c9
1 files changed, 9 insertions, 0 deletions
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)