mesa: add ARB_instanced_arrays EXT_dsa function

Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
parent a807b8c0
......@@ -380,7 +380,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list):
GL_ARB_clear_buffer_object DONE
GL_ARB_framebuffer_no_attachments DONE
GL_ARB_gpu_shader_fp64 DONE
GL_ARB_instanced_arrays not started
GL_ARB_instanced_arrays DONE
GL_ARB_internalformat_query2 DONE
GL_ARB_sparse_texture n/a
GL_ARB_sparse_buffer not started
......
......@@ -15,6 +15,12 @@
<param name="divisor" type="GLuint"/>
</function>
<function name="VertexArrayVertexAttribDivisorEXT">
<param name="vaobj" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="divisor" type="GLuint"/>
</function>
</category>
......
......@@ -1621,6 +1621,7 @@ offsets = {
"NamedFramebufferParameteriEXT": 1585,
"GetNamedFramebufferParameterivEXT": 1586,
"VertexArrayVertexAttribLOffsetEXT": 1587,
"VertexArrayVertexAttribDivisorEXT": 1588,
}
functions = [
......
......@@ -546,6 +546,7 @@ const struct function common_desktop_functions_possible[] = {
/* GL_ARB_instanced_arrays */
{ "glVertexAttribDivisorARB", 31, -1 },
{ "glVertexArrayVertexAttribDivisorEXT", 31, -1 },
/* GL_NV_texture_barrier */
{ "glTextureBarrierNV", 31, -1 },
......
......@@ -2558,6 +2558,55 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
}
void GLAPIENTRY
_mesa_VertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index, GLuint divisor)
{
GET_CURRENT_CONTEXT(ctx);
const gl_vert_attrib genericIndex = VERT_ATTRIB_GENERIC(index);
struct gl_vertex_array_object * vao;
/* The ARB_instanced_arrays spec says:
*
* "The vertex array object named by vaobj must
* be generated by GenVertexArrays (and not since deleted);
* otherwise an INVALID_OPERATION error is generated."
*/
vao = _mesa_lookup_vao_err(ctx, vaobj,
false,
"glVertexArrayVertexAttribDivisorEXT");
if (!vao)
return;
if (!ctx->Extensions.ARB_instanced_arrays) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glVertexArrayVertexAttribDivisorEXT()");
return;
}
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glVertexArrayVertexAttribDivisorEXT(index = %u)", index);
return;
}
assert(genericIndex < ARRAY_SIZE(vao->VertexAttrib));
/* The ARB_vertex_attrib_binding spec says:
*
* "The command
*
* void VertexAttribDivisor(uint index, uint divisor);
*
* is equivalent to (assuming no errors are generated):
*
* VertexAttribBinding(index, index);
* VertexBindingDivisor(index, divisor);"
*/
_mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
vertex_binding_divisor(ctx, vao, genericIndex, divisor);
}
static ALWAYS_INLINE void
vertex_array_vertex_buffer(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
......
......@@ -317,6 +317,8 @@ extern void GLAPIENTRY
_mesa_VertexAttribDivisor_no_error(GLuint index, GLuint divisor);
extern void GLAPIENTRY
_mesa_VertexAttribDivisor(GLuint index, GLuint divisor);
extern void GLAPIENTRY
_mesa_VertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index, GLuint divisor);
static inline unsigned
_mesa_primitive_restart_index(const struct gl_context *ctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment