Replace gl_vert_result enum with gl_varying_slot.
This patch makes the following search-and-replace changes: gl_vert_result -> gl_varying_slot VERT_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -168,7 +168,7 @@ st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp)
|
||||
|
||||
/**
|
||||
* Translate a Mesa vertex shader into a TGSI shader.
|
||||
* \param outputMapping to map vertex program output registers (VERT_RESULT_x)
|
||||
* \param outputMapping to map vertex program output registers (VARYING_SLOT_x)
|
||||
* to TGSI output slots
|
||||
* \param tokensOut destination for TGSI tokens
|
||||
* \return pointer to cached pipe_shader object.
|
||||
@@ -205,7 +205,7 @@ st_prepare_vertex_program(struct gl_context *ctx,
|
||||
|
||||
/* Compute mapping of vertex program outputs to slots.
|
||||
*/
|
||||
for (attr = 0; attr < VERT_RESULT_MAX; attr++) {
|
||||
for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
|
||||
if ((stvp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) {
|
||||
stvp->result_to_output[attr] = ~0;
|
||||
}
|
||||
@@ -215,76 +215,76 @@ st_prepare_vertex_program(struct gl_context *ctx,
|
||||
stvp->result_to_output[attr] = slot;
|
||||
|
||||
switch (attr) {
|
||||
case VERT_RESULT_HPOS:
|
||||
case VARYING_SLOT_POS:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_COL0:
|
||||
case VARYING_SLOT_COL0:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_COL1:
|
||||
case VARYING_SLOT_COL1:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
|
||||
stvp->output_semantic_index[slot] = 1;
|
||||
break;
|
||||
case VERT_RESULT_BFC0:
|
||||
case VARYING_SLOT_BFC0:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_BFC1:
|
||||
case VARYING_SLOT_BFC1:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
|
||||
stvp->output_semantic_index[slot] = 1;
|
||||
break;
|
||||
case VERT_RESULT_FOGC:
|
||||
case VARYING_SLOT_FOGC:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_PSIZ:
|
||||
case VARYING_SLOT_PSIZ:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_CLIP_DIST0:
|
||||
case VARYING_SLOT_CLIP_DIST0:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
case VERT_RESULT_CLIP_DIST1:
|
||||
case VARYING_SLOT_CLIP_DIST1:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
|
||||
stvp->output_semantic_index[slot] = 1;
|
||||
break;
|
||||
case VERT_RESULT_EDGE:
|
||||
case VARYING_SLOT_EDGE:
|
||||
assert(0);
|
||||
break;
|
||||
case VERT_RESULT_CLIP_VERTEX:
|
||||
case VARYING_SLOT_CLIP_VERTEX:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPVERTEX;
|
||||
stvp->output_semantic_index[slot] = 0;
|
||||
break;
|
||||
|
||||
case VERT_RESULT_TEX0:
|
||||
case VERT_RESULT_TEX1:
|
||||
case VERT_RESULT_TEX2:
|
||||
case VERT_RESULT_TEX3:
|
||||
case VERT_RESULT_TEX4:
|
||||
case VERT_RESULT_TEX5:
|
||||
case VERT_RESULT_TEX6:
|
||||
case VERT_RESULT_TEX7:
|
||||
case VARYING_SLOT_TEX0:
|
||||
case VARYING_SLOT_TEX1:
|
||||
case VARYING_SLOT_TEX2:
|
||||
case VARYING_SLOT_TEX3:
|
||||
case VARYING_SLOT_TEX4:
|
||||
case VARYING_SLOT_TEX5:
|
||||
case VARYING_SLOT_TEX6:
|
||||
case VARYING_SLOT_TEX7:
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
|
||||
stvp->output_semantic_index[slot] = attr - VERT_RESULT_TEX0;
|
||||
stvp->output_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
|
||||
break;
|
||||
|
||||
case VERT_RESULT_VAR0:
|
||||
case VARYING_SLOT_VAR0:
|
||||
default:
|
||||
assert(attr < VERT_RESULT_MAX);
|
||||
assert(attr < VARYING_SLOT_MAX);
|
||||
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
|
||||
stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 -
|
||||
FRAG_ATTRIB_TEX0 +
|
||||
attr -
|
||||
VERT_RESULT_VAR0);
|
||||
VARYING_SLOT_VAR0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* similar hack to above, presetup potentially unused edgeflag output */
|
||||
stvp->result_to_output[VERT_RESULT_EDGE] = stvp->num_outputs;
|
||||
stvp->result_to_output[VARYING_SLOT_EDGE] = stvp->num_outputs;
|
||||
stvp->output_semantic_name[stvp->num_outputs] = TGSI_SEMANTIC_EDGEFLAG;
|
||||
stvp->output_semantic_index[stvp->num_outputs] = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user