summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-10-25 15:20:31 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2019-11-05 13:58:28 +0100
commitf793a8663df1a84230e1041447eacec9db4c0fde (patch)
tree7df22782567dc0ca25be0688653150613233e1fb /src
parenta05336179314fcaba37bda12599f076000effbcd (diff)
mesa: add EXT_dsa glEnableVertexArrayEXT / glDisableVertexArrayEXT
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mapi/glapi/gen/EXT_direct_state_access.xml10
-rw-r--r--src/mapi/glapi/gen/static_data.py2
-rw-r--r--src/mesa/main/enable.c61
-rw-r--r--src/mesa/main/enable.h6
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp4
5 files changed, 81 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml
index 19f9048f84a..145d3b92c8e 100644
--- a/src/mapi/glapi/gen/EXT_direct_state_access.xml
+++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml
@@ -1150,6 +1150,16 @@
<param name="offset" type="GLintptr" />
</function>
+ <function name="EnableVertexArrayEXT">
+ <param name="vaobj" type="GLuint" />
+ <param name="array" type="GLenum" />
+ </function>
+
+ <function name="DisableVertexArrayEXT">
+ <param name="vaobj" type="GLuint" />
+ <param name="array" type="GLenum" />
+ </function>
+
<!-- ARB_vertex_program -->
<function name="NamedProgramStringEXT">
<param name="program" type="GLuint" />
diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
index 43011be402d..28ef42c12aa 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -1608,6 +1608,8 @@ offsets = {
"VertexArraySecondaryColorOffsetEXT": 1572,
"VertexArrayVertexAttribOffsetEXT": 1573,
"VertexArrayVertexAttribIOffsetEXT": 1574,
+ "EnableVertexArrayEXT": 1575,
+ "DisableVertexArrayEXT": 1576,
}
functions = [
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index f72a3be0591..e398a67fcb3 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -184,6 +184,37 @@ _mesa_EnableClientState( GLenum cap )
void GLAPIENTRY
+_mesa_EnableVertexArrayEXT( GLuint vaobj, GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj,
+ true,
+ "glEnableVertexArrayEXT");
+ if (!vao)
+ return;
+
+ /* The EXT_direct_state_access spec says:
+ * "Additionally EnableVertexArrayEXT and DisableVertexArrayEXT accept
+ * the tokens TEXTURE0 through TEXTUREn where n is less than the
+ * implementation-dependent limit of MAX_TEXTURE_COORDS. For these
+ * GL_TEXTUREi tokens, EnableVertexArrayEXT and DisableVertexArrayEXT
+ * act identically to EnableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY)
+ * or DisableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY) respectively
+ * as if the active client texture is set to texture coordinate set i
+ * based on the token TEXTUREi indicated by array."
+ */
+ if (GL_TEXTURE0 <= cap && cap < GL_TEXTURE0 + ctx->Const.MaxTextureCoordUnits) {
+ GLuint saved_active = ctx->Array.ActiveTexture;
+ _mesa_ClientActiveTexture(cap);
+ client_state(ctx, vao, GL_TEXTURE_COORD_ARRAY, GL_TRUE);
+ _mesa_ClientActiveTexture(GL_TEXTURE0 + saved_active);
+ } else {
+ client_state(ctx, vao, cap, GL_TRUE);
+ }
+}
+
+
+void GLAPIENTRY
_mesa_EnableClientStateiEXT( GLenum cap, GLuint index )
{
GET_CURRENT_CONTEXT(ctx);
@@ -206,6 +237,36 @@ _mesa_DisableClientState( GLenum cap )
}
void GLAPIENTRY
+_mesa_DisableVertexArrayEXT( GLuint vaobj, GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj,
+ true,
+ "glDisableVertexArrayEXT");
+ if (!vao)
+ return;
+
+ /* The EXT_direct_state_access spec says:
+ * "Additionally EnableVertexArrayEXT and DisableVertexArrayEXT accept
+ * the tokens TEXTURE0 through TEXTUREn where n is less than the
+ * implementation-dependent limit of MAX_TEXTURE_COORDS. For these
+ * GL_TEXTUREi tokens, EnableVertexArrayEXT and DisableVertexArrayEXT
+ * act identically to EnableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY)
+ * or DisableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY) respectively
+ * as if the active client texture is set to texture coordinate set i
+ * based on the token TEXTUREi indicated by array."
+ */
+ if (GL_TEXTURE0 <= cap && cap < GL_TEXTURE0 + ctx->Const.MaxTextureCoordUnits) {
+ GLuint saved_active = ctx->Array.ActiveTexture;
+ _mesa_ClientActiveTexture(cap);
+ client_state(ctx, vao, GL_TEXTURE_COORD_ARRAY, GL_FALSE);
+ _mesa_ClientActiveTexture(GL_TEXTURE0 + saved_active);
+ } else {
+ client_state(ctx, vao, cap, GL_FALSE);
+ }
+}
+
+void GLAPIENTRY
_mesa_DisableClientStateiEXT( GLenum cap, GLuint index )
{
GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/enable.h b/src/mesa/main/enable.h
index fa569edadd2..1cd8f675d33 100644
--- a/src/mesa/main/enable.h
+++ b/src/mesa/main/enable.h
@@ -68,11 +68,17 @@ extern void GLAPIENTRY
_mesa_EnableClientStateiEXT( GLenum cap, GLuint index );
extern void GLAPIENTRY
+_mesa_EnableVertexArrayEXT( GLuint vaobj, GLenum cap );
+
+extern void GLAPIENTRY
_mesa_DisableClientState( GLenum cap );
extern void GLAPIENTRY
_mesa_DisableClientStateiEXT( GLenum cap, GLuint index );
+extern void GLAPIENTRY
+_mesa_DisableVertexArrayEXT( GLuint vaobj, GLenum cap );
+
extern void
_mesa_set_multisample(struct gl_context *ctx, GLboolean state);
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 78a50532c5c..c58c2943563 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1180,8 +1180,8 @@ const struct function common_desktop_functions_possible[] = {
{ "glVertexArraySecondaryColorOffsetEXT", 30, -1 },
{ "glVertexArrayVertexAttribOffsetEXT", 30, -1 },
{ "glVertexArrayVertexAttribIOffsetEXT", 30, -1 },
- //{ "glEnableVertexArrayEXT", 30, -1 },
- //{ "glDisableVertexArrayEXT", 30, -1 },
+ { "glEnableVertexArrayEXT", 30, -1 },
+ { "glDisableVertexArrayEXT", 30, -1 },
//{ "glEnableVertexArrayAttribEXT", 30, -1 },
//{ "glDisableVertexArrayAttribEXT", 30, -1 },
//{ "glGetVertexArrayIntegervEXT", 30, -1 },