glthread: handle POS vs GENERIC0 aliasing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
This commit is contained in:
Marek Olšák 2020-03-23 23:35:58 -04:00 committed by Marge Bot
parent 09f94632e0
commit 57bf51a973
2 changed files with 10 additions and 3 deletions

View file

@ -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;

View file

@ -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,