{NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW},
};
+static struct gl_builtin_uniform_element gl_CurrentAttribVertMESA_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_CURRENT_ATTRIB, 0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_CurrentAttribFragMESA_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, 0}, SWIZZLE_XYZW},
+};
+
#define MATRIX(name, statevar, modifier) \
static struct gl_builtin_uniform_element name ## _elements[] = { \
{ NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \
STATEVAR(gl_MESABumpRotMatrix0),
STATEVAR(gl_MESABumpRotMatrix1),
STATEVAR(gl_MESAFogParamsOptimized),
+ STATEVAR(gl_CurrentAttribVertMESA),
+ STATEVAR(gl_CurrentAttribFragMESA),
{NULL, NULL, 0}
};
memcpy(slots->tokens, element->tokens, sizeof(element->tokens));
if (type->is_array()) {
- slots->tokens[1] = a;
+ if (strcmp(name, "gl_CurrentAttribVertMESA") == 0 ||
+ strcmp(name, "gl_CurrentAttribFragMESA") == 0) {
+ slots->tokens[2] = a;
+ } else {
+ slots->tokens[1] = a;
+ }
}
slots->swizzle = element->swizzle;
add_uniform(instructions, symtab, "gl_Fog",
symtab->get_type("gl_FogParameters"));
+
+ /* Mesa-internal current attrib state */
+ const glsl_type *const vert_attribs =
+ glsl_type::get_array_instance(glsl_type::vec4_type, VERT_ATTRIB_MAX);
+ add_uniform(instructions, symtab, "gl_CurrentAttribVertMESA", vert_attribs);
+ const glsl_type *const frag_attribs =
+ glsl_type::get_array_instance(glsl_type::vec4_type, FRAG_ATTRIB_MAX);
+ add_uniform(instructions, symtab, "gl_CurrentAttribFragMESA", frag_attribs);
}
/* This function should only be called for ES, not desktop GL. */