summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_state_validate.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-11 16:23:43 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-11 16:24:27 +0100
commit5138ac033ad3708e2b82f2beebc887f65a77309e (patch)
treeb7b76fc8bd95046f8b389418f17defd67c7015f6 /src/gallium/drivers/nvc0/nvc0_state_validate.c
parent67d0c3dd792bc2d188f5f53b7e00eb120758d66c (diff)
nvc0: support user clip planes
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_state_validate.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state_validate.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c
index 2b38ebc8ba..ded461b9c5 100644
--- a/src/gallium/drivers/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c
@@ -193,6 +193,23 @@ nvc0_validate_clip(struct nvc0_context *nvc0)
BEGIN_RING(chan, RING_3D(VIEW_VOLUME_CLIP_CTRL), 1);
OUT_RING (chan, clip);
+
+ if (nvc0->clip.nr) {
+ struct nouveau_bo *bo = nvc0->screen->uniforms;
+
+ BEGIN_RING(chan, RING_3D(CB_SIZE), 3);
+ OUT_RING (chan, 256);
+ OUT_RELOCh(chan, bo, 5 << 16, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCl(chan, bo, 5 << 16, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ BEGIN_RING_1I(chan, RING_3D(CB_POS), nvc0->clip.nr * 4 + 1);
+ OUT_RING (chan, 0);
+ OUT_RINGp (chan, &nvc0->clip.ucp[0][0], nvc0->clip.nr * 4);
+
+ BEGIN_RING(chan, RING_3D(VP_CLIP_DISTANCE_ENABLE), 1);
+ OUT_RING (chan, (1 << nvc0->clip.nr) - 1);
+ } else {
+ INLIN_RING(chan, RING_3D(VP_CLIP_DISTANCE_ENABLE), 0);
+ }
}
static void