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-21 02:56:01 -0500
committerIlia Mirkin <imirkin@alum.mit.edu>2014-02-12 21:47:36 -0500
commit246ca4b00156a5ed54c2fca61454ba751bed8912 (patch)
treef30845d014dc20a5a03595733193344bfe6fe707 /src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
parenta7012eede83f3a6b014b952ff837e5b377a7a12a (diff)
downloadexternal_mesa3d-246ca4b00156a5ed54c2fca61454ba751bed8912.zip
external_mesa3d-246ca4b00156a5ed54c2fca61454ba751bed8912.tar.gz
external_mesa3d-246ca4b00156a5ed54c2fca61454ba751bed8912.tar.bz2
nv50: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_shader_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_shader_state.c15
1 files changed, 14 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 129ed2a..28cff8b 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -347,6 +347,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
int i, n, c, m;
uint32_t primid = 0;
uint32_t layerid = 0;
+ uint32_t viewportid = 0;
uint32_t psiz = 0x000;
uint32_t interp = fp->fp.interp;
uint32_t colors = fp->fp.colors;
@@ -408,6 +409,9 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
case TGSI_SEMANTIC_LAYER:
layerid = m;
break;
+ case TGSI_SEMANTIC_VIEWPORT_INDEX:
+ viewportid = m;
+ break;
}
m = nv50_vec4_map(map, m, lin,
&fp->in[i], (n < vp->out_nr) ? &vp->out[n] : &dummy);
@@ -418,6 +422,11 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
map[m++] = vp->gp.layerid;
}
+ if (vp->gp.has_viewport && !viewportid) {
+ viewportid = m;
+ map[m++] = vp->gp.viewportid;
+ }
+
if (nv50->rast->pipe.point_size_per_vertex) {
psiz = (m << 4) | 1;
map[m++] = vp->vp.psiz;
@@ -472,12 +481,16 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
PUSH_DATAp(push, map, n);
}
- BEGIN_NV04(push, NV50_3D(SEMANTIC_COLOR), 4);
+ 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, layerid);
PUSH_DATA (push, psiz);
+ BEGIN_NV04(push, NV50_3D(SEMANTIC_VIEWPORT), 1);
+ PUSH_DATA (push, viewportid);
+
BEGIN_NV04(push, NV50_3D(LAYER), 1);
PUSH_DATA (push, vp->gp.has_layer << 16);