summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-02-03 23:20:32 -0500
committerIlia Mirkin <imirkin@alum.mit.edu>2014-02-06 18:02:57 -0500
commitc7373b7dc7202b93eecc1072efda7319b1ad0da8 (patch)
tree5ba567c74ed320d899bdc78b0fcafb8cb89b4033
parentf658150639c36eda351590e757247c56507f494f (diff)
downloadexternal_mesa3d-c7373b7dc7202b93eecc1072efda7319b1ad0da8.zip
external_mesa3d-c7373b7dc7202b93eecc1072efda7319b1ad0da8.tar.gz
external_mesa3d-c7373b7dc7202b93eecc1072efda7319b1ad0da8.tar.bz2
nv50: rework primid logic
Functionally identical but much simpler. Should also better integrate with future layer/viewport changes/fixes. Cc: 10.1 <mesa-stable@lists.freedesktop.org> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_program.c5
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_program.h1
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_shader_state.c4
3 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c
index 636ef87..f14d3ef 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_program.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c
@@ -170,10 +170,8 @@ nv50_fragprog_assign_slots(struct nv50_ir_prog_info *info)
if (info->in[i].sn == TGSI_SEMANTIC_COLOR)
prog->vp.bfc[info->in[i].si] = j;
- else if (info->in[i].sn == TGSI_SEMANTIC_PRIMID) {
+ else if (info->in[i].sn == TGSI_SEMANTIC_PRIMID)
prog->vp.attrs[2] |= NV50_3D_VP_GP_BUILTIN_ATTR_EN_PRIMITIVE_ID;
- prog->gp.primid = j;
- }
prog->in[j].id = i;
prog->in[j].mask = info->in[i].mask;
@@ -345,7 +343,6 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset)
prog->vp.clpd[0] = map_undef;
prog->vp.clpd[1] = map_undef;
prog->vp.psiz = map_undef;
- prog->gp.primid = 0x80;
prog->gp.has_layer = 0;
info->driverPriv = prog;
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.h b/src/gallium/drivers/nouveau/nv50/nv50_program.h
index 5b092bd..75de007 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_program.h
+++ b/src/gallium/drivers/nouveau/nv50/nv50_program.h
@@ -88,7 +88,6 @@ struct nv50_program {
struct {
uint32_t vert_count;
- ubyte primid; /* primitive id output register */
uint8_t prim_type; /* point, line strip or tri strip */
bool has_layer;
ubyte layerid; /* hw value of layer output */
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
index 9a43502..f8b1c1b 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -401,8 +401,10 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
if (vp->out[n].sn == fp->in[i].sn &&
vp->out[n].si == fp->in[i].si)
break;
- if (i == fp->gp.primid) {
+ switch (fp->in[i].sn) {
+ case TGSI_SEMANTIC_PRIMID:
primid = m;
+ break;
}
m = nv50_vec4_map(map, m, lin,
&fp->in[i], (n < vp->out_nr) ? &vp->out[n] : &dummy);