From a414e2f548596a839047828c66502408e4525010 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 1 Oct 2012 16:20:10 +0100 Subject: [PATCH] vbo: generic[0] only aliases pos if API=GL This fixes the case where we are running with the gles2 or gl-core apis (with no legacy attributes) to refer to the current value of generic[0] if not enabled instead of falling back to the legacy position attribute. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503 --- src/mesa/vbo/vbo_exec_array.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index f0ef205..a75a7bb 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -473,11 +473,18 @@ recalculate_input_bindings(struct gl_context *ctx) * Otherwise, legacy attributes available in the legacy slots, * generic attributes in the generic slots and materials are not * available as per-vertex attributes. + * + * If we aren't running with the legacy GL profile, with deprecated + * features, (GLES2 or GL_CORE) then generic[0] has its own current value + * instead of being an alias for the legacy position array. */ if (vertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) inputs[0] = &vertexAttrib[VERT_ATTRIB_GENERIC0]; - else if (vertexAttrib[VERT_ATTRIB_POS].Enabled) - inputs[0] = &vertexAttrib[VERT_ATTRIB_POS]; + else if (ctx->API != API_OPENGL) { + inputs[0] = &vbo->currval[VBO_ATTRIB_GENERIC0]; + const_inputs |= VERT_BIT_GENERIC(0); + } else if (vertexAttrib[VERT_ATTRIB_POS].Enabled) + inputs[0] = &vertexAttrib[VERT_ATTRIB_POS]; else { inputs[0] = &vbo->currval[VBO_ATTRIB_POS]; const_inputs |= VERT_BIT_POS; -- 1.7.7.6