if (info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_PSIZE ||
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_PRIMID ||
+ info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_LAYER ||
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_FOG)
info->out[dst.getIndex(0)].mask &= 1;
case TGSI_SEMANTIC_BCOLOR:
prog->vp.bfc[info->out[i].si] = i;
break;
+ case TGSI_SEMANTIC_LAYER:
+ prog->gp.has_layer = true;
+ prog->gp.layerid = n;
+ break;
default:
break;
}
prog->vp.clpd[1] = map_undef;
prog->vp.psiz = map_undef;
prog->gp.primid = 0x80;
+ prog->gp.has_layer = 0;
info->driverPriv = prog;
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 */
} gp;
void *fixups; /* relocation records */
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;
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;
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);