nv50/ir: handle TGSI_SEMANTIC_VERTEXID
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 7 Jan 2012 23:12:35 +0000 (00:12 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 9 Jan 2012 23:39:35 +0000 (00:39 +0100)
src/gallium/drivers/nv50/codegen/nv50_ir_driver.h
src/gallium/drivers/nv50/codegen/nv50_ir_from_sm4.cpp
src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
src/gallium/drivers/nvc0/nvc0_program.c

index 4baef5373709082bba832783ffd39dc6b8013970..73fb023c378e612363764bcdaa94f23ba54c8934 100644 (file)
@@ -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)
index 11720d2db67693f492903f54bf0a5cdb19e82710..4f3189eade0547ba8a2fb80d50955482fe895aae 100644 (file)
@@ -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;
index 6678398cfb2d8afc4abdc5bc8a0bb4998076f82c..8b368953fa96cf0218d1f2f0e7315d66db57c349 100644 (file)
@@ -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:
index 5eee895fea70d2c7facbce14ed18f08357f8b931..a982cc12a1ecd2c35bfab5015fbf9b083d85fa0d 100644 (file)
@@ -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: