r300/compiler: don't terminate regalloc if we surpass max temps limit
authorMarek Olšák <maraeo@gmail.com>
Tue, 7 Dec 2010 20:45:34 +0000 (21:45 +0100)
committerMarek Olšák <maraeo@gmail.com>
Wed, 8 Dec 2010 03:39:50 +0000 (04:39 +0100)
The same check is already in a later pass (translate_vertex_program).

src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c

index dab593310eed17a52d629472d0f9a3a8e203572c..0152bc905629c3bd6a70db6efceafd8fc49a988b 100644 (file)
@@ -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;