mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
glthread: handle glInterleavedArrays
We need to enable and bind everything on the glthread side too. The behavior was copied from _mesa_InterleavedArrays. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>
This commit is contained in:
parent
bd70b61f2f
commit
315df8dbb8
3 changed files with 55 additions and 1 deletions
|
|
@ -3234,7 +3234,8 @@
|
|||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="InterleavedArrays" deprecated="3.1">
|
||||
<function name="InterleavedArrays" deprecated="3.1" marshal="async"
|
||||
marshal_call_after="_mesa_glthread_InterleavedArrays(ctx, format, stride, pointer);">
|
||||
<param name="format" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
|
|
|
|||
|
|
@ -244,5 +244,7 @@ void _mesa_glthread_PushClientAttrib(struct gl_context *ctx, GLbitfield mask,
|
|||
bool set_default);
|
||||
void _mesa_glthread_PopClientAttrib(struct gl_context *ctx);
|
||||
void _mesa_glthread_ClientAttribDefault(struct gl_context *ctx, GLbitfield mask);
|
||||
void _mesa_glthread_InterleavedArrays(struct gl_context *ctx, GLenum format,
|
||||
GLsizei stride, const GLvoid *pointer);
|
||||
|
||||
#endif /* _GLTHREAD_H*/
|
||||
|
|
|
|||
|
|
@ -646,3 +646,54 @@ _mesa_glthread_ClientAttribDefault(struct gl_context *ctx, GLbitfield mask)
|
|||
glthread->CurrentVAO = &glthread->DefaultVAO;
|
||||
_mesa_glthread_reset_vao(glthread->CurrentVAO);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_glthread_InterleavedArrays(struct gl_context *ctx, GLenum format,
|
||||
GLsizei stride, const GLvoid *pointer)
|
||||
{
|
||||
struct gl_interleaved_layout layout;
|
||||
unsigned tex = VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture);
|
||||
|
||||
if (stride < 0 || !_mesa_get_interleaved_layout(format, &layout))
|
||||
return;
|
||||
|
||||
if (!stride)
|
||||
stride = layout.defstride;
|
||||
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_EDGEFLAG, false);
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_COLOR_INDEX, false);
|
||||
/* XXX also disable secondary color and generic arrays? */
|
||||
|
||||
/* Texcoords */
|
||||
if (layout.tflag) {
|
||||
_mesa_glthread_ClientState(ctx, NULL, tex, true);
|
||||
_mesa_glthread_AttribPointer(ctx, tex, layout.tcomps, GL_FLOAT, stride,
|
||||
(GLubyte *) pointer + layout.toffset);
|
||||
} else {
|
||||
_mesa_glthread_ClientState(ctx, NULL, tex, false);
|
||||
}
|
||||
|
||||
/* Color */
|
||||
if (layout.cflag) {
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_COLOR0, true);
|
||||
_mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0, layout.ccomps,
|
||||
layout.ctype, stride,
|
||||
(GLubyte *) pointer + layout.coffset);
|
||||
} else {
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_COLOR0, false);
|
||||
}
|
||||
|
||||
/* Normals */
|
||||
if (layout.nflag) {
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_NORMAL, true);
|
||||
_mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL, 3, GL_FLOAT,
|
||||
stride, (GLubyte *) pointer + layout.noffset);
|
||||
} else {
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_NORMAL, false);
|
||||
}
|
||||
|
||||
/* Vertices */
|
||||
_mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_POS, true);
|
||||
_mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS, layout.vcomps, GL_FLOAT,
|
||||
stride, (GLubyte *) pointer + layout.voffset);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue