Mesa (master): r300/compiler: don' t terminate regalloc if we surpass max temps limit

Marek Olšák mareko at kemper.freedesktop.org
Wed Dec 8 03:43:39 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Dec  7 21:45:34 2010 +0100

r300/compiler: don't terminate regalloc if we surpass max temps limit

The same check is already in a later pass (translate_vertex_program).

---

 src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
index dab5933..0152bc9 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
@@ -791,19 +791,14 @@ static void allocate_temporary_registers(struct radeon_compiler *c, void *user)
 						if (!hwtemps[j])
 							break;
 					}
-					if (j >= c->max_temp_regs) {
-						rc_error(c, "Too many temporaries\n");
-						return;
+					ta[orig].Allocated = 1;
+					if (last_inst_src_reladdr &&
+					    last_inst_src_reladdr->IP > inst->IP) {
+						ta[orig].HwTemp = orig;
 					} else {
-						ta[orig].Allocated = 1;
-						if (last_inst_src_reladdr &&
-						    last_inst_src_reladdr->IP > inst->IP) {
-							ta[orig].HwTemp = orig;
-						} else {
-							ta[orig].HwTemp = j;
-						}
-						hwtemps[ta[orig].HwTemp] = 1;
+						ta[orig].HwTemp = j;
 					}
+					hwtemps[ta[orig].HwTemp] = 1;
 				}
 
 				inst->U.I.DstReg.Index = ta[orig].HwTemp;




More information about the mesa-commit mailing list