mesa: rework ParameterList to allow packing
[mesa.git] / src / mesa / program / prog_opt_constant_fold.c
index ba4a954186ab2f894598ca3d2d82ac0c9b2f51db..638bdbd1507636ab5c6b2f3448dac4ff89571a18 100644 (file)
@@ -90,8 +90,9 @@ src_regs_are_same(const struct prog_src_register *a,
 static void
 get_value(struct gl_program *prog, struct prog_src_register *r, float *data)
 {
+   unsigned pvo = prog->Parameters->ParameterValueOffset[r->Index];
    const gl_constant_value *const value =
-      prog->Parameters->ParameterValues[r->Index];
+      prog->Parameters->ParameterValues + pvo;
 
    data[0] = value[GET_SWZ(r->Swizzle, 0)].f;
    data[1] = value[GET_SWZ(r->Swizzle, 1)].f;