mesa: implement system values in program interpreter
authorBrian Paul <brianp@vmware.com>
Fri, 10 Dec 2010 16:29:00 +0000 (09:29 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 10 Dec 2010 16:29:00 +0000 (09:29 -0700)
src/mesa/program/prog_execute.c
src/mesa/program/prog_execute.h

index 1d97a077f525fc08eafbfa165f4f403f6e114667..c20347fe67882585566de056ee49791f99a3f04d 100644 (file)
@@ -159,6 +159,10 @@ get_src_register_pointer(const struct prog_src_register *source,
          return ZeroVec;
       return prog->Parameters->ParameterValues[reg];
 
+   case PROGRAM_SYSTEM_VALUE:
+      assert(reg < Elements(machine->SystemValues));
+      return machine->SystemValues[reg];
+
    default:
       _mesa_problem(NULL,
          "Invalid src register file %d in get_src_register_pointer()",
index cefd468c36bfe531ba23991946bca7b9a507f1eb..cdf37082a0003e76a172894bdf831c2801ea4df5 100644 (file)
@@ -61,6 +61,7 @@ struct gl_program_machine
    GLfloat (*EnvParams)[4]; /**< Vertex or Fragment env parameters */
    GLuint CondCodes[4];  /**< COND_* value for x/y/z/w */
    GLint AddressReg[MAX_PROGRAM_ADDRESS_REGS][4];
+   GLfloat SystemValues[SYSTEM_VALUE_MAX][4];
 
    const GLubyte *Samplers;  /** Array mapping sampler var to tex unit */