summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/vbo/vbo_attrib_tmp.h7
-rw-r--r--src/mesa/vbo/vbo_exec_array.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h
index 5718ac5a092..126e4ef0d6e 100644
--- a/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/src/mesa/vbo/vbo_attrib_tmp.h
@@ -524,15 +524,18 @@ TAG(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
/**
* If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
+ * It depends on a few things, including whether we're inside or outside
+ * of glBegin/glEnd.
*/
static inline bool
is_vertex_position(const struct gl_context *ctx, GLuint index)
{
- return index == 0 && _mesa_attr_zero_aliases_vertex(ctx);
+ return (index == 0 &&
+ _mesa_attr_zero_aliases_vertex(ctx) &&
+ _mesa_inside_begin_end(ctx));
}
-
static void GLAPIENTRY
TAG(VertexAttrib1fARB)(GLuint index, GLfloat x)
{
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index edd55ce69e2..e3421fa9b51 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -356,7 +356,7 @@ recalculate_input_bindings(struct gl_context *ctx)
else if (array[VERT_ATTRIB_POS].Enabled)
inputs[0] = &vertexAttrib[VERT_ATTRIB_POS];
else {
- inputs[0] = &vbo->currval[VBO_ATTRIB_POS];
+ inputs[0] = &vbo->currval[VBO_ATTRIB_GENERIC0];
const_inputs |= VERT_BIT_POS;
}