aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-05-28 10:27:52 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2019-10-18 10:26:26 +0200
commiteaeab0a99845f3fb6a5ff70d4e275b31df506a0e (patch)
tree9628b203aded2593736f600985657363bad46daf
parent01666ad206fbb4ab5e95667af6b73d405629f05b (diff)
mesa: add EXT_dsa glClientAttribDefaultEXT / glPushClientAttribDefaultEXT
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mapi/glapi/gen/EXT_direct_state_access.xml8
-rw-r--r--src/mapi/glapi/gen/static_data.py2
-rw-r--r--src/mesa/main/attrib.c75
-rw-r--r--src/mesa/main/attrib.h6
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp4
5 files changed, 93 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 d01521b75d1..28cc9b91b0f 100644
--- a/src/mapi/glapi/gen/EXT_direct_state_access.xml
+++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml
@@ -102,6 +102,14 @@
<!-- OpenGL 1.1 -->
+ <function name="ClientAttribDefaultEXT">
+ <param name="mask" type="GLbitfield" />
+ </function>
+
+ <function name="PushClientAttribDefaultEXT">
+ <param name="mask" type="GLbitfield" />
+ </function>
+
<function name="GetTextureParameterivEXT">
<param name="texture" type="GLuint" />
<param name="target" type="GLenum" />
diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
index bd37a34f6f6..141eb8ff7ff 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -1571,6 +1571,8 @@ offsets = {
"GetFramebufferParameterivMESA": 1535,
"NamedRenderbufferStorageEXT": 1536,
"GetNamedRenderbufferParameterivEXT": 1537,
+ "ClientAttribDefaultEXT": 1538,
+ "PushClientAttribDefaultEXT": 1539,
}
functions = [
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index fe6c5a00460..b2756354f1f 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -43,6 +43,7 @@
#include "macros.h"
#include "matrix.h"
#include "multisample.h"
+#include "pixelstore.h"
#include "points.h"
#include "polygon.h"
#include "shared.h"
@@ -1852,6 +1853,80 @@ _mesa_PopClientAttrib(void)
}
}
+void GLAPIENTRY
+_mesa_ClientAttribDefaultEXT( GLbitfield mask )
+{
+ if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
+ _mesa_PixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+ _mesa_PixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+ _mesa_PixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
+ _mesa_PixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
+ _mesa_PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ _mesa_PixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ _mesa_PixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ _mesa_PixelStorei(GL_PACK_SWAP_BYTES, GL_FALSE);
+ _mesa_PixelStorei(GL_PACK_LSB_FIRST, GL_FALSE);
+ _mesa_PixelStorei(GL_PACK_IMAGE_HEIGHT, 0);
+ _mesa_PixelStorei(GL_PACK_SKIP_IMAGES, 0);
+ _mesa_PixelStorei(GL_PACK_ROW_LENGTH, 0);
+ _mesa_PixelStorei(GL_PACK_SKIP_ROWS, 0);
+ _mesa_PixelStorei(GL_PACK_SKIP_PIXELS, 0);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 4);
+
+ _mesa_BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ _mesa_BindBuffer(GL_PIXEL_PACK_BUFFER, 0);
+ }
+ if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
+ GET_CURRENT_CONTEXT(ctx);
+ int i;
+
+ _mesa_BindBuffer(GL_ARRAY_BUFFER, 0);
+ _mesa_BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+
+ _mesa_DisableClientState(GL_EDGE_FLAG_ARRAY);
+ _mesa_EdgeFlagPointer(0, 0);
+
+ _mesa_DisableClientState(GL_INDEX_ARRAY);
+ _mesa_IndexPointer(GL_FLOAT, 0, 0);
+
+ _mesa_DisableClientState(GL_SECONDARY_COLOR_ARRAY);
+ _mesa_SecondaryColorPointer(4, GL_FLOAT, 0, 0);
+
+ _mesa_DisableClientState(GL_FOG_COORD_ARRAY);
+ _mesa_FogCoordPointer(GL_FLOAT, 0, 0);
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ _mesa_ClientActiveTexture(GL_TEXTURE0 + i);
+ _mesa_DisableClientState(GL_TEXTURE_COORD_ARRAY);
+ _mesa_TexCoordPointer(4, GL_FLOAT, 0, 0);
+ }
+
+ _mesa_DisableClientState(GL_COLOR_ARRAY);
+ _mesa_ColorPointer(4, GL_FLOAT, 0, 0);
+
+ _mesa_DisableClientState(GL_NORMAL_ARRAY);
+ _mesa_NormalPointer(GL_FLOAT, 0, 0);
+
+ _mesa_DisableClientState(GL_VERTEX_ARRAY);
+ _mesa_VertexPointer(4, GL_FLOAT, 0, 0);
+
+ for (i = 0; i < ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs; i++) {
+ _mesa_DisableVertexAttribArray(i);
+ _mesa_VertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, 0, 0);
+ }
+
+ _mesa_ClientActiveTexture(GL_TEXTURE0);
+ }
+}
+
+void GLAPIENTRY
+_mesa_PushClientAttribDefaultEXT( GLbitfield mask )
+{
+ _mesa_PushClientAttrib(mask);
+ _mesa_ClientAttribDefaultEXT(mask);
+}
+
/**
* Free any attribute state data that might be attached to the context.
diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h
index f4fd4929f73..90951306fd5 100644
--- a/src/mesa/main/attrib.h
+++ b/src/mesa/main/attrib.h
@@ -43,6 +43,12 @@ _mesa_PushClientAttrib( GLbitfield mask );
extern void GLAPIENTRY
_mesa_PopClientAttrib( void );
+extern void GLAPIENTRY
+_mesa_ClientAttribDefaultEXT( GLbitfield mask );
+
+extern void GLAPIENTRY
+_mesa_PushClientAttribDefaultEXT( GLbitfield mask );
+
extern void
_mesa_init_attrib( struct gl_context *ctx );
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index cbd65d7ba63..be322aa792e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1031,8 +1031,8 @@ const struct function common_desktop_functions_possible[] = {
{ "glMatrixPushEXT", 10, -1 },
{ "glMatrixPopEXT", 10, -1 },
/* GL_EXT_direct_state_access - GL 1.1 */
- //{ "glClientAttribDefaultEXT", 11, -1 },
- //{ "glPushClientAttribDefaultEXT", 11, -1 },
+ { "glClientAttribDefaultEXT", 11, -1 },
+ { "glPushClientAttribDefaultEXT", 11, -1 },
{ "glTextureParameteriEXT", 11, -1 },
{ "glTextureParameterivEXT", 11, -1 },
{ "glTextureParameterfEXT", 11, -1 },