diff options
author | Marek Olšák <[email protected]> | 2020-03-23 23:35:58 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-30 22:01:55 +0000 |
commit | 57bf51a97357b0cce293659123a3353d1b726487 (patch) | |
tree | 8fac0223b2485e58154baa9f232c51ede03451c0 /src/mesa | |
parent | 09f94632e033805bee57a963ca15df131e7c7f7c (diff) |
glthread: handle POS vs GENERIC0 aliasing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/glthread.h | 3 | ||||
-rw-r--r-- | src/mesa/main/glthread_varray.c | 10 |
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, |