From: Marek Olšák Date: Mon, 9 Mar 2020 02:50:16 +0000 (-0400) Subject: glthread: ignore vertex arrays with user pointers if they're disabled X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c02a1347e5c68d7f1c68ca6b90d2736e35b1fde5;p=mesa.git glthread: ignore vertex arrays with user pointers if they're disabled Reviewed-by: Timothy Arceri Part-of: --- diff --git a/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml b/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml index 45c30f48378..fcbb1673971 100644 --- a/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml +++ b/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml @@ -52,7 +52,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));"> diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 81310e343f4..5c52573a172 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -658,7 +658,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(texunit - GL_TEXTURE0));"> diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml index 943e5289a93..19875bc9505 100644 --- a/src/mapi/glapi/gen/GL3x.xml +++ b/src/mapi/glapi/gen/GL3x.xml @@ -258,7 +258,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));"> diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 107ca9a2cb0..a5653313605 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -320,7 +320,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POINT_SIZE);"> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index bd5e0f11110..8c64eed6dae 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -3166,7 +3166,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0);"> @@ -3199,7 +3199,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG);"> @@ -3219,7 +3219,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX);"> @@ -3235,7 +3235,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL);"> @@ -3244,7 +3244,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture));"> @@ -3254,7 +3254,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS);"> @@ -4751,7 +4751,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_FOG);"> @@ -4892,7 +4892,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR1);"> @@ -5853,7 +5853,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));"> @@ -9251,7 +9251,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0);"> @@ -9267,7 +9267,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG);"> @@ -9280,7 +9280,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX);"> @@ -9289,7 +9289,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL);"> @@ -9298,7 +9298,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture));"> @@ -9308,7 +9308,7 @@ + marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS);"> 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; }