}
case PROGRAM_OUTPUT:
- /* This is only for PRINT */
- ASSERT(source->Index < FRAG_RESULT_MAX);
+ ASSERT(source->Index < MAX_PROGRAM_OUTPUTS);
return machine->Outputs[source->Index];
case PROGRAM_LOCAL_PARAM:
switch (dest->File) {
case PROGRAM_OUTPUT:
+ ASSERT(dest->Index < MAX_PROGRAM_OUTPUTS);
dstReg = machine->Outputs[dest->Index];
break;
case PROGRAM_TEMPORARY:
+ ASSERT(dest->Index < MAX_PROGRAM_TEMPS);
dstReg = machine->Temporaries[dest->Index];
break;
case PROGRAM_WRITE_ONLY:
GLuint unit, GLfloat color[4]);
+/** The larger of VERT_RESULT_MAX, FRAG_RESULT_MAX */
+#define MAX_PROGRAM_OUTPUTS VERT_RESULT_MAX
+
+
/**
* Virtual machine state used during execution of vertex/fragment programs.
*/
GLfloat VertAttribs[VERT_ATTRIB_MAX][4];
GLfloat Temporaries[MAX_PROGRAM_TEMPS][4];
- GLfloat Outputs[FRAG_RESULT_MAX][4];
+ GLfloat Outputs[MAX_PROGRAM_OUTPUTS][4];
GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */
GLint AddressReg[MAX_VERTEX_PROGRAM_ADDRESS_REGS][4];