diff options
author | Marek Olšák <[email protected]> | 2020-03-08 22:50:16 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-03-20 23:01:13 -0400 |
commit | c02a1347e5c68d7f1c68ca6b90d2736e35b1fde5 (patch) | |
tree | 624425458b2fc9cca70dcf6aad94c24c56570727 /src/mesa | |
parent | 0b1dd1859134e71b25ad1124535df96d435e9766 (diff) |
glthread: ignore vertex arrays with user pointers if they're disabled
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/glthread.h | 5 | ||||
-rw-r--r-- | src/mesa/main/glthread_marshal.h | 13 | ||||
-rw-r--r-- | src/mesa/main/glthread_varray.c | 9 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index 2dff33d9deb..9c1742eb2b4 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -54,9 +54,9 @@ struct _mesa_HashTable; struct glthread_vao { GLuint Name; - bool HasUserPointer; GLuint CurrentElementBufferName; GLbitfield Enabled; + GLbitfield UserPointerMask; }; /** A single batch of commands queued up for execution. */ @@ -133,6 +133,7 @@ void _mesa_glthread_GenVertexArrays(struct gl_context *ctx, GLsizei n, GLuint *arrays); void _mesa_glthread_ClientState(struct gl_context *ctx, GLuint *vaobj, gl_vert_attrib attrib, bool enable); -void _mesa_glthread_AttribPointer(struct gl_context *ctx); +void _mesa_glthread_AttribPointer(struct gl_context *ctx, + gl_vert_attrib attrib); #endif /* _GLTHREAD_H*/ diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 116d79f4366..8fc65d29862 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -84,25 +84,29 @@ _mesa_glthread_has_non_vbo_vertices_or_indices(const struct gl_context *ctx) struct glthread_vao *vao = glthread->CurrentVAO; return ctx->API != API_OPENGL_CORE && - (vao->CurrentElementBufferName == 0 || vao->HasUserPointer); + (vao->CurrentElementBufferName == 0 || + (vao->UserPointerMask & vao->Enabled)); } static inline bool _mesa_glthread_has_non_vbo_vertices(const struct gl_context *ctx) { const struct glthread_state *glthread = &ctx->GLThread; + const struct glthread_vao *vao = glthread->CurrentVAO; - return ctx->API != API_OPENGL_CORE && glthread->CurrentVAO->HasUserPointer; + return ctx->API != API_OPENGL_CORE && + (vao->UserPointerMask & vao->Enabled); } static inline bool _mesa_glthread_has_non_vbo_vertices_or_indirect(const struct gl_context *ctx) { const struct glthread_state *glthread = &ctx->GLThread; + const struct glthread_vao *vao = glthread->CurrentVAO; return ctx->API != API_OPENGL_CORE && (glthread->CurrentDrawIndirectBufferName == 0 || - glthread->CurrentVAO->HasUserPointer); + (vao->UserPointerMask & vao->Enabled)); } static inline bool @@ -113,7 +117,8 @@ _mesa_glthread_has_non_vbo_vertices_or_indices_or_indirect(const struct gl_conte return ctx->API != API_OPENGL_CORE && (glthread->CurrentDrawIndirectBufferName == 0 || - vao->CurrentElementBufferName == 0 || vao->HasUserPointer); + vao->CurrentElementBufferName == 0 || + (vao->UserPointerMask & vao->Enabled)); } diff --git a/src/mesa/main/glthread_varray.c b/src/mesa/main/glthread_varray.c index 9e45aa28755..fbd08f41e5a 100644 --- a/src/mesa/main/glthread_varray.c +++ b/src/mesa/main/glthread_varray.c @@ -158,10 +158,13 @@ _mesa_glthread_ClientState(struct gl_context *ctx, GLuint *vaobj, } void -_mesa_glthread_AttribPointer(struct gl_context *ctx) +_mesa_glthread_AttribPointer(struct gl_context *ctx, gl_vert_attrib attrib) { struct glthread_state *glthread = &ctx->GLThread; + struct glthread_vao *vao = glthread->CurrentVAO; - if (glthread->CurrentArrayBufferName == 0) - glthread->CurrentVAO->HasUserPointer = true; + if (glthread->CurrentArrayBufferName != 0) + vao->UserPointerMask &= ~(1u << attrib); + else + vao->UserPointerMask |= 1u << attrib; } |