tgsi: rename fields of tgsi_full_declaration to reduce verbosity

DeclarationRange -> Range
This commit is contained in:
Keith Whitwell 2009-11-24 15:04:18 +00:00
parent 7d6c8f980d
commit fe2b31e4a8
29 changed files with 109 additions and 109 deletions

View file

@ -141,18 +141,18 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
decl->Semantic.Name == TGSI_SEMANTIC_COLOR &&
decl->Semantic.Index == 0) {
aactx->colorOutput = decl->DeclarationRange.First;
aactx->colorOutput = decl->Range.First;
}
else if (decl->Declaration.File == TGSI_FILE_SAMPLER) {
uint i;
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First;
i <= decl->Range.Last; i++) {
aactx->samplersUsed |= 1 << i;
}
}
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
if ((int) decl->DeclarationRange.Last > aactx->maxInput)
aactx->maxInput = decl->DeclarationRange.Last;
if ((int) decl->Range.Last > aactx->maxInput)
aactx->maxInput = decl->Range.Last;
if (decl->Semantic.Name == TGSI_SEMANTIC_GENERIC &&
(int) decl->Semantic.Index > aactx->maxGeneric) {
aactx->maxGeneric = decl->Semantic.Index;
@ -160,8 +160,8 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
}
else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
uint i;
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First;
i <= decl->Range.Last; i++) {
aactx->tempsUsed |= (1 << i);
}
}
@ -230,28 +230,28 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
decl.Declaration.Semantic = 1;
decl.Semantic.Name = TGSI_SEMANTIC_GENERIC;
decl.Semantic.Index = aactx->maxGeneric + 1;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = aactx->maxInput + 1;
decl.Range.First =
decl.Range.Last = aactx->maxInput + 1;
ctx->emit_declaration(ctx, &decl);
/* declare new sampler */
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_SAMPLER;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = aactx->freeSampler;
decl.Range.First =
decl.Range.Last = aactx->freeSampler;
ctx->emit_declaration(ctx, &decl);
/* declare new temp regs */
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = aactx->texTemp;
decl.Range.First =
decl.Range.Last = aactx->texTemp;
ctx->emit_declaration(ctx, &decl);
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = aactx->colorTemp;
decl.Range.First =
decl.Range.Last = aactx->colorTemp;
ctx->emit_declaration(ctx, &decl);
aactx->firstInstruction = FALSE;

View file

@ -133,11 +133,11 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
decl->Semantic.Name == TGSI_SEMANTIC_COLOR &&
decl->Semantic.Index == 0) {
aactx->colorOutput = decl->DeclarationRange.First;
aactx->colorOutput = decl->Range.First;
}
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
if ((int) decl->DeclarationRange.Last > aactx->maxInput)
aactx->maxInput = decl->DeclarationRange.Last;
if ((int) decl->Range.Last > aactx->maxInput)
aactx->maxInput = decl->Range.Last;
if (decl->Semantic.Name == TGSI_SEMANTIC_GENERIC &&
(int) decl->Semantic.Index > aactx->maxGeneric) {
aactx->maxGeneric = decl->Semantic.Index;
@ -145,8 +145,8 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
}
else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
uint i;
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First;
i <= decl->Range.Last; i++) {
aactx->tempsUsed |= (1 << i);
}
}
@ -200,21 +200,21 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
decl.Declaration.Semantic = 1;
decl.Semantic.Name = TGSI_SEMANTIC_GENERIC;
decl.Semantic.Index = aactx->maxGeneric + 1;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = texInput;
decl.Range.First =
decl.Range.Last = texInput;
ctx->emit_declaration(ctx, &decl);
/* declare new temp regs */
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = tmp0;
decl.Range.First =
decl.Range.Last = tmp0;
ctx->emit_declaration(ctx, &decl);
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = aactx->colorTemp;
decl.Range.First =
decl.Range.Last = aactx->colorTemp;
ctx->emit_declaration(ctx, &decl);
aactx->firstInstruction = FALSE;

View file

@ -133,20 +133,20 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
if (decl->Declaration.File == TGSI_FILE_SAMPLER) {
uint i;
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First;
i <= decl->Range.Last; i++) {
pctx->samplersUsed |= 1 << i;
}
}
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
pctx->maxInput = MAX2(pctx->maxInput, (int) decl->DeclarationRange.Last);
pctx->maxInput = MAX2(pctx->maxInput, (int) decl->Range.Last);
if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION)
pctx->wincoordInput = (int) decl->DeclarationRange.First;
pctx->wincoordInput = (int) decl->Range.First;
}
else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
uint i;
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First;
i <= decl->Range.Last; i++) {
pctx->tempsUsed |= (1 << i);
}
}
@ -228,23 +228,23 @@ pstip_transform_inst(struct tgsi_transform_context *ctx,
decl.Declaration.Semantic = 1;
decl.Semantic.Name = TGSI_SEMANTIC_POSITION;
decl.Semantic.Index = 0;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = wincoordInput;
decl.Range.First =
decl.Range.Last = wincoordInput;
ctx->emit_declaration(ctx, &decl);
}
/* declare new sampler */
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_SAMPLER;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = pctx->freeSampler;
decl.Range.First =
decl.Range.Last = pctx->freeSampler;
ctx->emit_declaration(ctx, &decl);
/* declare new temp regs */
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First =
decl.DeclarationRange.Last = pctx->texTemp;
decl.Range.First =
decl.Range.Last = pctx->texTemp;
ctx->emit_declaration(ctx, &decl);
/* emit immediate = {1/32, 1/32, 1, 1}

View file

@ -94,8 +94,8 @@ translate_declaration(struct gallivm_ir *prog,
unsigned first, last, mask;
uint interp_method;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
/* Do not touch WPOS.xy */
@ -149,7 +149,7 @@ translate_declarationir(struct gallivm_ir *,
struct tgsi_full_declaration *)
{
if (decl->Declaration.File == TGSI_FILE_ADDRESS) {
int idx = decl->DeclarationRange.First;
int idx = decl->Range.First;
storage->addAddress(idx);
}
}

View file

@ -172,7 +172,7 @@ tgsi_default_full_declaration( void )
struct tgsi_full_declaration full_declaration;
full_declaration.Declaration = tgsi_default_declaration();
full_declaration.DeclarationRange = tgsi_default_declaration_range();
full_declaration.Range = tgsi_default_declaration_range();
full_declaration.Semantic = tgsi_default_declaration_semantic();
return full_declaration;
@ -209,8 +209,8 @@ tgsi_build_full_declaration(
size++;
*dr = tgsi_build_declaration_range(
full_decl->DeclarationRange.First,
full_decl->DeclarationRange.Last,
full_decl->Range.First,
full_decl->Range.Last,
declaration,
header );

View file

@ -224,8 +224,8 @@ iter_declaration(
_dump_register(
ctx,
decl->Declaration.File,
decl->DeclarationRange.First,
decl->DeclarationRange.Last );
decl->Range.First,
decl->Range.Last );
_dump_writemask(
ctx,
decl->Declaration.UsageMask );

View file

@ -223,9 +223,9 @@ dump_declaration_verbose(
EOL();
TXT( "\nFirst: " );
UID( decl->DeclarationRange.First );
UID( decl->Range.First );
TXT( "\nLast : " );
UID( decl->DeclarationRange.Last );
UID( decl->Range.Last );
if( decl->Declaration.Semantic ) {
EOL();

View file

@ -1895,8 +1895,8 @@ exec_declaration(struct tgsi_exec_machine *mach,
if (decl->Declaration.File == TGSI_FILE_INPUT) {
uint first, last, mask;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION) {

View file

@ -112,7 +112,7 @@ tgsi_parse_token(
memset(decl, 0, sizeof *decl);
copy_token(&decl->Declaration, &token);
next_token( ctx, &decl->DeclarationRange );
next_token( ctx, &decl->Range );
if( decl->Declaration.Semantic ) {
next_token( ctx, &decl->Semantic );

View file

@ -62,7 +62,7 @@ struct tgsi_full_src_register
struct tgsi_full_declaration
{
struct tgsi_declaration Declaration;
struct tgsi_declaration_range DeclarationRange;
struct tgsi_declaration_range Range;
struct tgsi_declaration_semantic Semantic;
};

View file

@ -1178,8 +1178,8 @@ emit_declaration(
unsigned first, last, mask;
unsigned i, j;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
for( i = first; i <= last; i++ ) {

View file

@ -286,7 +286,7 @@ iter_declaration(
file = decl->Declaration.File;
if (!check_file_name( ctx, file ))
return TRUE;
for (i = decl->DeclarationRange.First; i <= decl->DeclarationRange.Last; i++) {
for (i = decl->Range.First; i <= decl->Range.Last; i++) {
if (is_register_declared( ctx, file, i ))
report_error( ctx, "%s[%u]: The same register declared more than once", file_names[file], i );
ctx->regs_decl[file][i / BITS_IN_REG_FLAG] |= (1 << (i % BITS_IN_REG_FLAG));

View file

@ -119,8 +119,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
= &parse.FullToken.FullDeclaration;
const uint file = fulldecl->Declaration.File;
uint reg;
for (reg = fulldecl->DeclarationRange.First;
reg <= fulldecl->DeclarationRange.Last;
for (reg = fulldecl->Range.First;
reg <= fulldecl->Range.Last;
reg++) {
/* only first 32 regs will appear in this bitfield */

View file

@ -2637,8 +2637,8 @@ emit_declaration(
unsigned first, last, mask;
unsigned i, j;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
for( i = first; i <= last; i++ ) {

View file

@ -799,8 +799,8 @@ static boolean parse_declaration( struct translate_ctx *ctx )
decl = tgsi_default_full_declaration();
decl.Declaration.File = file;
decl.Declaration.UsageMask = writemask;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
cur = ctx->cur;
eat_opt_white( &cur );

View file

@ -38,8 +38,8 @@ struct tgsi_full_declaration vl_decl_input(unsigned int name, unsigned int index
decl.Declaration.Semantic = 1;
decl.Semantic.Name = name;
decl.Semantic.Index = index;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}
@ -67,8 +67,8 @@ struct tgsi_full_declaration vl_decl_interpolated_input
decl.Semantic.Name = name;
decl.Semantic.Index = index;
decl.Declaration.Interpolate = interpolation;;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}
@ -81,8 +81,8 @@ struct tgsi_full_declaration vl_decl_constants(unsigned int name, unsigned int i
decl.Declaration.Semantic = 1;
decl.Semantic.Name = name;
decl.Semantic.Index = index;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}
@ -95,8 +95,8 @@ struct tgsi_full_declaration vl_decl_output(unsigned int name, unsigned int inde
decl.Declaration.Semantic = 1;
decl.Semantic.Name = name;
decl.Semantic.Index = index;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}
@ -107,8 +107,8 @@ struct tgsi_full_declaration vl_decl_temps(unsigned int first, unsigned int last
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_TEMPORARY;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}
@ -119,8 +119,8 @@ struct tgsi_full_declaration vl_decl_samplers(unsigned int first, unsigned int l
decl = tgsi_default_full_declaration();
decl.Declaration.File = TGSI_FILE_SAMPLER;
decl.DeclarationRange.First = first;
decl.DeclarationRange.Last = last;
decl.Range.First = first;
decl.Range.Last = last;
return decl;
}

View file

@ -1909,8 +1909,8 @@ emit_declaration(struct cell_context *cell,
switch (decl->Declaration.File) {
case TGSI_FILE_TEMPORARY:
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last;
for (i = decl->Range.First;
i <= decl->Range.Last;
i++) {
assert(i < MAX_TEMPS);
for (ch = 0; ch < 4; ch++) {

View file

@ -833,8 +833,8 @@ exec_declaration(struct spu_exec_machine *mach,
unsigned first, last, mask;
interpolation_func interp;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
switch( decl->Declaration.Interpolate ) {

View file

@ -928,8 +928,8 @@ i915_translate_instructions(struct i915_fp_compile *p,
if (parse.FullToken.FullDeclaration.Declaration.File
== TGSI_FILE_CONSTANT) {
uint i;
for (i = parse.FullToken.FullDeclaration.DeclarationRange.First;
i <= parse.FullToken.FullDeclaration.DeclarationRange.Last;
for (i = parse.FullToken.FullDeclaration.Range.First;
i <= parse.FullToken.FullDeclaration.Range.Last;
i++) {
assert(ifs->constant_flags[i] == 0x0);
ifs->constant_flags[i] = I915_CONSTFLAG_USER;
@ -939,8 +939,8 @@ i915_translate_instructions(struct i915_fp_compile *p,
else if (parse.FullToken.FullDeclaration.Declaration.File
== TGSI_FILE_TEMPORARY) {
uint i;
for (i = parse.FullToken.FullDeclaration.DeclarationRange.First;
i <= parse.FullToken.FullDeclaration.DeclarationRange.Last;
for (i = parse.FullToken.FullDeclaration.Range.First;
i <= parse.FullToken.FullDeclaration.Range.Last;
i++) {
assert(i < I915_MAX_TEMPORARY);
/* XXX just use shader->info->file_mask[TGSI_FILE_TEMPORARY] */

View file

@ -303,8 +303,8 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
unsigned first, last, mask;
unsigned attrib;
first = decl->DeclarationRange.First;
last = decl->DeclarationRange.Last;
first = decl->Range.First;
last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
for( attrib = first; attrib <= last; ++attrib ) {

View file

@ -535,7 +535,7 @@ nv20_vertprog_parse_decl_output(struct nv20_vpc *vpc,
return FALSE;
}
vpc->output_map[fdec->DeclarationRange.First] = hw;
vpc->output_map[fdec->Range.First] = hw;
return TRUE;
}

View file

@ -604,7 +604,7 @@ nv30_fragprog_parse_decl_attrib(struct nv30_fpc *fpc,
return FALSE;
}
fpc->attrib_map[fdec->DeclarationRange.First] = hw;
fpc->attrib_map[fdec->Range.First] = hw;
return TRUE;
}
@ -614,10 +614,10 @@ nv30_fragprog_parse_decl_output(struct nv30_fpc *fpc,
{
switch (fdec->Semantic.Name) {
case TGSI_SEMANTIC_POSITION:
fpc->depth_id = fdec->DeclarationRange.First;
fpc->depth_id = fdec->Range.First;
break;
case TGSI_SEMANTIC_COLOR:
fpc->colour_id = fdec->DeclarationRange.First;
fpc->colour_id = fdec->Range.First;
break;
default:
NOUVEAU_ERR("bad output semantic\n");
@ -653,9 +653,9 @@ nv30_fragprog_prepare(struct nv30_fpc *fpc)
goto out_err;
break;
/*case TGSI_FILE_TEMPORARY:
if (fdec->DeclarationRange.Last > high_temp) {
if (fdec->Range.Last > high_temp) {
high_temp =
fdec->DeclarationRange.Last;
fdec->Range.Last;
}
break;*/
default:

View file

@ -535,7 +535,7 @@ nv30_vertprog_parse_decl_output(struct nv30_vpc *vpc,
return FALSE;
}
vpc->output_map[fdec->DeclarationRange.First] = hw;
vpc->output_map[fdec->Range.First] = hw;
return TRUE;
}

View file

@ -676,7 +676,7 @@ nv40_fragprog_parse_decl_attrib(struct nv40_fpc *fpc,
return FALSE;
}
fpc->attrib_map[fdec->DeclarationRange.First] = hw;
fpc->attrib_map[fdec->Range.First] = hw;
return TRUE;
}
@ -684,7 +684,7 @@ static boolean
nv40_fragprog_parse_decl_output(struct nv40_fpc *fpc,
const struct tgsi_full_declaration *fdec)
{
unsigned idx = fdec->DeclarationRange.First;
unsigned idx = fdec->Range.First;
unsigned hw;
switch (fdec->Semantic.Name) {
@ -738,9 +738,9 @@ nv40_fragprog_prepare(struct nv40_fpc *fpc)
goto out_err;
break;
case TGSI_FILE_TEMPORARY:
if (fdec->DeclarationRange.Last > high_temp) {
if (fdec->Range.Last > high_temp) {
high_temp =
fdec->DeclarationRange.Last;
fdec->Range.Last;
}
break;
default:

View file

@ -577,7 +577,7 @@ static boolean
nv40_vertprog_parse_decl_output(struct nv40_vpc *vpc,
const struct tgsi_full_declaration *fdec)
{
unsigned idx = fdec->DeclarationRange.First;
unsigned idx = fdec->Range.First;
int hw;
switch (fdec->Semantic.Name) {
@ -652,16 +652,16 @@ nv40_vertprog_prepare(struct nv40_vpc *vpc)
fdec = &p.FullToken.FullDeclaration;
switch (fdec->Declaration.File) {
case TGSI_FILE_TEMPORARY:
if (fdec->DeclarationRange.Last > high_temp) {
if (fdec->Range.Last > high_temp) {
high_temp =
fdec->DeclarationRange.Last;
fdec->Range.Last;
}
break;
#if 0 /* this would be nice.. except gallium doesn't track it */
case TGSI_FILE_ADDRESS:
if (fdec->DeclarationRange.Last > high_addr) {
if (fdec->Range.Last > high_addr) {
high_addr =
fdec->DeclarationRange.Last;
fdec->Range.Last;
}
break;
#endif

View file

@ -2547,8 +2547,8 @@ nv50_program_tx_prep(struct nv50_pc *pc)
unsigned si, last, first, mode;
d = &tp.FullToken.FullDeclaration;
first = d->DeclarationRange.First;
last = d->DeclarationRange.Last;
first = d->Range.First;
last = d->Range.Last;
switch (d->Declaration.File) {
case TGSI_FILE_TEMPORARY:

View file

@ -79,19 +79,19 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
switch (decl->Semantic.Name) {
case TGSI_SEMANTIC_POSITION:
c->code->outputs[decl->DeclarationRange.First] = 0;
c->code->outputs[decl->Range.First] = 0;
break;
case TGSI_SEMANTIC_PSIZE:
c->code->outputs[decl->DeclarationRange.First] = 1;
c->code->outputs[decl->Range.First] = 1;
break;
case TGSI_SEMANTIC_COLOR:
c->code->outputs[decl->DeclarationRange.First] = 1 +
c->code->outputs[decl->Range.First] = 1 +
(pointsize ? 1 : 0) +
colors++;
break;
case TGSI_SEMANTIC_FOG:
case TGSI_SEMANTIC_GENERIC:
c->code->outputs[decl->DeclarationRange.First] = 1 +
c->code->outputs[decl->Range.First] = 1 +
(pointsize ? 1 : 0) +
out_colors +
generic++;

View file

@ -230,8 +230,8 @@ static boolean ps20_sampler( struct svga_shader_emitter *emit,
boolean svga_translate_decl_sm20( struct svga_shader_emitter *emit,
const struct tgsi_full_declaration *decl )
{
unsigned first = decl->DeclarationRange.First;
unsigned last = decl->DeclarationRange.Last;
unsigned first = decl->Range.First;
unsigned last = decl->Range.Last;
unsigned semantic = 0;
unsigned semantic_idx = 0;
unsigned idx;

View file

@ -335,8 +335,8 @@ static boolean ps30_sampler( struct svga_shader_emitter *emit,
boolean svga_translate_decl_sm30( struct svga_shader_emitter *emit,
const struct tgsi_full_declaration *decl )
{
unsigned first = decl->DeclarationRange.First;
unsigned last = decl->DeclarationRange.Last;
unsigned first = decl->Range.First;
unsigned last = decl->Range.Last;
unsigned semantic = 0;
unsigned semantic_idx = 0;
unsigned idx;