From 7fd802b96cd916e5cadf7eda7329105169dd29bb Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 8 Jan 2012 00:12:35 +0100 Subject: [PATCH] nv50/ir: handle TGSI_SEMANTIC_VERTEXID --- src/gallium/drivers/nv50/codegen/nv50_ir_driver.h | 1 - src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp | 6 +++--- src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp | 3 ++- src/gallium/drivers/nvc0/nvc0_program.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h index 4baef537370..73fb023c378 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h @@ -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) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp index 11720d2db67..4f3189eade0 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp @@ -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; diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp index 6678398cfb2..8b368953fa9 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp @@ -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: diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c index 5eee895fea7..a982cc12a1e 100644 --- a/src/gallium/drivers/nvc0/nvc0_program.c +++ b/src/gallium/drivers/nvc0/nvc0_program.c @@ -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: -- 2.30.2