From 74e71cbfcb2950d0aa59e5b05ab817e93dfad4ee Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 22 May 2016 18:21:55 -0400 Subject: [PATCH] nv30: don't assert when running out of registers 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 --- src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 1 - src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c index 89ac208c155..dab42e17cfe 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c @@ -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); } diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c index 7ce51a118c8..b39c4b74eca 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c @@ -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); } -- 2.30.2