aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-02-23 09:00:58 -0800
committerPaul Berry <[email protected]>2013-03-15 09:26:17 -0700
commiteed6baf7621fa94e7888f8079b155fc67a08540c (patch)
tree216270e7f3222fcb11b8b3fa1def330908f05a21 /src/mesa/program
parentf117abe66414e25be4f7bc61ca0df9e83ddaf543 (diff)
Replace gl_frag_attrib enum with gl_varying_slot.
This patch makes the following search-and-replace changes: gl_frag_attrib -> gl_varying_slot FRAG_ATTRIB_* -> VARYING_SLOT_* FRAG_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp4
-rw-r--r--src/mesa/program/prog_execute.c6
-rw-r--r--src/mesa/program/prog_print.c16
-rw-r--r--src/mesa/program/program.c10
-rw-r--r--src/mesa/program/program_parse.y8
-rw-r--r--src/mesa/program/programopt.c14
6 files changed, 29 insertions, 29 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 486cf4639ce..2cb5f02f498 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -93,7 +93,7 @@ public:
explicit src_reg(dst_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */
- int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
+ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
int negate; /**< NEGATE_XYZW mask from mesa */
/** Register index should be offset by the integer in this reg. */
@@ -123,7 +123,7 @@ public:
explicit dst_reg(src_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */
- int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
+ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
GLuint cond_mask:4;
/** Register index should be offset by the integer in this reg. */
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index fe2359bc24f..d205cdbbe77 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -108,7 +108,7 @@ get_src_register_pointer(const struct prog_src_register *source,
return machine->VertAttribs[reg];
}
else {
- if (reg >= FRAG_ATTRIB_MAX)
+ if (reg >= VARYING_SLOT_MAX)
return ZeroVec;
return machine->Attribs[reg][machine->CurElement];
}
@@ -283,7 +283,7 @@ fetch_vector4_deriv(struct gl_context * ctx,
if (source->File == PROGRAM_INPUT &&
source->Index < (GLint) machine->NumDeriv) {
const GLint col = machine->CurElement;
- const GLfloat w = machine->Attribs[FRAG_ATTRIB_WPOS][col][3];
+ const GLfloat w = machine->Attribs[VARYING_SLOT_POS][col][3];
const GLfloat invQ = 1.0f / w;
GLfloat deriv[4];
@@ -371,7 +371,7 @@ fetch_texel(struct gl_context *ctx,
*/
if (machine->NumDeriv > 0 &&
inst->SrcReg[0].File == PROGRAM_INPUT &&
- inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit) {
+ inst->SrcReg[0].Index == VARYING_SLOT_TEX0 + inst->TexSrcUnit) {
/* simple texture fetch for which we should have derivatives */
GLuint attr = inst->SrcReg[0].Index;
machine->FetchTexelDeriv(ctx, texcoord,
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index d740bf7d985..c73f10df5cf 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -89,7 +89,7 @@ static const char *
arb_input_attrib_string(GLint index, GLenum progType)
{
/*
- * These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens.
+ * These strings should match the VERT_ATTRIB_x and VARYING_SLOT_x tokens.
*/
static const char *const vertAttribs[] = {
"vertex.position",
@@ -144,12 +144,12 @@ arb_input_attrib_string(GLint index, GLenum progType)
"fragment.(fourteen)", /* VARYING_SLOT_BFC1 */
"fragment.(fifteen)", /* VARYING_SLOT_EDGE */
"fragment.(sixteen)", /* VARYING_SLOT_CLIP_VERTEX */
- "fragment.(seventeen)", /* FRAG_ATTRIB_CLIP_DIST0 */
- "fragment.(eighteen)", /* FRAG_ATTRIB_CLIP_DIST1 */
+ "fragment.(seventeen)", /* VARYING_SLOT_CLIP_DIST0 */
+ "fragment.(eighteen)", /* VARYING_SLOT_CLIP_DIST1 */
"fragment.(nineteen)", /* VARYING_SLOT_PRIMITIVE_ID */
"fragment.(twenty)", /* VARYING_SLOT_LAYER */
- "fragment.(twenty-one)", /* FRAG_ATTRIB_FACE */
- "fragment.(twenty-two)", /* FRAG_ATTRIB_PNTC */
+ "fragment.(twenty-one)", /* VARYING_SLOT_FACE */
+ "fragment.(twenty-two)", /* VARYING_SLOT_PNTC */
"fragment.varying[0]",
"fragment.varying[1]",
"fragment.varying[2]",
@@ -186,11 +186,11 @@ arb_input_attrib_string(GLint index, GLenum progType)
/* sanity checks */
STATIC_ASSERT(Elements(vertAttribs) == VERT_ATTRIB_MAX);
- STATIC_ASSERT(Elements(fragAttribs) == FRAG_ATTRIB_MAX);
+ STATIC_ASSERT(Elements(fragAttribs) == VARYING_SLOT_MAX);
assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
- assert(strcmp(fragAttribs[FRAG_ATTRIB_TEX0], "fragment.texcoord[0]") == 0);
- assert(strcmp(fragAttribs[FRAG_ATTRIB_VAR0+15], "fragment.varying[15]") == 0);
+ assert(strcmp(fragAttribs[VARYING_SLOT_TEX0], "fragment.texcoord[0]") == 0);
+ assert(strcmp(fragAttribs[VARYING_SLOT_VAR0+15], "fragment.varying[15]") == 0);
if (progType == GL_VERTEX_PROGRAM_ARB) {
assert(index < Elements(vertAttribs));
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index bc7ab1ef814..2ef969ff77b 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -738,7 +738,7 @@ _mesa_combine_programs(struct gl_context *ctx,
* of progB_colorFile/progB_colorIndex below...
*/
progB_colorFile = PROGRAM_INPUT;
- progB_colorIndex = FRAG_ATTRIB_COL0;
+ progB_colorIndex = VARYING_SLOT_COL0;
/*
* The fragment program may get color from a state var rather than
@@ -754,7 +754,7 @@ _mesa_combine_programs(struct gl_context *ctx,
p->StateIndexes[0] == STATE_INTERNAL &&
p->StateIndexes[1] == STATE_CURRENT_ATTRIB &&
(int) p->StateIndexes[2] == (int) VERT_ATTRIB_COLOR0) {
- progB_inputsRead |= FRAG_BIT_COL0;
+ progB_inputsRead |= VARYING_BIT_COL0;
progB_colorFile = PROGRAM_STATE_VAR;
progB_colorIndex = i;
break;
@@ -765,7 +765,7 @@ _mesa_combine_programs(struct gl_context *ctx,
* new temporary register.
*/
if ((progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) &&
- (progB_inputsRead & FRAG_BIT_COL0)) {
+ (progB_inputsRead & VARYING_BIT_COL0)) {
GLint tempReg = _mesa_find_free_register(usedTemps, MAX_PROGRAM_TEMPS,
firstTemp);
if (tempReg < 0) {
@@ -788,7 +788,7 @@ _mesa_combine_programs(struct gl_context *ctx,
/* compute combined program's InputsRead */
inputsB = progB_inputsRead;
if (progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
- inputsB &= ~(1 << FRAG_ATTRIB_COL0);
+ inputsB &= ~(1 << VARYING_SLOT_COL0);
}
newProg->InputsRead = progA->InputsRead | inputsB;
newProg->OutputsWritten = progB->OutputsWritten;
@@ -934,7 +934,7 @@ _mesa_valid_register_index(const struct gl_context *ctx,
case MESA_SHADER_VERTEX:
return index < VERT_ATTRIB_GENERIC0 + (GLint) c->MaxAttribs;
case MESA_SHADER_FRAGMENT:
- return index < FRAG_ATTRIB_VAR0 + (GLint) ctx->Const.MaxVarying;
+ return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
case MESA_SHADER_GEOMETRY:
return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
default:
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index c9df3e64f90..81d85f9fb1b 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -1187,19 +1187,19 @@ vtxWeightNum: INTEGER;
fragAttribItem: POSITION
{
- $$ = FRAG_ATTRIB_WPOS;
+ $$ = VARYING_SLOT_POS;
}
| COLOR optColorType
{
- $$ = FRAG_ATTRIB_COL0 + $2;
+ $$ = VARYING_SLOT_COL0 + $2;
}
| FOGCOORD
{
- $$ = FRAG_ATTRIB_FOGC;
+ $$ = VARYING_SLOT_FOGC;
}
| TEXCOORD optTexCoordUnitNum
{
- $$ = FRAG_ATTRIB_TEX0 + $2;
+ $$ = VARYING_SLOT_TEX0 + $2;
}
;
diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c
index 19890802b79..d40ffd543a9 100644
--- a/src/mesa/program/programopt.c
+++ b/src/mesa/program/programopt.c
@@ -240,7 +240,7 @@ _mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
* \param saturate True if writes to color outputs should be clamped to [0, 1]
*
* \note
- * This function sets \c FRAG_BIT_FOGC in \c fprog->Base.InputsRead.
+ * This function sets \c VARYING_BIT_FOGC in \c fprog->Base.InputsRead.
*
* \todo With a little work, this function could be adapted to add fog code
* to vertex programs too.
@@ -323,7 +323,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
inst->DstReg.Index = fogFactorTemp;
inst->DstReg.WriteMask = WRITEMASK_X;
inst->SrcReg[0].File = PROGRAM_INPUT;
- inst->SrcReg[0].Index = FRAG_ATTRIB_FOGC;
+ inst->SrcReg[0].Index = VARYING_SLOT_FOGC;
inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
inst->SrcReg[1].File = PROGRAM_STATE_VAR;
inst->SrcReg[1].Index = fogPRefOpt;
@@ -348,7 +348,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
inst->SrcReg[0].Swizzle
= (fog_mode == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW;
inst->SrcReg[1].File = PROGRAM_INPUT;
- inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC;
+ inst->SrcReg[1].Index = VARYING_SLOT_FOGC;
inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
inst++;
if (fog_mode == GL_EXP2) {
@@ -411,7 +411,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
/* install new instructions */
fprog->Base.Instructions = newInst;
fprog->Base.NumInstructions = inst - newInst;
- fprog->Base.InputsRead |= FRAG_BIT_FOGC;
+ fprog->Base.InputsRead |= VARYING_BIT_FOGC;
assert(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR));
}
@@ -615,10 +615,10 @@ _mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *p
inst[0].DstReg.File = PROGRAM_OUTPUT;
inst[0].DstReg.Index = FRAG_RESULT_COLOR;
inst[0].SrcReg[0].File = PROGRAM_INPUT;
- if (prog->Base.InputsRead & FRAG_BIT_COL0)
- inputAttr = FRAG_ATTRIB_COL0;
+ if (prog->Base.InputsRead & VARYING_BIT_COL0)
+ inputAttr = VARYING_SLOT_COL0;
else
- inputAttr = FRAG_ATTRIB_TEX0;
+ inputAttr = VARYING_SLOT_TEX0;
inst[0].SrcReg[0].Index = inputAttr;
inst[1].Opcode = OPCODE_END;