nv50/ir: handle TGSI_SEMANTIC_VERTEXID
This commit is contained in:
parent
ca03372657
commit
7fd802b96c
|
@ -71,7 +71,6 @@ struct nv50_ir_varying
|
|||
#define NV50_SEMANTIC_CLIPDISTANCE (TGSI_SEMANTIC_COUNT + 0)
|
||||
#define NV50_SEMANTIC_TEXCOORD (TGSI_SEMANTIC_COUNT + 1)
|
||||
#define NV50_SEMANTIC_POINTCOORD (TGSI_SEMANTIC_COUNT + 2)
|
||||
#define NV50_SEMANTIC_VERTEXID (TGSI_SEMANTIC_COUNT + 3)
|
||||
#define NV50_SEMANTIC_VIEWPORTINDEX (TGSI_SEMANTIC_COUNT + 4)
|
||||
#define NV50_SEMANTIC_LAYER (TGSI_SEMANTIC_COUNT + 5)
|
||||
#define NV50_SEMANTIC_INVOCATIONID (TGSI_SEMANTIC_COUNT + 6)
|
||||
|
|
|
@ -18,7 +18,7 @@ static nv50_ir::SVSemantic irSemantic(unsigned sn)
|
|||
case NV50_SEMANTIC_VIEWPORTINDEX: return nv50_ir::SV_VIEWPORT_INDEX;
|
||||
case TGSI_SEMANTIC_PSIZE: return nv50_ir::SV_POINT_SIZE;
|
||||
case NV50_SEMANTIC_CLIPDISTANCE: return nv50_ir::SV_CLIP_DISTANCE;
|
||||
case NV50_SEMANTIC_VERTEXID: return nv50_ir::SV_VERTEX_ID;
|
||||
case TGSI_SEMANTIC_VERTEXID: return nv50_ir::SV_VERTEX_ID;
|
||||
case TGSI_SEMANTIC_INSTANCEID: return nv50_ir::SV_INSTANCE_ID;
|
||||
case TGSI_SEMANTIC_PRIMID: return nv50_ir::SV_PRIMITIVE_ID;
|
||||
case NV50_SEMANTIC_TESSFACTOR: return nv50_ir::SV_TESS_FACTOR;
|
||||
|
@ -652,7 +652,7 @@ Converter::tgsiSemantic(SVSemantic sv, int index)
|
|||
case SV_VIEWPORT_INDEX: return NV50_SEMANTIC_VIEWPORTINDEX;
|
||||
case SV_POINT_SIZE: return TGSI_SEMANTIC_PSIZE;
|
||||
case SV_CLIP_DISTANCE: return NV50_SEMANTIC_CLIPDISTANCE;
|
||||
case SV_VERTEX_ID: return NV50_SEMANTIC_VERTEXID;
|
||||
case SV_VERTEX_ID: return TGSI_SEMANTIC_VERTEXID;
|
||||
case SV_INSTANCE_ID: return TGSI_SEMANTIC_INSTANCEID;
|
||||
case SV_PRIMITIVE_ID: return TGSI_SEMANTIC_PRIMID;
|
||||
case SV_TESS_FACTOR: return NV50_SEMANTIC_TESSFACTOR;
|
||||
|
@ -712,7 +712,7 @@ Converter::parseSignature()
|
|||
info.in[r].sn = TGSI_SEMANTIC_POSITION;
|
||||
break;
|
||||
case D3D_NAME_VERTEX_ID:
|
||||
info.in[r].sn = NV50_SEMANTIC_VERTEXID;
|
||||
info.in[r].sn = TGSI_SEMANTIC_VERTEXID;
|
||||
break;
|
||||
case D3D_NAME_PRIMITIVE_ID:
|
||||
info.in[r].sn = TGSI_SEMANTIC_PRIMID;
|
||||
|
|
|
@ -321,6 +321,7 @@ static nv50_ir::SVSemantic translateSysVal(uint sysval)
|
|||
case TGSI_SEMANTIC_PSIZE: return nv50_ir::SV_POINT_SIZE;
|
||||
case TGSI_SEMANTIC_PRIMID: return nv50_ir::SV_PRIMITIVE_ID;
|
||||
case TGSI_SEMANTIC_INSTANCEID: return nv50_ir::SV_INSTANCE_ID;
|
||||
case TGSI_SEMANTIC_VERTEXID: return nv50_ir::SV_VERTEX_ID;
|
||||
default:
|
||||
assert(0);
|
||||
return nv50_ir::SV_CLOCK;
|
||||
|
@ -769,7 +770,7 @@ int Source::inferSysValDirection(unsigned sn) const
|
|||
{
|
||||
switch (sn) {
|
||||
case TGSI_SEMANTIC_INSTANCEID:
|
||||
// case TGSI_SEMANTIC_VERTEXID:
|
||||
case TGSI_SEMANTIC_VERTEXID:
|
||||
return 1;
|
||||
#if 0
|
||||
case TGSI_SEMANTIC_LAYER:
|
||||
|
|
|
@ -65,7 +65,7 @@ nvc0_shader_input_address(unsigned sn, unsigned si, unsigned ubase)
|
|||
case NV50_SEMANTIC_POINTCOORD: return 0x2e0;
|
||||
case NV50_SEMANTIC_TESSCOORD: return 0x2f0;
|
||||
case TGSI_SEMANTIC_INSTANCEID: return 0x2f8;
|
||||
case NV50_SEMANTIC_VERTEXID: return 0x2fc;
|
||||
case TGSI_SEMANTIC_VERTEXID: return 0x2fc;
|
||||
case NV50_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10;
|
||||
case TGSI_SEMANTIC_FACE: return 0x3fc;
|
||||
case NV50_SEMANTIC_INVOCATIONID: return ~0;
|
||||
|
@ -108,7 +108,7 @@ nvc0_vp_assign_input_slots(struct nv50_ir_prog_info *info)
|
|||
for (n = 0, i = 0; i < info->numInputs; ++i) {
|
||||
switch (info->in[i].sn) {
|
||||
case TGSI_SEMANTIC_INSTANCEID:
|
||||
case NV50_SEMANTIC_VERTEXID:
|
||||
case TGSI_SEMANTIC_VERTEXID:
|
||||
info->in[i].mask = 0x1;
|
||||
info->in[i].slot[0] =
|
||||
nvc0_shader_input_address(info->in[i].sn, 0, 0) / 4;
|
||||
|
@ -264,7 +264,7 @@ nvc0_vtgp_gen_header(struct nvc0_program *vp, struct nv50_ir_prog_info *info)
|
|||
case TGSI_SEMANTIC_INSTANCEID:
|
||||
vp->hdr[10] |= 1 << 30;
|
||||
break;
|
||||
case NV50_SEMANTIC_VERTEXID:
|
||||
case TGSI_SEMANTIC_VERTEXID:
|
||||
vp->hdr[10] |= 1 << 31;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue