GLuint numInst; /* number of instructions parsed */
GLuint inputsRead; /* bitmask of input registers used */
- GLuint outputsWritten; /* 2 = depth register */
+ GLuint outputsWritten; /* bitmask of 1 << FRAG_OUTPUT_* bits */
GLuint texturesUsed[MAX_TEXTURE_IMAGE_UNITS];
};
/**
* Parse a floating point constant, or a defined symbol name.
* [+/-]N[.N[eN]]
+ * Output: number[0 .. 3] will get the value.
*/
static GLboolean
Parse_ScalarConstant(struct parse_state *parseState, GLfloat *number)
if (end && end > (char *) parseState->pos) {
/* got a number */
parseState->pos = (GLubyte *) end;
+ number[1] = *number;
+ number[2] = *number;
+ number[3] = *number;
return GL_TRUE;
}
else {
/* 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_OUTPUT_COLR) | (1 << FRAG_OUTPUT_COLH);
*outputRegNum = FP_OUTPUT_REG_START + j;
parseState->outputsWritten |= (1 << j);
- if ((parseState->outputsWritten & 0x3) == 0x3) {
+ if ((parseState->outputsWritten & bothColors) == bothColors) {
RETURN_ERROR1("Illegal to write to both o[COLR] and o[COLH]");
}
break;
srcReg->IsParameter = GL_TRUE;
srcReg->Register = paramIndex;
}
- else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+'){
+ else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){
/* literal scalar constant */
GLfloat values[4];
+ GLuint paramIndex;
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
+#if 0
srcReg->Register = 0; /* XXX fix */
+#else
+ paramIndex = add_unnamed_constant(parseState, values);
+ srcReg->IsParameter = GL_TRUE;
+ srcReg->Register = paramIndex;
+#endif
}
else if (token[0] == '{'){
/* literal vector constant */
-/* $Id: nvfragprog.h,v 1.6 2003/04/05 00:38:09 brianp Exp $ */
+/* $Id: nvfragprog.h,v 1.7 2003/05/10 04:36:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
#define FRAG_ATTRIB_TEX6 10
#define FRAG_ATTRIB_TEX7 11
+#define FRAG_OUTPUT_COLR 0
+#define FRAG_OUTPUT_COLH 1
+#define FRAG_OUTPUT_DEPR 2
+
/* Location of register sets within the whole register file */
#define FP_INPUT_REG_START 0