diff options
author | Marek Olšák <[email protected]> | 2020-05-30 17:42:46 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-23 06:41:37 +0000 |
commit | a2d7f4fe5a52d2968f8d0fbbf879368a6e7044aa (patch) | |
tree | a4a72666446fd255a9577339c668315834e4d51c /src/mesa/main/glthread.h | |
parent | 66c2c9c6a957c55effc29ad4e1e7461bb8c85508 (diff) |
glthread: handle ARB_vertex_attrib_binding
This handles ARB_vertex_attrib_binding for vertex uploads correctly.
Before this, the extension might have led to crashes if non-VBO vertex
attribs were present.
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>
Diffstat (limited to 'src/mesa/main/glthread.h')
-rw-r--r-- | src/mesa/main/glthread.h | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index 34a5443a6da..b07169e334c 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -66,15 +66,23 @@ struct glthread_attrib_binding { struct glthread_vao { GLuint Name; GLuint CurrentElementBufferName; - GLbitfield UserEnabled; /**< Vertex attrib arrays enabled by the user. */ + GLbitfield UserEnabled; /**< Vertex attribs enabled by the user. */ GLbitfield Enabled; /**< UserEnabled with POS vs GENERIC0 aliasing resolved. */ - GLbitfield UserPointerMask; - GLbitfield NonZeroDivisorMask; + GLbitfield BufferEnabled; /**< "Enabled" converted to buffer bindings. */ + GLbitfield BufferInterleaved; /**< Bitmask of buffers used by multiple attribs. */ + GLbitfield UserPointerMask; /**< Bitmask of buffer bindings. */ + GLbitfield NonZeroDivisorMask; /**< Bitmask of buffer bindings. */ struct { + /* Per attrib: */ GLuint ElementSize; + GLuint RelativeOffset; + GLuint BufferIndex; /**< Referring to Attrib[BufferIndex]. */ + + /* Per buffer binding: */ GLsizei Stride; GLuint Divisor; + int EnabledAttribCount; /**< Number of enabled attribs using this buffer. */ const void *Pointer; } Attrib[VERT_ATTRIB_MAX]; }; @@ -207,6 +215,31 @@ void _mesa_glthread_DSAAttribPointer(struct gl_context *ctx, GLuint vao, GLuint buffer, gl_vert_attrib attrib, GLint size, GLenum type, GLsizei stride, GLintptr offset); +void _mesa_glthread_AttribFormat(struct gl_context *ctx, GLuint attribindex, + GLint size, GLenum type, GLuint relativeoffset); +void _mesa_glthread_DSAAttribFormat(struct gl_context *ctx, GLuint vaobj, + GLuint attribindex, GLint size, GLenum type, + GLuint relativeoffset); +void _mesa_glthread_VertexBuffer(struct gl_context *ctx, GLuint bindingindex, + GLuint buffer, GLintptr offset, GLsizei stride); +void _mesa_glthread_DSAVertexBuffer(struct gl_context *ctx, GLuint vaobj, + GLuint bindingindex, GLuint buffer, + GLintptr offset, GLsizei stride); +void _mesa_glthread_DSAVertexBuffers(struct gl_context *ctx, GLuint vaobj, + GLuint first, GLsizei count, + const GLuint *buffers, + const GLintptr *offsets, + const GLsizei *strides); +void _mesa_glthread_BindingDivisor(struct gl_context *ctx, GLuint bindingindex, + GLuint divisor); +void _mesa_glthread_DSABindingDivisor(struct gl_context *ctx, GLuint vaobj, + GLuint bindingindex, GLuint divisor); +void _mesa_glthread_AttribBinding(struct gl_context *ctx, GLuint attribindex, + GLuint bindingindex); +void _mesa_glthread_DSAAttribBinding(struct gl_context *ctx, GLuint vaobj, + GLuint attribindex, GLuint bindingindex); +void _mesa_glthread_DSAElementBuffer(struct gl_context *ctx, GLuint vaobj, + GLuint buffer); void _mesa_glthread_PushClientAttrib(struct gl_context *ctx, GLbitfield mask, bool set_default); void _mesa_glthread_PopClientAttrib(struct gl_context *ctx); |