From: Pierre-Eric Pelloux-Prayer Date: Fri, 25 Oct 2019 14:11:21 +0000 (+0200) Subject: mesa: add EXT_dsa EnableVertexArrayAttribEXT / DisableVertexArrayAttribEXT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5adeff80339e00b8cfe3d8df4d403fb48c569aa3;p=mesa.git mesa: add EXT_dsa EnableVertexArrayAttribEXT / DisableVertexArrayAttribEXT Reviewed-by: Marek Olšák --- diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 145d3b92c8e..6c2dcedd645 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -1160,6 +1160,16 @@ + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 28ef42c12aa..0bf2377f739 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1610,6 +1610,8 @@ offsets = { "VertexArrayVertexAttribIOffsetEXT": 1574, "EnableVertexArrayEXT": 1575, "DisableVertexArrayEXT": 1576, + "EnableVertexArrayAttribEXT": 1577, + "DisableVertexArrayAttribEXT": 1578, } functions = [ diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index c58c2943563..b7629bb1a96 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1182,8 +1182,8 @@ const struct function common_desktop_functions_possible[] = { { "glVertexArrayVertexAttribIOffsetEXT", 30, -1 }, { "glEnableVertexArrayEXT", 30, -1 }, { "glDisableVertexArrayEXT", 30, -1 }, - //{ "glEnableVertexArrayAttribEXT", 30, -1 }, - //{ "glDisableVertexArrayAttribEXT", 30, -1 }, + { "glEnableVertexArrayAttribEXT", 30, -1 }, + { "glDisableVertexArrayAttribEXT", 30, -1 }, //{ "glGetVertexArrayIntegervEXT", 30, -1 }, //{ "glGetVertexArrayPointervEXT", 30, -1 }, //{ "glGetVertexArrayIntegeri_vEXT", 30, -1 }, diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 1696e7e953e..4b197dba826 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1612,6 +1612,19 @@ _mesa_EnableVertexArrayAttrib(GLuint vaobj, GLuint index) enable_vertex_array_attrib(ctx, vao, index, "glEnableVertexArrayAttrib"); } +void GLAPIENTRY +_mesa_EnableVertexArrayAttribEXT(GLuint vaobj, GLuint index) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj, + true, + "glEnableVertexArrayAttribEXT"); + if (!vao) + return; + + enable_vertex_array_attrib(ctx, vao, index, "glEnableVertexArrayAttribEXT"); +} + void GLAPIENTRY _mesa_EnableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index) @@ -1694,6 +1707,25 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index) _mesa_disable_vertex_array_attrib(ctx, vao, attrib); } +void GLAPIENTRY +_mesa_DisableVertexArrayAttribEXT(GLuint vaobj, GLuint index) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj, + true, + "glEnableVertexArrayAttribEXT"); + if (!vao) + return; + + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDisableVertexArrayAttrib(index)"); + return; + } + + const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC(index); + _mesa_disable_vertex_array_attrib(ctx, vao, attrib); +} + void GLAPIENTRY _mesa_DisableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index) diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index 89fc6690330..2955e8bd03f 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -238,6 +238,8 @@ _mesa_EnableVertexArrayAttrib(GLuint vaobj, GLuint index); extern void GLAPIENTRY _mesa_EnableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index); +extern void GLAPIENTRY +_mesa_EnableVertexArrayAttribEXT( GLuint vaobj, GLuint index ); extern void GLAPIENTRY @@ -253,6 +255,8 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index); extern void GLAPIENTRY _mesa_DisableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index); +extern void GLAPIENTRY +_mesa_DisableVertexArrayAttribEXT( GLuint vaobj, GLuint index ); extern void GLAPIENTRY _mesa_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params);