summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/prog_print.c22
-rw-r--r--src/mesa/program/program.c2
-rw-r--r--src/mesa/program/program_parse.y16
-rw-r--r--src/mesa/program/programopt.c18
4 files changed, 29 insertions, 29 deletions
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index e5592cf3668..8617cfb5772 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -241,7 +241,7 @@ static const char *
arb_output_attrib_string(GLint index, GLenum progType)
{
/*
- * These strings should match the VERT_RESULT_x and FRAG_RESULT_x tokens.
+ * These strings should match the VARYING_SLOT_x and FRAG_RESULT_x tokens.
*/
static const char *const vertResults[] = {
"result.position",
@@ -256,13 +256,13 @@ arb_output_attrib_string(GLint index, GLenum progType)
"result.texcoord[5]",
"result.texcoord[6]",
"result.texcoord[7]",
- "result.pointsize", /* VERT_RESULT_PSIZ */
- "result.(thirteen)", /* VERT_RESULT_BFC0 */
- "result.(fourteen)", /* VERT_RESULT_BFC1 */
- "result.(fifteen)", /* VERT_RESULT_EDGE */
- "result.(sixteen)", /* VERT_RESULT_CLIP_VERTEX */
- "result.(seventeen)", /* VERT_RESULT_CLIP_DIST0 */
- "result.(eighteen)", /* VERT_RESULT_CLIP_DIST1 */
+ "result.pointsize", /* VARYING_SLOT_PSIZ */
+ "result.(thirteen)", /* VARYING_SLOT_BFC0 */
+ "result.(fourteen)", /* VARYING_SLOT_BFC1 */
+ "result.(fifteen)", /* VARYING_SLOT_EDGE */
+ "result.(sixteen)", /* VARYING_SLOT_CLIP_VERTEX */
+ "result.(seventeen)", /* VARYING_SLOT_CLIP_DIST0 */
+ "result.(eighteen)", /* VARYING_SLOT_CLIP_DIST1 */
"result.(nineteen)", /* VARYING_SLOT_PRIMITIVE_ID */
"result.(twenty)", /* VARYING_SLOT_LAYER */
"result.(twenty-one)", /* VARYING_SLOT_FACE */
@@ -315,10 +315,10 @@ arb_output_attrib_string(GLint index, GLenum progType)
};
/* sanity checks */
- STATIC_ASSERT(Elements(vertResults) == VERT_RESULT_MAX);
+ STATIC_ASSERT(Elements(vertResults) == VARYING_SLOT_MAX);
STATIC_ASSERT(Elements(fragResults) == FRAG_RESULT_MAX);
- assert(strcmp(vertResults[VERT_RESULT_HPOS], "result.position") == 0);
- assert(strcmp(vertResults[VERT_RESULT_VAR0], "result.varying[0]") == 0);
+ assert(strcmp(vertResults[VARYING_SLOT_POS], "result.position") == 0);
+ assert(strcmp(vertResults[VARYING_SLOT_VAR0], "result.varying[0]") == 0);
assert(strcmp(fragResults[FRAG_RESULT_DATA0], "result.color[0]") == 0);
if (progType == GL_VERTEX_PROGRAM_ARB) {
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index fb0aeb7edaa..e235d6ce68a 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -947,7 +947,7 @@ _mesa_valid_register_index(const struct gl_context *ctx,
switch (shaderType) {
case MESA_SHADER_VERTEX:
- return index < VERT_RESULT_VAR0 + (GLint) ctx->Const.MaxVarying;
+ return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
case MESA_SHADER_FRAGMENT:
return index < FRAG_RESULT_DATA0 + (GLint) ctx->Const.MaxDrawBuffers;
case MESA_SHADER_GEOMETRY:
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 025b54706da..c9df3e64f90 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -643,7 +643,7 @@ maskedDstReg: dstReg optionalMask optionalCcMask
* set in fragment program mode, so it is somewhat irrelevant.
*/
if (state->option.PositionInvariant
- && ($$.Index == VERT_RESULT_HPOS)) {
+ && ($$.Index == VARYING_SLOT_POS)) {
yyerror(& @1, state, "position-invariant programs cannot "
"write position");
YYERROR;
@@ -2005,7 +2005,7 @@ OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding
resultBinding: RESULT POSITION
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_HPOS;
+ $$ = VARYING_SLOT_POS;
} else {
yyerror(& @2, state, "invalid program result name");
YYERROR;
@@ -2014,7 +2014,7 @@ resultBinding: RESULT POSITION
| RESULT FOGCOORD
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_FOGC;
+ $$ = VARYING_SLOT_FOGC;
} else {
yyerror(& @2, state, "invalid program result name");
YYERROR;
@@ -2027,7 +2027,7 @@ resultBinding: RESULT POSITION
| RESULT POINTSIZE
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_PSIZ;
+ $$ = VARYING_SLOT_PSIZ;
} else {
yyerror(& @2, state, "invalid program result name");
YYERROR;
@@ -2036,7 +2036,7 @@ resultBinding: RESULT POSITION
| RESULT TEXCOORD optTexCoordUnitNum
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_TEX0 + $3;
+ $$ = VARYING_SLOT_TEX0 + $3;
} else {
yyerror(& @2, state, "invalid program result name");
YYERROR;
@@ -2062,7 +2062,7 @@ resultColBinding: COLOR optResultFaceType optResultColorType
optResultFaceType:
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_COL0;
+ $$ = VARYING_SLOT_COL0;
} else {
if (state->option.DrawBuffers)
$$ = FRAG_RESULT_DATA0;
@@ -2101,7 +2101,7 @@ optResultFaceType:
| FRONT
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_COL0;
+ $$ = VARYING_SLOT_COL0;
} else {
yyerror(& @1, state, "invalid program result name");
YYERROR;
@@ -2110,7 +2110,7 @@ optResultFaceType:
| BACK
{
if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_BFC0;
+ $$ = VARYING_SLOT_BFC0;
} else {
yyerror(& @1, state, "invalid program result name");
YYERROR;
diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c
index 2a37021988a..19890802b79 100644
--- a/src/mesa/program/programopt.c
+++ b/src/mesa/program/programopt.c
@@ -89,7 +89,7 @@ _mesa_insert_mvp_dp4_code(struct gl_context *ctx, struct gl_vertex_program *vpro
for (i = 0; i < 4; i++) {
newInst[i].Opcode = OPCODE_DP4;
newInst[i].DstReg.File = PROGRAM_OUTPUT;
- newInst[i].DstReg.Index = VERT_RESULT_HPOS;
+ newInst[i].DstReg.Index = VARYING_SLOT_POS;
newInst[i].DstReg.WriteMask = (WRITEMASK_X << i);
newInst[i].SrcReg[0].File = PROGRAM_STATE_VAR;
newInst[i].SrcReg[0].Index = mvpRef[i];
@@ -109,7 +109,7 @@ _mesa_insert_mvp_dp4_code(struct gl_context *ctx, struct gl_vertex_program *vpro
vprog->Base.Instructions = newInst;
vprog->Base.NumInstructions = newLen;
vprog->Base.InputsRead |= VERT_BIT_POS;
- vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
+ vprog->Base.OutputsWritten |= BITFIELD64_BIT(VARYING_SLOT_POS);
}
@@ -188,7 +188,7 @@ _mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vpro
newInst[3].Opcode = OPCODE_MAD;
newInst[3].DstReg.File = PROGRAM_OUTPUT;
- newInst[3].DstReg.Index = VERT_RESULT_HPOS;
+ newInst[3].DstReg.Index = VARYING_SLOT_POS;
newInst[3].DstReg.WriteMask = WRITEMASK_XYZW;
newInst[3].SrcReg[0].File = PROGRAM_INPUT;
newInst[3].SrcReg[0].Index = VERT_ATTRIB_POS;
@@ -211,7 +211,7 @@ _mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vpro
vprog->Base.Instructions = newInst;
vprog->Base.NumInstructions = newLen;
vprog->Base.InputsRead |= VERT_BIT_POS;
- vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
+ vprog->Base.OutputsWritten |= BITFIELD64_BIT(VARYING_SLOT_POS);
}
@@ -507,7 +507,7 @@ void
_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
{
GLuint i;
- GLint outputMap[VERT_RESULT_MAX];
+ GLint outputMap[VARYING_SLOT_MAX];
GLuint numVaryingReads = 0;
GLboolean usedTemps[MAX_PROGRAM_TEMPS];
GLuint firstTemp = 0;
@@ -517,7 +517,7 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
assert(type == PROGRAM_OUTPUT);
- for (i = 0; i < VERT_RESULT_MAX; i++)
+ for (i = 0; i < VARYING_SLOT_MAX; i++)
outputMap[i] = -1;
/* look for instructions which read from varying vars */
@@ -576,7 +576,7 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
/* insert new MOV instructions here */
inst = prog->Instructions + endPos;
- for (var = 0; var < VERT_RESULT_MAX; var++) {
+ for (var = 0; var < VARYING_SLOT_MAX; var++) {
if (outputMap[var] >= 0) {
/* MOV VAR[var], TEMP[tmp]; */
inst->Opcode = OPCODE_MOV;
@@ -657,7 +657,7 @@ _mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog)
inst[0].Opcode = OPCODE_MOV;
inst[0].DstReg.File = PROGRAM_OUTPUT;
- inst[0].DstReg.Index = VERT_RESULT_COL0;
+ inst[0].DstReg.Index = VARYING_SLOT_COL0;
inst[0].SrcReg[0].File = PROGRAM_INPUT;
if (prog->Base.InputsRead & VERT_BIT_COLOR0)
inputAttr = VERT_ATTRIB_COLOR0;
@@ -673,7 +673,7 @@ _mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog)
prog->Base.Instructions = inst;
prog->Base.NumInstructions = 2;
prog->Base.InputsRead = BITFIELD64_BIT(inputAttr);
- prog->Base.OutputsWritten = BITFIELD64_BIT(VERT_RESULT_COL0);
+ prog->Base.OutputsWritten = BITFIELD64_BIT(VARYING_SLOT_COL0);
/*
* Now insert code to do standard modelview/projection transformation.