summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-01-15 03:47:48 -0500
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2014-01-27 16:40:42 +0100
commit70a07ac35269c037adb2b724df28357b7f87efb1 (patch)
tree4607ddf32e1fa6065b97b504b94190c2f74112ac /src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
parent7c624148a699eb660565498ff91685be4d0f1c35 (diff)
downloadexternal_mesa3d-70a07ac35269c037adb2b724df28357b7f87efb1.zip
external_mesa3d-70a07ac35269c037adb2b724df28357b7f87efb1.tar.gz
external_mesa3d-70a07ac35269c037adb2b724df28357b7f87efb1.tar.bz2
nv50: handle gl_Layer writes in GP
Marks gl_Layer as only having one component, and makes sure to keep track of where it is and emit it in the output map, since it is not an input to the FP. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_shader_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_shader_state.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
index ff711f9..b24e3ac 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -346,6 +346,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
struct nv50_varying dummy;
int i, n, c, m;
uint32_t primid = 0;
+ uint32_t layerid = vp->gp.layerid;
uint32_t psiz = 0x000;
uint32_t interp = fp->fp.interp;
uint32_t colors = fp->fp.colors;
@@ -412,6 +413,12 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
map[m++] = vp->gp.primid;
}
+ if (vp->gp.has_layer) {
+ // In GL4.x, layer can be an fp input, but not in 3.x. Make sure to add
+ // it to the output map.
+ map[m++] = layerid;
+ }
+
if (nv50->rast->pipe.point_size_per_vertex) {
psiz = (m << 4) | 1;
map[m++] = vp->vp.psiz;
@@ -468,9 +475,12 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
BEGIN_NV04(push, NV50_3D(SEMANTIC_COLOR), 4);
PUSH_DATA (push, colors);
PUSH_DATA (push, (vp->vp.clpd_nr << 8) | 4);
- PUSH_DATA (push, 0);
+ PUSH_DATA (push, layerid);
PUSH_DATA (push, psiz);
+ BEGIN_NV04(push, NV50_3D(LAYER), 1);
+ PUSH_DATA (push, vp->gp.has_layer << 16);
+
BEGIN_NV04(push, NV50_3D(FP_INTERPOLANT_CTRL), 1);
PUSH_DATA (push, interp);