OSDN Git Service

nv30: don't assert when running out of registers
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 22 May 2016 22:21:55 +0000 (18:21 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 23 May 2016 02:57:18 +0000 (22:57 -0400)
This happens with dEQP tests. The code doesn't at all protect against
this condition, so while unhandled, this is an expected situation.

Also avoid using more than the first 16 registers for nv3x vertex
programs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c

index 89ac208..dab42e1 100644 (file)
@@ -51,7 +51,6 @@ temp(struct nvfx_fpc *fpc)
 
    if (idx >= fpc->max_temps) {
       NOUVEAU_ERR("out of temps!!\n");
-      assert(0);
       return nvfx_reg(NVFXSR_TEMP, 0);
    }
 
index 7ce51a1..b39c4b7 100644 (file)
@@ -69,9 +69,8 @@ temp(struct nvfx_vpc *vpc)
 {
    int idx = ffs(~vpc->r_temps) - 1;
 
-   if (idx < 0) {
+   if (idx < 0 || (!vpc->is_nv4x && idx >= 16)) {
       NOUVEAU_ERR("out of temps!!\n");
-      assert(0);
       return nvfx_reg(NVFXSR_TEMP, 0);
    }