summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2009-05-23 12:25:32 +0200
committerBen Skeggs <[email protected]>2009-05-28 16:06:18 +1000
commit7e7d3a87ec60f8e412d724c6586461501d420ec0 (patch)
tree5a2cca66c3288856480be6c23cea69d4ccbc21b5 /src/gallium/drivers/nv50/nv50_program.c
parentaad31d69ce9e2278d93e514b97e1a92a25f89826 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_program.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c8
1 files changed, 7 insertions, 1 deletions
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;