Mesa (7.9): r300/compiler: Use correct swizzles for all presubtract sources

Tom Stellard tstellar at kemper.freedesktop.org
Mon Nov 22 12:08:31 PST 2010


Module: Mesa
Branch: 7.9
Commit: 930c168df600a745f1b0977e4a2355a1c26a91e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=930c168df600a745f1b0977e4a2355a1c26a91e7

Author: Tom Stellard <tstellar at gmail.com>
Date:   Mon Nov 22 12:00:10 2010 -0800

r300/compiler: Use correct swizzles for all presubtract sources

---

 .../drivers/dri/r300/compiler/radeon_optimize.c    |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
index 423ebbf..bebe806 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
@@ -566,6 +566,7 @@ static int presub_helper(
 		for(i = 0; i < info->NumSrcRegs; i++) {
 			unsigned int mask = src_reads_dst_mask(
 				inst->U.I.SrcReg[i], s->Inst->U.I.DstReg);
+			struct rc_src_register src = inst->U.I.SrcReg[i];
 			/* XXX We could be more aggressive here using
 			 * presubtract.  It is okay if SrcReg[i] only reads
 			 * from some of the mask components. */
@@ -577,6 +578,11 @@ static int presub_helper(
 					continue;
 				}
 			}
+			src.File = RC_FILE_PRESUB;
+			if (!c->SwizzleCaps->IsNative(inst->U.I.Opcode, src)){
+				can_remove = 0;
+				break;
+			}
 			if (cant_sub || !can_use_presub) {
 				can_remove = 0;
 				break;



More information about the mesa-commit mailing list