From 8d475822e6e19fa79719c856a2db5b6a205db1b9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 28 Feb 2009 11:49:46 -0700 Subject: mesa: rename, reorder FRAG_RESULT_x tokens s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc). --- src/mesa/shader/nvfragparse.c | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 20e4781372..37418ffb6e 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -384,18 +384,12 @@ static const char *InputRegisters[MAX_NV_FRAGMENT_PROGRAM_INPUTS + 1] = { "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL }; + static const char *OutputRegisters[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS + 1] = { - "COLR", "COLH", - /* These are only allows for register combiners */ - /* - "TEX0", "TEX1", "TEX2", "TEX3", - */ - "DEPR", NULL + "DEPR", "COLR", "DATA0", NULL }; - - /**********************************************************************/ /** @@ -828,7 +822,6 @@ static GLboolean Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) { GLubyte token[100]; - GLint j; /* Match "o[" */ if (!Parse_String(parseState, "o[")) @@ -839,19 +832,19 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) RETURN_ERROR; /* try to match an output register name */ - for (j = 0; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { - static GLuint bothColors = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_COLH); - *outputRegNum = j; - parseState->outputsWritten |= (1 << j); - if ((parseState->outputsWritten & bothColors) == bothColors) { - RETURN_ERROR1("Illegal to write to both o[COLR] and o[COLH]"); - } - break; - } + if (_mesa_strcmp((char *) token, "COLR") == 0 || + _mesa_strcmp((char *) token, "COLH") == 0) { + /* note that we don't distinguish between COLR and COLH */ + *outputRegNum = FRAG_RESULT_COLOR; + parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR); } - if (!OutputRegisters[j]) + else if (_mesa_strcmp((char *) token, "DEPR") == 0) { + *outputRegNum = FRAG_RESULT_DEPTH; + parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); + } + else { RETURN_ERROR1("Invalid output register name"); + } /* Match ']' */ if (!Parse_String(parseState, "]")) @@ -1826,10 +1819,3 @@ _mesa_nv_fragment_input_register_name(GLuint i) return InputRegisters[i]; } - -const char * -_mesa_nv_fragment_output_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); - return OutputRegisters[i]; -} -- cgit v1.2.3