From a60a5b850bde94c9c0c21f07800ed57436525998 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 3 Dec 2010 06:32:10 +0100 Subject: r300g: do not remove unused constants if we are not near the limit --- src/gallium/drivers/r300/r300_fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/r300/r300_fs.c') diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index c91532eb7b..2936c3486e 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -390,7 +390,6 @@ static void r300_translate_fragment_shader( compiler.Base.max_temp_regs = compiler.Base.is_r500 ? 128 : 32; compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32; compiler.Base.max_alu_insts = compiler.Base.is_r500 ? 512 : 64; - compiler.Base.remove_unused_constants = TRUE; compiler.AllocateHwInputs = &allocate_hardware_inputs; compiler.UserData = &shader->inputs; @@ -408,6 +407,11 @@ static void r300_translate_fragment_shader( r300_tgsi_to_rc(&ttr, tokens); + if (!r300->screen->caps.is_r500 || + compiler.Base.Program.Constants.Count > 200) { + compiler.Base.remove_unused_constants = TRUE; + } + /** * Transform the program to support WPOS. * -- cgit v1.2.3