tgsi: reduce repetition of structure name in its members
authorKeith Whitwell <keithw@vmware.com>
Tue, 24 Nov 2009 14:53:29 +0000 (14:53 +0000)
committerKeith Whitwell <keithw@vmware.com>
Tue, 24 Nov 2009 14:53:29 +0000 (14:53 +0000)
Rename Semantic.SemanticName to Semantic.Name.  Similar for
SemanticIndex, and the members of the tgsi_version struct.

22 files changed:
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_aapoint.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/auxiliary/tgsi/tgsi_dump_c.c
src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/auxiliary/tgsi/tgsi_parse.c
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_text.c
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/auxiliary/vl/vl_shader_build.c
src/gallium/drivers/nv20/nv20_vertprog.c
src/gallium/drivers/nv30/nv30_fragprog.c
src/gallium/drivers/nv30/nv30_vertprog.c
src/gallium/drivers/nv40/nv40_fragprog.c
src/gallium/drivers/nv40/nv40_vertprog.c
src/gallium/drivers/nv50/nv50_program.c
src/gallium/drivers/r300/r300_vs.c
src/gallium/drivers/svga/svga_tgsi_decl_sm20.c
src/gallium/drivers/svga/svga_tgsi_decl_sm30.c
src/gallium/include/pipe/p_shader_tokens.h

index e374010fee6988d3ff330a24ac064c3f8a9c591f..7b0b236a3dc8e8cd49c4e0bf901fb8cb942a9eff 100644 (file)
@@ -139,8 +139,8 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
    struct aa_transform_context *aactx = (struct aa_transform_context *) ctx;
 
    if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
-       decl->Semantic.SemanticName == TGSI_SEMANTIC_COLOR &&
-       decl->Semantic.SemanticIndex == 0) {
+       decl->Semantic.Name == TGSI_SEMANTIC_COLOR &&
+       decl->Semantic.Index == 0) {
       aactx->colorOutput = decl->DeclarationRange.First;
    }
    else if (decl->Declaration.File == TGSI_FILE_SAMPLER) {
@@ -153,9 +153,9 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
    else if (decl->Declaration.File == TGSI_FILE_INPUT) {
       if ((int) decl->DeclarationRange.Last > aactx->maxInput)
          aactx->maxInput = decl->DeclarationRange.Last;
-      if (decl->Semantic.SemanticName == TGSI_SEMANTIC_GENERIC &&
-           (int) decl->Semantic.SemanticIndex > aactx->maxGeneric) {
-         aactx->maxGeneric = decl->Semantic.SemanticIndex;
+      if (decl->Semantic.Name == TGSI_SEMANTIC_GENERIC &&
+           (int) decl->Semantic.Index > aactx->maxGeneric) {
+         aactx->maxGeneric = decl->Semantic.Index;
       }
    }
    else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
@@ -228,8 +228,8 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
       /* XXX this could be linear... */
       decl.Declaration.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE;
       decl.Declaration.Semantic = 1;
-      decl.Semantic.SemanticName = TGSI_SEMANTIC_GENERIC;
-      decl.Semantic.SemanticIndex = aactx->maxGeneric + 1;
+      decl.Semantic.Name = TGSI_SEMANTIC_GENERIC;
+      decl.Semantic.Index = aactx->maxGeneric + 1;
       decl.DeclarationRange.First = 
       decl.DeclarationRange.Last = aactx->maxInput + 1;
       ctx->emit_declaration(ctx, &decl);
index ae1712fe122a901bcfafda05c98d32b927299c28..1f29448ff85100a1ddeb49f4c4d283974d7bd296 100644 (file)
@@ -131,16 +131,16 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
    struct aa_transform_context *aactx = (struct aa_transform_context *) ctx;
 
    if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
-       decl->Semantic.SemanticName == TGSI_SEMANTIC_COLOR &&
-       decl->Semantic.SemanticIndex == 0) {
+       decl->Semantic.Name == TGSI_SEMANTIC_COLOR &&
+       decl->Semantic.Index == 0) {
       aactx->colorOutput = decl->DeclarationRange.First;
    }
    else if (decl->Declaration.File == TGSI_FILE_INPUT) {
       if ((int) decl->DeclarationRange.Last > aactx->maxInput)
          aactx->maxInput = decl->DeclarationRange.Last;
-      if (decl->Semantic.SemanticName == TGSI_SEMANTIC_GENERIC &&
-           (int) decl->Semantic.SemanticIndex > aactx->maxGeneric) {
-         aactx->maxGeneric = decl->Semantic.SemanticIndex;
+      if (decl->Semantic.Name == TGSI_SEMANTIC_GENERIC &&
+           (int) decl->Semantic.Index > aactx->maxGeneric) {
+         aactx->maxGeneric = decl->Semantic.Index;
       }
    }
    else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
@@ -198,8 +198,8 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
       /* XXX this could be linear... */
       decl.Declaration.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE;
       decl.Declaration.Semantic = 1;
-      decl.Semantic.SemanticName = TGSI_SEMANTIC_GENERIC;
-      decl.Semantic.SemanticIndex = aactx->maxGeneric + 1;
+      decl.Semantic.Name = TGSI_SEMANTIC_GENERIC;
+      decl.Semantic.Index = aactx->maxGeneric + 1;
       decl.DeclarationRange.First = 
       decl.DeclarationRange.Last = texInput;
       ctx->emit_declaration(ctx, &decl);
index 9de06e37edddcbbb457438837767d4fa64d7e0f4..75774e662613ceccb7fc427836042758402207d4 100644 (file)
@@ -140,7 +140,7 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
    }
    else if (decl->Declaration.File == TGSI_FILE_INPUT) {
       pctx->maxInput = MAX2(pctx->maxInput, (int) decl->DeclarationRange.Last);
-      if (decl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION)
+      if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION)
          pctx->wincoordInput = (int) decl->DeclarationRange.First;
    }
    else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
@@ -226,8 +226,8 @@ pstip_transform_inst(struct tgsi_transform_context *ctx,
          decl.Declaration.File = TGSI_FILE_INPUT;
          decl.Declaration.Interpolate = TGSI_INTERPOLATE_LINEAR; /* XXX? */
          decl.Declaration.Semantic = 1;
-         decl.Semantic.SemanticName = TGSI_SEMANTIC_POSITION;
-         decl.Semantic.SemanticIndex = 0;
+         decl.Semantic.Name = TGSI_SEMANTIC_POSITION;
+         decl.Semantic.Index = 0;
          decl.DeclarationRange.First = 
             decl.DeclarationRange.Last = wincoordInput;
          ctx->emit_declaration(ctx, &decl);
index fbac26564085947798b0d70242c3a75b43dda7fc..2e6c5b38b4b6f1d7f18bcdac56c1590b05f8bbee 100644 (file)
@@ -39,8 +39,8 @@ tgsi_build_version( void )
 {
    struct tgsi_version  version;
 
-   version.MajorVersion = 1;
-   version.MinorVersion = 1;
+   version.Major = 1;
+   version.Minor = 1;
    version.Padding = 0;
 
    return version;
@@ -223,8 +223,8 @@ tgsi_build_full_declaration(
       size++;
 
       *ds = tgsi_build_declaration_semantic(
-         full_decl->Semantic.SemanticName,
-         full_decl->Semantic.SemanticIndex,
+         full_decl->Semantic.Name,
+         full_decl->Semantic.Index,
          declaration,
          header );
    }
@@ -269,8 +269,8 @@ tgsi_default_declaration_semantic( void )
 {
    struct tgsi_declaration_semantic ds;
 
-   ds.SemanticName = TGSI_SEMANTIC_POSITION;
-   ds.SemanticIndex = 0;
+   ds.Name = TGSI_SEMANTIC_POSITION;
+   ds.Index = 0;
    ds.Padding = 0;
 
    return ds;
@@ -289,8 +289,8 @@ tgsi_build_declaration_semantic(
    assert( semantic_index <= 0xFFFF );
 
    ds = tgsi_default_declaration_semantic();
-   ds.SemanticName = semantic_name;
-   ds.SemanticIndex = semantic_index;
+   ds.Name = semantic_name;
+   ds.Index = semantic_index;
 
    declaration_grow( declaration, header );
 
index 7eb64167fb2d239cb39eca07a980c5eafbd61716..8f26d5dae3dbfee79b654cac5dd4f7a240cfdf98 100644 (file)
@@ -232,11 +232,11 @@ iter_declaration(
 
    if (decl->Declaration.Semantic) {
       TXT( ", " );
-      ENM( decl->Semantic.SemanticName, semantic_names );
-      if (decl->Semantic.SemanticIndex != 0 ||
-          decl->Semantic.SemanticName == TGSI_SEMANTIC_GENERIC) {
+      ENM( decl->Semantic.Name, semantic_names );
+      if (decl->Semantic.Index != 0 ||
+          decl->Semantic.Name == TGSI_SEMANTIC_GENERIC) {
          CHR( '[' );
-         UID( decl->Semantic.SemanticIndex );
+         UID( decl->Semantic.Index );
          CHR( ']' );
       }
    }
@@ -477,9 +477,9 @@ prolog(
 {
    struct dump_ctx *ctx = (struct dump_ctx *) iter;
    ENM( iter->processor.Processor, processor_type_names );
-   UID( iter->version.MajorVersion );
+   UID( iter->version.Major );
    CHR( '.' );
-   UID( iter->version.MinorVersion );
+   UID( iter->version.Minor );
    EOL();
    return TRUE;
 }
index 4648051e29e5a1ea178bf272926f7e756b2c06a0..11d28b1653d309949bfcd21e63131dcf0a7f5d73 100644 (file)
@@ -229,10 +229,10 @@ dump_declaration_verbose(
 
    if( decl->Declaration.Semantic ) {
       EOL();
-      TXT( "\nSemanticName : " );
-      ENM( decl->Semantic.SemanticName, TGSI_SEMANTICS );
-      TXT( "\nSemanticIndex: " );
-      UID( decl->Semantic.SemanticIndex );
+      TXT( "\nName : " );
+      ENM( decl->Semantic.Name, TGSI_SEMANTICS );
+      TXT( "\nIndex: " );
+      UID( decl->Semantic.Index );
       if( ignored ) {
          TXT( "\nPadding      : " );
          UIX( decl->Semantic.Padding );
@@ -485,10 +485,10 @@ tgsi_dump_c(
 
    TXT( "tgsi-dump begin -----------------" );
 
-   TXT( "\nMajorVersion: " );
-   UID( parse.FullVersion.Version.MajorVersion );
-   TXT( "\nMinorVersion: " );
-   UID( parse.FullVersion.Version.MinorVersion );
+   TXT( "\nMajor: " );
+   UID( parse.FullVersion.Version.Major );
+   TXT( "\nMinor: " );
+   UID( parse.FullVersion.Version.Minor );
    EOL();
 
    TXT( "\nHeaderSize: " );
index 61d38e57f1a614d1051f2897bada92452908971d..c113f4a3bc8fae8461ee895d7ba1cbc918e466fa 100644 (file)
@@ -1899,16 +1899,16 @@ exec_declaration(struct tgsi_exec_machine *mach,
          last = decl->DeclarationRange.Last;
          mask = decl->Declaration.UsageMask;
 
-         if (decl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
-            assert(decl->Semantic.SemanticIndex == 0);
+         if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
+            assert(decl->Semantic.Index == 0);
             assert(first == last);
             assert(mask = TGSI_WRITEMASK_XYZW);
 
             mach->Inputs[first] = mach->QuadPos;
-         } else if (decl->Semantic.SemanticName == TGSI_SEMANTIC_FACE) {
+         } else if (decl->Semantic.Name == TGSI_SEMANTIC_FACE) {
             uint i;
 
-            assert(decl->Semantic.SemanticIndex == 0);
+            assert(decl->Semantic.Index == 0);
             assert(first == last);
 
             for (i = 0; i < QUAD_SIZE; i++) {
index 52c714ebbdfc38fbe28cebc10e1a60ce7fe0cf8c..d4f27499b84763fef0cf20354e24b37ded6882e0 100644 (file)
@@ -36,7 +36,7 @@ tgsi_parse_init(
    const struct tgsi_token *tokens )
 {
    ctx->FullVersion.Version = *(struct tgsi_version *) &tokens[0];
-   if( ctx->FullVersion.Version.MajorVersion > 1 ) {
+   if( ctx->FullVersion.Version.Major > 1 ) {
       return TGSI_PARSE_ERROR;
    }
 
index 55595539ec66465600eddf23399fddfb44462d33..69567130e3d7ca6c4851e21660a444eba4ba0043 100644 (file)
@@ -129,21 +129,21 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                info->file_max[file] = MAX2(info->file_max[file], (int)reg);
 
                if (file == TGSI_FILE_INPUT) {
-                  info->input_semantic_name[reg] = (ubyte)fulldecl->Semantic.SemanticName;
-                  info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
+                  info->input_semantic_name[reg] = (ubyte)fulldecl->Semantic.Name;
+                  info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.Index;
                   info->input_interpolate[reg] = (ubyte)fulldecl->Declaration.Interpolate;
                   info->num_inputs++;
                }
                else if (file == TGSI_FILE_OUTPUT) {
-                  info->output_semantic_name[reg] = (ubyte)fulldecl->Semantic.SemanticName;
-                  info->output_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
+                  info->output_semantic_name[reg] = (ubyte)fulldecl->Semantic.Name;
+                  info->output_semantic_index[reg] = (ubyte)fulldecl->Semantic.Index;
                   info->num_outputs++;
                }
 
                /* special case */
                if (procType == TGSI_PROCESSOR_FRAGMENT &&
                    file == TGSI_FILE_OUTPUT &&
-                   fulldecl->Semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
+                   fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
                   info->writes_z = TRUE;
                }
             }
index 7250f98cc933ede2485c724693311d8163f4517e..d25f590df73c271c975b636c2f3cab45813ab441 100644 (file)
@@ -831,13 +831,13 @@ static boolean parse_declaration( struct translate_ctx *ctx )
                }
                cur2++;
 
-               decl.Semantic.SemanticIndex = index;
+               decl.Semantic.Index = index;
 
                cur = cur2;
             }
 
             decl.Declaration.Semantic = 1;
-            decl.Semantic.SemanticName = i;
+            decl.Semantic.Name = i;
 
             ctx->cur = cur;
             break;
index de4bc6edb02b98ea0b3f842462c901e2d27ea566..6d646a529aa06db4525905f1416f9855afaaf07e 100644 (file)
@@ -910,8 +910,8 @@ static void emit_decl( struct ureg_program *ureg,
       out[1].decl_range.Last = index;
 
    out[2].value = 0;
-   out[2].decl_semantic.SemanticName = semantic_name;
-   out[2].decl_semantic.SemanticIndex = semantic_index;
+   out[2].decl_semantic.Name = semantic_name;
+   out[2].decl_semantic.Index = semantic_index;
 
 }
 
@@ -1064,8 +1064,8 @@ emit_header( struct ureg_program *ureg )
 {
    union tgsi_any_token *out = get_tokens( ureg, DOMAIN_DECL, 3 );
 
-   out[0].version.MajorVersion = 1;
-   out[0].version.MinorVersion = 1;
+   out[0].version.Major = 1;
+   out[0].version.Minor = 1;
    out[0].version.Padding = 0;
 
    out[1].header.HeaderSize = 2;
index 9637cbed8a4e7992092efe29e3dd18e063f6a1bc..d052e2c797fe6c0d68d5e9b69ece879781ce6cdd 100644 (file)
@@ -36,8 +36,8 @@ struct tgsi_full_declaration vl_decl_input(unsigned int name, unsigned int index
 
    decl.Declaration.File = TGSI_FILE_INPUT;
    decl.Declaration.Semantic = 1;
-   decl.Semantic.SemanticName = name;
-   decl.Semantic.SemanticIndex = index;
+   decl.Semantic.Name = name;
+   decl.Semantic.Index = index;
    decl.DeclarationRange.First = first;
    decl.DeclarationRange.Last = last;
 
@@ -64,8 +64,8 @@ struct tgsi_full_declaration vl_decl_interpolated_input
 
    decl.Declaration.File = TGSI_FILE_INPUT;
    decl.Declaration.Semantic = 1;
-   decl.Semantic.SemanticName = name;
-   decl.Semantic.SemanticIndex = index;
+   decl.Semantic.Name = name;
+   decl.Semantic.Index = index;
    decl.Declaration.Interpolate = interpolation;;
    decl.DeclarationRange.First = first;
    decl.DeclarationRange.Last = last;
@@ -79,8 +79,8 @@ struct tgsi_full_declaration vl_decl_constants(unsigned int name, unsigned int i
 
    decl.Declaration.File = TGSI_FILE_CONSTANT;
    decl.Declaration.Semantic = 1;
-   decl.Semantic.SemanticName = name;
-   decl.Semantic.SemanticIndex = index;
+   decl.Semantic.Name = name;
+   decl.Semantic.Index = index;
    decl.DeclarationRange.First = first;
    decl.DeclarationRange.Last = last;
 
@@ -93,8 +93,8 @@ struct tgsi_full_declaration vl_decl_output(unsigned int name, unsigned int inde
 
    decl.Declaration.File = TGSI_FILE_OUTPUT;
    decl.Declaration.Semantic = 1;
-   decl.Semantic.SemanticName = name;
-   decl.Semantic.SemanticIndex = index;
+   decl.Semantic.Name = name;
+   decl.Semantic.Index = index;
    decl.DeclarationRange.First = first;
    decl.DeclarationRange.Last = last;
 
index 48df356fafc4a8b2b16db9eddc36a4a75198ad58..cd76910744037c3d11e6d8ee9ca13f9d9b977034 100644 (file)
@@ -490,15 +490,15 @@ nv20_vertprog_parse_decl_output(struct nv20_vpc *vpc,
 {
        int hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = NV30_VP_INST_DEST_POS;
                break;
        case TGSI_SEMANTIC_COLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV30_VP_INST_DEST_COL0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV30_VP_INST_DEST_COL1;
                } else {
                        NOUVEAU_ERR("bad colour semantic index\n");
@@ -506,10 +506,10 @@ nv20_vertprog_parse_decl_output(struct nv20_vpc *vpc,
                }
                break;
        case TGSI_SEMANTIC_BCOLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV30_VP_INST_DEST_BFC0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV30_VP_INST_DEST_BFC1;
                } else {
                        NOUVEAU_ERR("bad bcolour semantic index\n");
@@ -523,8 +523,8 @@ nv20_vertprog_parse_decl_output(struct nv20_vpc *vpc,
                hw = NV30_VP_INST_DEST_PSZ;
                break;
        case TGSI_SEMANTIC_GENERIC:
-               if (fdec->Semantic.SemanticIndex <= 7) {
-                       hw = NV30_VP_INST_DEST_TC(fdec->Semantic.SemanticIndex);
+               if (fdec->Semantic.Index <= 7) {
+                       hw = NV30_VP_INST_DEST_TC(fdec->Semantic.Index);
                } else {
                        NOUVEAU_ERR("bad generic semantic index\n");
                        return FALSE;
index eb978b683817b7d7ff14396f781aee20df835557..acf216bb61d1b7a94f57c00310d6f54720ea78ea 100644 (file)
@@ -572,15 +572,15 @@ nv30_fragprog_parse_decl_attrib(struct nv30_fpc *fpc,
 {
        int hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = NV30_FP_OP_INPUT_SRC_POSITION;
                break;
        case TGSI_SEMANTIC_COLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV30_FP_OP_INPUT_SRC_COL0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV30_FP_OP_INPUT_SRC_COL1;
                } else {
                        NOUVEAU_ERR("bad colour semantic index\n");
@@ -591,9 +591,9 @@ nv30_fragprog_parse_decl_attrib(struct nv30_fpc *fpc,
                hw = NV30_FP_OP_INPUT_SRC_FOGC;
                break;
        case TGSI_SEMANTIC_GENERIC:
-               if (fdec->Semantic.SemanticIndex <= 7) {
+               if (fdec->Semantic.Index <= 7) {
                        hw = NV30_FP_OP_INPUT_SRC_TC(fdec->Semantic.
-                                                    SemanticIndex);
+                                                    Index);
                } else {
                        NOUVEAU_ERR("bad generic semantic index\n");
                        return FALSE;
@@ -612,7 +612,7 @@ static boolean
 nv30_fragprog_parse_decl_output(struct nv30_fpc *fpc,
                                const struct tgsi_full_declaration *fdec)
 {
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                fpc->depth_id = fdec->DeclarationRange.First;
                break;
index b04fb229bc918fec4fda04595e0d9e64ae8bf143..e8fba8ab1628c65e06790b3a7abfefeb9fbd4743 100644 (file)
@@ -490,15 +490,15 @@ nv30_vertprog_parse_decl_output(struct nv30_vpc *vpc,
 {
        int hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = NV30_VP_INST_DEST_POS;
                break;
        case TGSI_SEMANTIC_COLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV30_VP_INST_DEST_COL0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV30_VP_INST_DEST_COL1;
                } else {
                        NOUVEAU_ERR("bad colour semantic index\n");
@@ -506,10 +506,10 @@ nv30_vertprog_parse_decl_output(struct nv30_vpc *vpc,
                }
                break;
        case TGSI_SEMANTIC_BCOLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV30_VP_INST_DEST_BFC0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV30_VP_INST_DEST_BFC1;
                } else {
                        NOUVEAU_ERR("bad bcolour semantic index\n");
@@ -523,8 +523,8 @@ nv30_vertprog_parse_decl_output(struct nv30_vpc *vpc,
                hw = NV30_VP_INST_DEST_PSZ;
                break;
        case TGSI_SEMANTIC_GENERIC:
-               if (fdec->Semantic.SemanticIndex <= 7) {
-                       hw = NV30_VP_INST_DEST_TC(fdec->Semantic.SemanticIndex);
+               if (fdec->Semantic.Index <= 7) {
+                       hw = NV30_VP_INST_DEST_TC(fdec->Semantic.Index);
                } else {
                        NOUVEAU_ERR("bad generic semantic index\n");
                        return FALSE;
index dbbb736670ead41c090515a3b7625b37ada27f62..ca6a957fc12a8c651b3393e7010234dfa403a875 100644 (file)
@@ -644,15 +644,15 @@ nv40_fragprog_parse_decl_attrib(struct nv40_fpc *fpc,
 {
        int hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = NV40_FP_OP_INPUT_SRC_POSITION;
                break;
        case TGSI_SEMANTIC_COLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV40_FP_OP_INPUT_SRC_COL0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV40_FP_OP_INPUT_SRC_COL1;
                } else {
                        NOUVEAU_ERR("bad colour semantic index\n");
@@ -663,9 +663,9 @@ nv40_fragprog_parse_decl_attrib(struct nv40_fpc *fpc,
                hw = NV40_FP_OP_INPUT_SRC_FOGC;
                break;
        case TGSI_SEMANTIC_GENERIC:
-               if (fdec->Semantic.SemanticIndex <= 7) {
+               if (fdec->Semantic.Index <= 7) {
                        hw = NV40_FP_OP_INPUT_SRC_TC(fdec->Semantic.
-                                                    SemanticIndex);
+                                                    Index);
                } else {
                        NOUVEAU_ERR("bad generic semantic index\n");
                        return FALSE;
@@ -687,12 +687,12 @@ nv40_fragprog_parse_decl_output(struct nv40_fpc *fpc,
        unsigned idx = fdec->DeclarationRange.First;
        unsigned hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = 1;
                break;
        case TGSI_SEMANTIC_COLOR:
-               switch (fdec->Semantic.SemanticIndex) {
+               switch (fdec->Semantic.Index) {
                case 0: hw = 0; break;
                case 1: hw = 2; break;
                case 2: hw = 3; break;
index df9cb227a3dcafb754a3d10a68f62e754aabf0ae..ed0f1d857d3628432a724ee140e98fd6ad2cb740 100644 (file)
@@ -580,16 +580,16 @@ nv40_vertprog_parse_decl_output(struct nv40_vpc *vpc,
        unsigned idx = fdec->DeclarationRange.First;
        int hw;
 
-       switch (fdec->Semantic.SemanticName) {
+       switch (fdec->Semantic.Name) {
        case TGSI_SEMANTIC_POSITION:
                hw = NV40_VP_INST_DEST_POS;
                vpc->hpos_idx = idx;
                break;
        case TGSI_SEMANTIC_COLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV40_VP_INST_DEST_COL0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV40_VP_INST_DEST_COL1;
                } else {
                        NOUVEAU_ERR("bad colour semantic index\n");
@@ -597,10 +597,10 @@ nv40_vertprog_parse_decl_output(struct nv40_vpc *vpc,
                }
                break;
        case TGSI_SEMANTIC_BCOLOR:
-               if (fdec->Semantic.SemanticIndex == 0) {
+               if (fdec->Semantic.Index == 0) {
                        hw = NV40_VP_INST_DEST_BFC0;
                } else
-               if (fdec->Semantic.SemanticIndex == 1) {
+               if (fdec->Semantic.Index == 1) {
                        hw = NV40_VP_INST_DEST_BFC1;
                } else {
                        NOUVEAU_ERR("bad bcolour semantic index\n");
@@ -614,8 +614,8 @@ nv40_vertprog_parse_decl_output(struct nv40_vpc *vpc,
                hw = NV40_VP_INST_DEST_PSZ;
                break;
        case TGSI_SEMANTIC_GENERIC:
-               if (fdec->Semantic.SemanticIndex <= 7) {
-                       hw = NV40_VP_INST_DEST_TC(fdec->Semantic.SemanticIndex);
+               if (fdec->Semantic.Index <= 7) {
+                       hw = NV40_VP_INST_DEST_TC(fdec->Semantic.Index);
                } else {
                        NOUVEAU_ERR("bad generic semantic index\n");
                        return FALSE;
index e40e37d07c342276c3ffec2b9ca578c2163306f4..00518af8c0e6822cf36b5bb20e9a8e0facfc7d73 100644 (file)
@@ -2558,8 +2558,8 @@ nv50_program_tx_prep(struct nv50_pc *pc)
                                    p->type == PIPE_SHADER_FRAGMENT)
                                        break;
 
-                               si = d->Semantic.SemanticIndex;
-                               switch (d->Semantic.SemanticName) {
+                               si = d->Semantic.Index;
+                               switch (d->Semantic.Name) {
                                case TGSI_SEMANTIC_BCOLOR:
                                        p->cfg.two_side[si].hw = first;
                                        if (p->cfg.io_nr > first)
index 74ef416dc140149cb9272d9cf0313565aa6e3815..939b13e4b35ca195165a2a4359df1e0c378ac6bd 100644 (file)
@@ -77,7 +77,7 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
         if (decl->Declaration.File != TGSI_FILE_OUTPUT)
             continue;
 
-        switch (decl->Semantic.SemanticName) {
+        switch (decl->Semantic.Name) {
             case TGSI_SEMANTIC_POSITION:
                 c->code->outputs[decl->DeclarationRange.First] = 0;
                 break;
@@ -98,7 +98,7 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
                 break;
             default:
                 debug_printf("r300: vs: Bad semantic declaration %d\n",
-                    decl->Semantic.SemanticName);
+                    decl->Semantic.Name);
                 break;
         }
     }
index 54457082a06da77c56e276c4f8c7d4dbffc01811..6f4822a89d03ab2726e430bc41e5e501b101c68e 100644 (file)
@@ -46,7 +46,7 @@ static boolean ps20_input( struct svga_shader_emitter *emit,
    dcl.values[0] = 0;
    dcl.values[1] = 0;
 
-   switch (semantic.SemanticName) {
+   switch (semantic.Name) {
    case TGSI_SEMANTIC_POSITION:
       /* Special case:
        */
@@ -55,15 +55,15 @@ static boolean ps20_input( struct svga_shader_emitter *emit,
       break;
    case TGSI_SEMANTIC_COLOR:
       reg = src_register( SVGA3DREG_INPUT, 
-                          semantic.SemanticIndex );
+                          semantic.Index );
       break;
    case TGSI_SEMANTIC_FOG:
-      assert(semantic.SemanticIndex == 0);
+      assert(semantic.Index == 0);
       reg = src_register( SVGA3DREG_TEXTURE, 0 );
       break;
    case TGSI_SEMANTIC_GENERIC:
       reg = src_register( SVGA3DREG_TEXTURE,
-                          semantic.SemanticIndex + 1 );
+                          semantic.Index + 1 );
       break;
    default:
       assert(0);
@@ -90,16 +90,16 @@ static boolean ps20_output( struct svga_shader_emitter *emit,
 {
    SVGA3dShaderDestToken reg;
 
-   switch (semantic.SemanticName) {
+   switch (semantic.Name) {
    case TGSI_SEMANTIC_COLOR:
-      if (semantic.SemanticIndex < PIPE_MAX_COLOR_BUFS) {
-         unsigned cbuf = semantic.SemanticIndex;
+      if (semantic.Index < PIPE_MAX_COLOR_BUFS) {
+         unsigned cbuf = semantic.Index;
 
          emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                                emit->nr_hw_temp++ );
          emit->temp_col[cbuf] = emit->output_map[idx];
          emit->true_col[cbuf] = dst_register( SVGA3DREG_COLOROUT, 
-                                              semantic.SemanticIndex );
+                                              semantic.Index );
       }
       else {
          assert(0);
@@ -111,7 +111,7 @@ static boolean ps20_output( struct svga_shader_emitter *emit,
                                             emit->nr_hw_temp++ );
       emit->temp_pos = emit->output_map[idx];
       emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, 
-                                     semantic.SemanticIndex );
+                                     semantic.Index );
       break;
    default:
       assert(0);
@@ -169,9 +169,9 @@ static boolean vs20_output( struct svga_shader_emitter *emit,
 
    /* Just build the register map table: 
     */
-   switch (semantic.SemanticName) {
+   switch (semantic.Name) {
    case TGSI_SEMANTIC_POSITION:
-      assert(semantic.SemanticIndex == 0);
+      assert(semantic.Index == 0);
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                             emit->nr_hw_temp++ );
       emit->temp_pos = emit->output_map[idx];
@@ -179,7 +179,7 @@ static boolean vs20_output( struct svga_shader_emitter *emit,
                                      SVGA3DRASTOUT_POSITION);
       break;
    case TGSI_SEMANTIC_PSIZE:
-      assert(semantic.SemanticIndex == 0);
+      assert(semantic.Index == 0);
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                             emit->nr_hw_temp++ );
       emit->temp_psiz = emit->output_map[idx];
@@ -187,17 +187,17 @@ static boolean vs20_output( struct svga_shader_emitter *emit,
                                       SVGA3DRASTOUT_PSIZE );
       break;
    case TGSI_SEMANTIC_FOG:
-      assert(semantic.SemanticIndex == 0);
+      assert(semantic.Index == 0);
       emit->output_map[idx] = dst_register( SVGA3DREG_TEXCRDOUT, 0 );
       break;
    case TGSI_SEMANTIC_COLOR:
       /* oD0 */
       emit->output_map[idx] = dst_register( SVGA3DREG_ATTROUT,
-                                            semantic.SemanticIndex );
+                                            semantic.Index );
       break;
    case TGSI_SEMANTIC_GENERIC:
       emit->output_map[idx] = dst_register( SVGA3DREG_TEXCRDOUT,
-                                            semantic.SemanticIndex + 1 );
+                                            semantic.Index + 1 );
       break;
    default:
       assert(0);
@@ -237,8 +237,8 @@ boolean svga_translate_decl_sm20( struct svga_shader_emitter *emit,
    unsigned idx;
    
    if (decl->Declaration.Semantic) {
-      semantic = decl->Semantic.SemanticName;
-      semantic_idx = decl->Semantic.SemanticIndex;
+      semantic = decl->Semantic.Name;
+      semantic_idx = decl->Semantic.Index;
    }
 
    for( idx = first; idx <= last; idx++ ) {
index 08e7dfb117cdb13be85f6b6a02492c39bdcf172d..65aa23ce3e643024d5fa128c1ce53a1b7e7aec9f 100644 (file)
@@ -35,35 +35,35 @@ static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semant
                                          unsigned *usage,
                                          unsigned *idx )
 {
-   switch (semantic.SemanticName) {
+   switch (semantic.Name) {
    case TGSI_SEMANTIC_POSITION:  
-      *idx = semantic.SemanticIndex;
+      *idx = semantic.Index;
       *usage = SVGA3D_DECLUSAGE_POSITION;
       break;
    case TGSI_SEMANTIC_COLOR:     
 
-      *idx = semantic.SemanticIndex;
+      *idx = semantic.Index;
       *usage = SVGA3D_DECLUSAGE_COLOR;
       break;
    case TGSI_SEMANTIC_BCOLOR:
-      *idx = semantic.SemanticIndex + 2; /* sharing with COLOR */
+      *idx = semantic.Index + 2; /* sharing with COLOR */
       *usage = SVGA3D_DECLUSAGE_COLOR;
       break;
    case TGSI_SEMANTIC_FOG:       
       *idx = 0;
-      assert(semantic.SemanticIndex == 0);
+      assert(semantic.Index == 0);
       *usage = SVGA3D_DECLUSAGE_TEXCOORD;
       break;
    case TGSI_SEMANTIC_PSIZE:     
-      *idx = semantic.SemanticIndex;
+      *idx = semantic.Index;
       *usage = SVGA3D_DECLUSAGE_PSIZE;
       break;
    case TGSI_SEMANTIC_GENERIC:   
-      *idx = semantic.SemanticIndex + 1; /* texcoord[0] is reserved for fog */
+      *idx = semantic.Index + 1; /* texcoord[0] is reserved for fog */
       *usage = SVGA3D_DECLUSAGE_TEXCOORD;
       break;
    case TGSI_SEMANTIC_NORMAL:    
-      *idx = semantic.SemanticIndex;
+      *idx = semantic.Index;
       *usage = SVGA3D_DECLUSAGE_NORMAL;
       break;
    default:
@@ -120,7 +120,7 @@ static boolean ps30_input( struct svga_shader_emitter *emit,
    unsigned usage, index;
    SVGA3dShaderDestToken reg;
 
-   if (semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
+   if (semantic.Name == TGSI_SEMANTIC_POSITION) {
       emit->input_map[idx] = src_register( SVGA3DREG_MISCTYPE,
                                            SVGA3DMISCREG_POSITION );
 
@@ -135,7 +135,7 @@ static boolean ps30_input( struct svga_shader_emitter *emit,
       return emit_decl( emit, reg, 0, 0 );
    }
    else if (emit->key.fkey.light_twoside &&
-            (semantic.SemanticName == TGSI_SEMANTIC_COLOR)) {
+            (semantic.Name == TGSI_SEMANTIC_COLOR)) {
 
       if (!translate_vs_ps_semantic( semantic, &usage, &index ))
          return FALSE;
@@ -150,7 +150,7 @@ static boolean ps30_input( struct svga_shader_emitter *emit,
       if (!emit_decl( emit, reg, usage, index ))
          return FALSE;
 
-      semantic.SemanticName = TGSI_SEMANTIC_BCOLOR;
+      semantic.Name = TGSI_SEMANTIC_BCOLOR;
       if (!translate_vs_ps_semantic( semantic, &usage, &index ))
          return FALSE;
 
@@ -164,7 +164,7 @@ static boolean ps30_input( struct svga_shader_emitter *emit,
 
       return TRUE;
    }
-   else if (semantic.SemanticName == TGSI_SEMANTIC_FACE) {
+   else if (semantic.Name == TGSI_SEMANTIC_FACE) {
       if (!emit_vface_decl( emit ))
          return FALSE;
       emit->emit_frontface = TRUE;
@@ -193,17 +193,17 @@ static boolean ps30_output( struct svga_shader_emitter *emit,
 {
    SVGA3dShaderDestToken reg;
 
-   switch (semantic.SemanticName) {
+   switch (semantic.Name) {
    case TGSI_SEMANTIC_COLOR:
       emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT, 
-                                            semantic.SemanticIndex );
+                                            semantic.Index );
       break;
    case TGSI_SEMANTIC_POSITION:
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                             emit->nr_hw_temp++ );
       emit->temp_pos = emit->output_map[idx];
       emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, 
-                                     semantic.SemanticIndex );
+                                     semantic.Index );
       break;
    default:
       assert(0);
@@ -283,14 +283,14 @@ static boolean vs30_output( struct svga_shader_emitter *emit,
    dcl.index = index;
    dcl.values[0] |= 1<<31;
 
-   if (semantic.SemanticName == TGSI_SEMANTIC_POSITION) {
+   if (semantic.Name == TGSI_SEMANTIC_POSITION) {
       assert(idx == 0);
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                             emit->nr_hw_temp++ );
       emit->temp_pos = emit->output_map[idx];
       emit->true_pos = dcl.dst;
    }
-   else if (semantic.SemanticName == TGSI_SEMANTIC_PSIZE) {
+   else if (semantic.Name == TGSI_SEMANTIC_PSIZE) {
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                             emit->nr_hw_temp++ );
       emit->temp_psiz = emit->output_map[idx];
@@ -342,8 +342,8 @@ boolean svga_translate_decl_sm30( struct svga_shader_emitter *emit,
    unsigned idx;
 
    if (decl->Declaration.Semantic) {
-      semantic = decl->Semantic.SemanticName;
-      semantic_idx = decl->Semantic.SemanticIndex;
+      semantic = decl->Semantic.Name;
+      semantic_idx = decl->Semantic.Index;
    }
 
    for( idx = first; idx <= last; idx++ ) {
index ac999e0c182c72d4b60a7c2899786799dc58d031..7d73d7df8526d6a19fb439a138cbe98fb8d1b7c8 100644 (file)
@@ -37,8 +37,8 @@ extern "C" {
 
 struct tgsi_version
 {
-   unsigned MajorVersion  : 8;
-   unsigned MinorVersion  : 8;
+   unsigned Major  : 8;
+   unsigned Minor  : 8;
    unsigned Padding       : 16;
 };
 
@@ -137,8 +137,8 @@ struct tgsi_declaration_range
 
 struct tgsi_declaration_semantic
 {
-   unsigned SemanticName   : 8;  /**< one of TGSI_SEMANTIC_x */
-   unsigned SemanticIndex  : 16; /**< UINT */
+   unsigned Name           : 8;  /**< one of TGSI_SEMANTIC_x */
+   unsigned Index          : 16; /**< UINT */
    unsigned Padding        : 8;
 };