summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-12-11 16:23:43 +0100
committerChristoph Bumiller <[email protected]>2010-12-11 16:24:27 +0100
commit5138ac033ad3708e2b82f2beebc887f65a77309e (patch)
treeb7b76fc8bd95046f8b389418f17defd67c7015f6 /src/gallium/drivers/nvc0/nvc0_program.c
parent67d0c3dd792bc2d188f5f53b7e00eb120758d66c (diff)
nvc0: support user clip planes
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_program.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index 7aa6ef02bcd..e159b7161d4 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -418,6 +418,8 @@ nvc0_vp_gen_header(struct nvc0_program *vp, struct nvc0_translation_info *ti)
vp->hdr[0] = 0x20461;
vp->hdr[4] = 0xff000;
+ vp->hdr[18] = (1 << vp->vp.num_ucps) - 1;
+
return nvc0_vp_gp_gen_header(vp, ti);
}
@@ -605,6 +607,9 @@ nvc0_program_translate(struct nvc0_program *prog)
ti->edgeflag_out = PIPE_MAX_SHADER_OUTPUTS;
+ if (prog->type == PIPE_SHADER_VERTEX && prog->vp.num_ucps)
+ ti->append_ucp = TRUE;
+
ret = nvc0_prog_scan(ti);
if (ret) {
NOUVEAU_ERR("unsupported shader program\n");
@@ -646,5 +651,7 @@ nvc0_program_destroy(struct nvc0_context *nvc0, struct nvc0_program *prog)
if (prog->relocs)
FREE(prog->relocs);
+ memset(prog->hdr, 0, sizeof(prog->hdr));
+
prog->translated = FALSE;
}