Mesa (master): r300/compiler: Ignore alpha dest register when replicating the result

Tom Stellard tstellar at kemper.freedesktop.org
Mon Nov 22 05:41:37 UTC 2010


Module: Mesa
Branch: master
Commit: 23f577dbd491bd045c47c6378bd23748255eb045
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=23f577dbd491bd045c47c6378bd23748255eb045

Author: Tom Stellard <tstellar at gmail.com>
Date:   Thu Nov 11 01:13:01 2010 -0800

r300/compiler: Ignore alpha dest register when replicating the result

When the result of the alpha instruction is being replicated to the RGB
destination register, we do not need to use alpha's destination register.
This fixes an invalid "Too many hardware temporaries used" error in
the case where a transcendent operation writes to a temporary register
greater than max_temp_regs.

NOTE: This is a candidate for the 7.9 branch.

---

 .../dri/r300/compiler/radeon_pair_translate.c      |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
index c549be5..fc05366 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
@@ -280,9 +280,12 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c,
 			pair->RGB.DestIndex = inst->DstReg.Index;
 			pair->RGB.WriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ;
 		}
+
 		if (needalpha) {
-			pair->Alpha.DestIndex = inst->DstReg.Index;
 			pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3);
+			if (pair->Alpha.WriteMask) {
+				pair->Alpha.DestIndex = inst->DstReg.Index;
+			}
 		}
 	}
 




More information about the mesa-commit mailing list