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) {
+ 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;
if (vp->out[n].sn == fp->in[i].sn &&
vp->out[n].si == fp->in[i].si)
break;
+ if (i == fp->gp.primid) {
+ primid = m;
+ }
m = nv50_vec4_map(map, m, lin,
&fp->in[i], (n < vp->out_nr) ? &vp->out[n] : &dummy);
}
- /* PrimitiveID either is replaced by the system value, or
- * written by the geometry shader into an output register
- */
- if (fp->gp.primid < 0x80) {
- primid = m;
- 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.
PUSH_DATAp(push, map, n);
} else {
BEGIN_NV04(push, NV50_3D(VP_GP_BUILTIN_ATTR_EN), 1);
- PUSH_DATA (push, vp->vp.attrs[2]);
+ PUSH_DATA (push, vp->vp.attrs[2] | fp->vp.attrs[2]);
BEGIN_NV04(push, NV50_3D(SEMANTIC_PRIM_ID), 1);
PUSH_DATA (push, primid);