From: Christoph Bumiller Date: Sat, 23 May 2009 10:25:32 +0000 (+0200) Subject: nv50: save some space in immediate buffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e7d3a87ec60f8e412d724c6586461501d420ec0;p=mesa.git nv50: save some space in immediate buffer We could do even better (like just allocating 1 value in alloc_immd), but that's fine for now I guess. --- diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 2241801542e..40d2384c3e2 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -250,7 +250,13 @@ alloc_immd(struct nv50_pc *pc, float f) struct nv50_reg *r = CALLOC_STRUCT(nv50_reg); unsigned hw; - hw = ctor_immd(pc, f, 0, 0, 0) * 4; + for (hw = 0; hw < pc->immd_nr * 4; hw++) + if (pc->immd_buf[hw] == f) + break; + + if (hw == pc->immd_nr * 4) + hw = ctor_immd(pc, f, -f, 0.5 * f, 0) * 4; + r->type = P_IMMD; r->hw = hw; r->index = -1;