summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_fs.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-08-24 02:51:20 +0200
committerMarek Olšák <[email protected]>2010-08-25 02:44:29 +0200
commit0a21938de92a1f1e74be7c4559b03179bd657fcd (patch)
tree84289a1bf8614a73ef66bf1fceb4479e31a42769 /src/gallium/drivers/r300/r300_fs.c
parentabae06ac85349a30996257f29f9c52c3f687d35d (diff)
r300g: eliminate unused constants in FS
Diffstat (limited to 'src/gallium/drivers/r300/r300_fs.c')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index d95587b3812..9845e546109 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -386,6 +386,7 @@ static void r300_translate_fragment_shader(
compiler.state = shader->compare_state;
compiler.Base.is_r500 = r300->screen->caps.is_r500;
compiler.Base.max_temp_regs = compiler.Base.is_r500 ? 128 : 32;
+ compiler.Base.remove_unused_constants = TRUE;
compiler.AllocateHwInputs = &allocate_hardware_inputs;
compiler.UserData = &shader->inputs;
@@ -446,7 +447,12 @@ static void r300_translate_fragment_shader(
}
/* Initialize numbers of constants for each type. */
- shader->externals_count = ttr.immediate_offset;
+ shader->externals_count = 0;
+ for (i = 0;
+ i < shader->code.constants.Count &&
+ shader->code.constants.Constants[i].Type == RC_CONSTANT_EXTERNAL; i++) {
+ shader->externals_count = i+1;
+ }
shader->immediates_count = 0;
shader->rc_state_count = 0;