summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2011-01-04 10:53:49 -0800
committerTom Stellard <tstellar@gmail.com>2011-01-04 11:37:08 -0800
commit9dfa27c92492b667bf3bd23b1da7875597ebbe72 (patch)
treef9fa7ee97fcbe8f2fe088f13e6951b0705342d1e
parentb71bff0100d33ebcf7bce4e6a3abef53461ecd2d (diff)
r300/compiler: Fix black terrain in Civ4
rc_inst_can_use_presub() wasn't checking for too many RGB sources in Alpha instructions or too many Alpha sources in RGB instructions. (cherry picked from commit e96e86d07be86ce12628d750ff686d6aea919fff)
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c
index bf393a9fb16..2482fc68beb 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.c
@@ -223,7 +223,6 @@ unsigned int rc_inst_can_use_presub(
{
struct can_use_presub_data d;
unsigned int num_presub_srcs;
- unsigned int presub_src_type = rc_source_type_mask(presub_writemask);
const struct rc_opcode_info * info =
rc_get_opcode_info(inst->U.I.Opcode);
@@ -253,13 +252,7 @@ unsigned int rc_inst_can_use_presub(
num_presub_srcs = rc_presubtract_src_reg_count(presub_op);
- if ((presub_src_type & RC_SOURCE_RGB)
- && d.RGBCount + num_presub_srcs > 3) {
- return 0;
- }
-
- if ((presub_src_type & RC_SOURCE_ALPHA)
- && d.AlphaCount + num_presub_srcs > 3) {
+ if (d.RGBCount + num_presub_srcs > 3 || d.AlphaCount + num_presub_srcs > 3) {
return 0;
}