* and gl_InstanceID."
*/
return var->data.location == SYSTEM_VALUE_VERTEX_ID ||
+ var->data.location == SYSTEM_VALUE_VERTEX_ID_ZERO_BASE ||
var->data.location == SYSTEM_VALUE_INSTANCE_ID;
default:
continue;
if (current_index == desired_index) {
- _mesa_copy_string(name, maxLength, length, var->name);
+ const char *var_name = var->name;
+
+ /* Since gl_VertexID may be lowered to gl_VertexIDMESA, we need to
+ * consider gl_VertexIDMESA as gl_VertexID for purposes of checking
+ * active attributes.
+ */
+ if (var->data.mode == ir_var_system_value &&
+ var->data.location == SYSTEM_VALUE_VERTEX_ID_ZERO_BASE) {
+ var_name = "gl_VertexID";
+ }
+
+ _mesa_copy_string(name, maxLength, length, var_name);
if (size)
*size = (var->type->is_array()) ? var->type->length : 1;