</function>
<function name="VertexAttribLPointer" no_error="true" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer);">
<param name="index" type="GLuint"/>
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="params" type="GLdouble *"/>
</function>
- <function name="VertexArrayVertexAttribLOffsetEXT">
+ <function name="VertexArrayVertexAttribLOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_GENERIC(index), size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="index" type="GLuint" />
</function>
<function name="MultiTexCoordPointerEXT" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(texunit - GL_TEXTURE0));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(texunit - GL_TEXTURE0), size, type, stride, pointer);">
<param name="texunit" type="GLenum" />
<param name="size" type="GLint" />
<param name="type" type="GLenum" />
<param name="size" type="GLsizeiptr" />
</function>
- <function name="VertexArrayVertexOffsetEXT">
+ <function name="VertexArrayVertexOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_POS, size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="size" type="GLint" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayColorOffsetEXT">
+ <function name="VertexArrayColorOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_COLOR0, size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="size" type="GLint" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayEdgeFlagOffsetEXT">
+ <function name="VertexArrayEdgeFlagOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_EDGEFLAG, 1, GL_UNSIGNED_BYTE, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="stride" type="GLsizei" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayIndexOffsetEXT">
+ <function name="VertexArrayIndexOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_COLOR_INDEX, 1, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="type" type="GLenum" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayNormalOffsetEXT">
+ <function name="VertexArrayNormalOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_NORMAL, 3, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="type" type="GLenum" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayTexCoordOffsetEXT">
+ <function name="VertexArrayTexCoordOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture), size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="size" type="GLint" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayMultiTexCoordOffsetEXT">
+ <function name="VertexArrayMultiTexCoordOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_TEX(texunit - GL_TEXTURE0), size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="texunit" type="GLenum" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayFogCoordOffsetEXT">
+ <function name="VertexArrayFogCoordOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_FOG, 1, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="type" type="GLenum" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArraySecondaryColorOffsetEXT">
+ <function name="VertexArraySecondaryColorOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_COLOR1, size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="size" type="GLint" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayVertexAttribOffsetEXT">
+ <function name="VertexArrayVertexAttribOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_GENERIC(index), size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="index" type="GLuint" />
<param name="offset" type="GLintptr" />
</function>
- <function name="VertexArrayVertexAttribIOffsetEXT">
+ <function name="VertexArrayVertexAttribIOffsetEXT"
+ marshal_call_after="if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_GENERIC(index), size, type, stride, offset);">
<param name="vaobj" type="GLuint" />
<param name="buffer" type="GLuint" />
<param name="index" type="GLuint" />
<function name="VertexAttribIPointer" es2="3.0" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer);">
<param name="index" type="GLuint"/>
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<function name="PointSizePointerOES" es1="1.0" desktop="false"
no_error="true" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POINT_SIZE);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POINT_SIZE, 1, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<function name="ColorPointer" es1="1.0" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0, size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<function name="EdgeFlagPointer" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG, 1, GL_UNSIGNED_BYTE, stride, pointer);">
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<glx handcode="true"/>
<function name="IndexPointer" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX, 1, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<function name="NormalPointer" es1="1.0" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL, 3, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<function name="TexCoordPointer" es1="1.0" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture), size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<function name="VertexPointer" es1="1.0" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS, size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<function name="FogCoordPointer" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_FOG);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_FOG, 1, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<function name="SecondaryColorPointer" deprecated="3.1" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR1);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR1, size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<function name="VertexAttribPointer" es2="2.0" marshal="async"
no_error="true"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer);">
<param name="index" type="GLuint"/>
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
</function>
<function name="ColorPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0, size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
</function>
<function name="EdgeFlagPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG, 1, GL_UNSIGNED_BYTE, stride, pointer);">
<param name="stride" type="GLsizei"/>
<param name="count" type="GLsizei"/>
<param name="pointer" type="const GLboolean *"/>
</function>
<function name="IndexPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX, 1, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="count" type="GLsizei"/>
</function>
<function name="NormalPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL, 3, type, stride, pointer);">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="count" type="GLsizei"/>
</function>
<function name="TexCoordPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture));">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture), size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
</function>
<function name="VertexPointerEXT" deprecated="3.1" marshal="async"
- marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS);">
+ marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS, size, type, stride, pointer);">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
GLuint CurrentElementBufferName;
GLbitfield Enabled;
GLbitfield UserPointerMask;
+
+ struct {
+ GLuint ElementSize;
+ GLsizei Stride;
+ const void *Pointer;
+ } Attrib[VERT_ATTRIB_MAX];
};
/** A single batch of commands queued up for execution. */
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,
- gl_vert_attrib attrib);
+void _mesa_glthread_AttribPointer(struct gl_context *ctx, gl_vert_attrib attrib,
+ GLint size, GLenum type, GLsizei stride,
+ const void *pointer);
+void _mesa_glthread_DSAAttribPointer(struct gl_context *ctx, GLuint vao,
+ GLuint buffer, gl_vert_attrib attrib,
+ GLint size, GLenum type, GLsizei stride,
+ GLintptr offset);
#endif /* _GLTHREAD_H*/
*/
#include "main/glthread.h"
+#include "main/glformats.h"
#include "main/mtypes.h"
#include "main/hash.h"
#include "main/dispatch.h"
/* TODO:
- * - Implement better tracking of user pointers
- * - These can unbind user pointers:
- * ARB_vertex_attrib_binding
- * ARB_direct_state_access
- * EXT_direct_state_access
+ * - Handle GL_ARB_instanced_arrays (incl. EXT_dsa)
+ * - Handle ARB_vertex_attrib_binding (incl. EXT_dsa and ARB_dsa)
*/
static struct glthread_vao *
vao->Enabled &= ~(1u << attrib);
}
-void
-_mesa_glthread_AttribPointer(struct gl_context *ctx, gl_vert_attrib attrib)
+static void
+attrib_pointer(struct glthread_state *glthread, struct glthread_vao *vao,
+ GLuint buffer, gl_vert_attrib attrib,
+ GLint size, GLenum type, GLsizei stride,
+ const void *pointer)
{
- struct glthread_state *glthread = &ctx->GLThread;
- struct glthread_vao *vao = glthread->CurrentVAO;
+ if (attrib >= VERT_ATTRIB_MAX)
+ return;
+
+ unsigned elem_size = _mesa_bytes_per_vertex_attrib(size, type);
+
+ vao->Attrib[attrib].ElementSize = elem_size;
+ vao->Attrib[attrib].Stride = stride ? stride : elem_size;
+ vao->Attrib[attrib].Pointer = pointer;
- if (glthread->CurrentArrayBufferName != 0)
+ if (buffer != 0)
vao->UserPointerMask &= ~(1u << attrib);
else
vao->UserPointerMask |= 1u << attrib;
}
+
+void
+_mesa_glthread_AttribPointer(struct gl_context *ctx, gl_vert_attrib attrib,
+ GLint size, GLenum type, GLsizei stride,
+ const void *pointer)
+{
+ struct glthread_state *glthread = &ctx->GLThread;
+
+ attrib_pointer(glthread, glthread->CurrentVAO,
+ glthread->CurrentArrayBufferName,
+ attrib, size, type, stride, pointer);
+}
+
+void
+_mesa_glthread_DSAAttribPointer(struct gl_context *ctx, GLuint vaobj,
+ GLuint buffer, gl_vert_attrib attrib,
+ GLint size, GLenum type, GLsizei stride,
+ GLintptr offset)
+{
+ struct glthread_state *glthread = &ctx->GLThread;
+ struct glthread_vao *vao;
+
+ vao = lookup_vao(ctx, vaobj);
+ if (!vao)
+ return;
+
+ attrib_pointer(glthread, vao, buffer, attrib, size, type, stride,
+ (const void*)offset);
+}