summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
diff options
context:
space:
mode:
authorTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>2016-05-08 22:44:11 +0200
committerIlia Mirkin <imirkin@alum.mit.edu>2016-05-15 10:48:39 -0400
commit8c0293979457dab49f0055075d1ca4daa3fb8033 (patch)
tree677ce1a79386b8b72ebdf51d6ac3120da6f2e6ba /src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
parent2ad970ecf49ecf79cb1b2c38cedc69e527eb3c28 (diff)
downloadexternal_mesa3d-8c0293979457dab49f0055075d1ca4daa3fb8033.zip
external_mesa3d-8c0293979457dab49f0055075d1ca4daa3fb8033.tar.gz
external_mesa3d-8c0293979457dab49f0055075d1ca4daa3fb8033.tar.bz2
nv50,nvc0: add support for cull distances
Cull distances are just a special case of clip distances as far as the hardware is concerned. Make sure that the relevant "planes" are enabled, and flip the clip mode to cull for those. Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> [imirkin: add enables on nvc0, add nv50 support] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_shader_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_shader_state.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
index 3d2ebfb..f838d15 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -389,6 +389,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
uint32_t psiz = 0x000;
uint32_t interp = fp->fp.interp;
uint32_t colors = fp->fp.colors;
+ uint32_t clpd_nr = util_last_bit(vp->vp.clip_enable | vp->vp.cull_enable);
uint32_t lin[4];
uint8_t map[64];
uint8_t so_map[64];
@@ -415,7 +416,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
dummy.linear = 0;
m = nv50_vec4_map(map, 0, lin, &dummy, &vp->out[0]);
- for (c = 0; c < vp->vp.clpd_nr; ++c)
+ for (c = 0; c < clpd_nr; ++c)
map[m++] = vp->vp.clpd[c / 4] + (c % 4);
colors |= m << 8; /* adjust BFC0 id */
@@ -522,7 +523,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
BEGIN_NV04(push, NV50_3D(GP_VIEWPORT_ID_ENABLE), 5);
PUSH_DATA (push, vp->gp.has_viewport);
PUSH_DATA (push, colors);
- PUSH_DATA (push, (vp->vp.clpd_nr << 8) | 4);
+ PUSH_DATA (push, (clpd_nr << 8) | 4);
PUSH_DATA (push, layerid);
PUSH_DATA (push, psiz);