void
-_mesa_array_element(struct gl_context *ctx,
- struct _glapi_table *disp, GLint elt)
+_mesa_array_element(struct gl_context *ctx, GLint elt)
{
const struct gl_vertex_array_object *vao = ctx->Array.VAO;
GLbitfield mask;
_ae_ArrayElement(GLint elt)
{
GET_CURRENT_CONTEXT(ctx);
- const struct _glapi_table * const disp = GET_DISPATCH();
struct gl_vertex_array_object *vao;
/* If PrimitiveRestart is enabled and the index is the RestartIndex
* then we call PrimitiveRestartNV and return.
*/
if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) {
- CALL_PrimitiveRestartNV((struct _glapi_table *)disp, ());
+ CALL_PrimitiveRestartNV(GET_DISPATCH(), ());
return;
}
vao = ctx->Array.VAO;
_mesa_vao_map_arrays(ctx, vao, GL_MAP_READ_BIT);
- _mesa_array_element(ctx, (struct _glapi_table *)disp, elt);
+ _mesa_array_element(ctx, elt);
_mesa_vao_unmap_arrays(ctx, vao);
}
vbo_save_NotifyBegin(ctx, mode, true);
for (i = 0; i < count; i++)
- _mesa_array_element(ctx, GET_DISPATCH(), start + i);
+ _mesa_array_element(ctx, start + i);
CALL_End(GET_DISPATCH(), ());
_mesa_vao_unmap_arrays(ctx, vao);
static void
-array_element(struct gl_context *ctx, struct _glapi_table *disp,
+array_element(struct gl_context *ctx,
GLint basevertex, GLuint elt, unsigned index_size)
{
/* Section 10.3.5 Primitive Restart:
*/
if (ctx->Array._PrimitiveRestart &&
elt == _mesa_primitive_restart_index(ctx, index_size)) {
- CALL_PrimitiveRestartNV(disp, ());
+ CALL_PrimitiveRestartNV(GET_DISPATCH(), ());
return;
}
- _mesa_array_element(ctx, disp, basevertex + elt);
+ _mesa_array_element(ctx, basevertex + elt);
}
switch (type) {
case GL_UNSIGNED_BYTE:
for (i = 0; i < count; i++)
- array_element(ctx, GET_DISPATCH(), basevertex,
- ((GLubyte *) indices)[i], 1);
+ array_element(ctx, basevertex, ((GLubyte *) indices)[i], 1);
break;
case GL_UNSIGNED_SHORT:
for (i = 0; i < count; i++)
- array_element(ctx, GET_DISPATCH(), basevertex,
- ((GLushort *) indices)[i], 2);
+ array_element(ctx, basevertex, ((GLushort *) indices)[i], 2);
break;
case GL_UNSIGNED_INT:
for (i = 0; i < count; i++)
- array_element(ctx, GET_DISPATCH(), basevertex,
- ((GLuint *) indices)[i], 4);
+ array_element(ctx, basevertex, ((GLuint *) indices)[i], 4);
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(type)");