Mesa (nv50-compiler): nv50: put low limit on REG_ALLOC_TEMP and FP_RESULT_COUNT

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Wed Sep 15 13:41:34 UTC 2010


Module: Mesa
Branch: nv50-compiler
Commit: 84d170bbcef8e26017ac8e2f3bacbaeb20f889d3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=84d170bbcef8e26017ac8e2f3bacbaeb20f889d3

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Wed Sep 15 15:21:41 2010 +0200

nv50: put low limit on REG_ALLOC_TEMP and FP_RESULT_COUNT

---

 src/gallium/drivers/nv50/nv50_pc.c      |    4 ++--
 src/gallium/drivers/nv50/nv50_program.c |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_pc.c b/src/gallium/drivers/nv50/nv50_pc.c
index 2706d88..bb464ec 100644
--- a/src/gallium/drivers/nv50/nv50_pc.c
+++ b/src/gallium/drivers/nv50/nv50_pc.c
@@ -539,8 +539,8 @@ nv50_generate_code(struct nv50_translation_info *ti)
    ti->p->immd_size = pc->immd_count * 4;
    ti->p->immd = pc->immd_buf;
 
-   /* highest 16 bit reg to num of 32 bit regs */
-   ti->p->max_gpr = (pc->max_reg[NV_FILE_GPR] >> 1) + 1;
+   /* highest 16 bit reg to num of 32 bit regs, limit to >= 4 */
+   ti->p->max_gpr = MAX2(4, (pc->max_reg[NV_FILE_GPR] >> 1) + 1);
 
    ti->p->fixups = pc->fixups;
    ti->p->num_fixups = pc->num_fixups;
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 24952f7..b3600f7 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -514,6 +514,9 @@ nv50_fragprog_prepare(struct nv50_translation_info *ti)
    if (depr < p->out_nr) {
       p->out[depr].mask = 0x4;
       p->out[depr].hw = ti->output_map[depr][2] = p->max_out++;
+   } else {
+      /* allowed values are 1, 4, 5, 8, 9, ... */
+      p->max_out = MAX2(4, p->max_out);
    }
 
    return 0;




More information about the mesa-commit mailing list