aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/glthread.h3
-rw-r--r--src/mesa/main/glthread_varray.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index f979e5931d4..35b5f1981be 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -65,7 +65,8 @@ struct glthread_attrib_binding {
struct glthread_vao {
GLuint Name;
GLuint CurrentElementBufferName;
- GLbitfield Enabled;
+ GLbitfield UserEnabled; /**< Vertex attrib arrays enabled by the user. */
+ GLbitfield Enabled; /**< UserEnabled with POS vs GENERIC0 aliasing resolved. */
GLbitfield UserPointerMask;
GLbitfield NonZeroDivisorMask;
diff --git a/src/mesa/main/glthread_varray.c b/src/mesa/main/glthread_varray.c
index ac83c7a93cd..ff333af0079 100644
--- a/src/mesa/main/glthread_varray.c
+++ b/src/mesa/main/glthread_varray.c
@@ -50,6 +50,7 @@ _mesa_glthread_reset_vao(struct glthread_vao *vao)
};
vao->CurrentElementBufferName = 0;
+ vao->UserEnabled = 0;
vao->Enabled = 0;
vao->UserPointerMask = 0;
vao->NonZeroDivisorMask = 0;
@@ -230,9 +231,14 @@ _mesa_glthread_ClientState(struct gl_context *ctx, GLuint *vaobj,
return;
if (enable)
- vao->Enabled |= 1u << attrib;
+ vao->UserEnabled |= 1u << attrib;
else
- vao->Enabled &= ~(1u << attrib);
+ vao->UserEnabled &= ~(1u << attrib);
+
+ /* The generic0 attribute superseeds the position attribute */
+ vao->Enabled = vao->UserEnabled;
+ if (vao->Enabled & VERT_BIT_GENERIC0)
+ vao->Enabled &= ~VERT_BIT_POS;
}
void _mesa_glthread_AttribDivisor(struct gl_context *ctx, const GLuint *vaobj,