summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2008-07-16 08:55:26 -0700
committerIan Romanick <ian.d.romanick@intel.com>2008-07-16 08:55:26 -0700
commit030799ed3e2573472a58d8e1d8f1dab332fd1251 (patch)
tree264222267f6a478b5787590e564db7f6de5662c6
parent7fa850216b51b58e386d3348841894e9ec4d1746 (diff)
glx: Send array enable state to the serverindirect-vbo
-rw-r--r--src/glx/x11/indirect_vertex_array.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c
index bc88ac15d0..d600360bf7 100644
--- a/src/glx/x11/indirect_vertex_array.c
+++ b/src/glx/x11/indirect_vertex_array.c
@@ -1653,6 +1653,9 @@ void __indirect_glClientActiveTextureARB(GLenum texture)
}
+#define X_GLsop_EnableVertexAttribArray 174
+#define X_GLsop_DisableVertexAttribArray 175
+
/**
* Modify the enable state for the selected array
*/
@@ -1671,14 +1674,38 @@ __glXSetArrayEnable(__GLXattribute *state, GLenum key, unsigned index,
index = arrays->active_texture_unit;
}
- a = get_array_entry( arrays, key, index );
+ a = get_array_entry(arrays, key, index);
+ if (a == NULL) {
+ return GL_FALSE;
+ }
- if ( (a != NULL) && (a->enabled != enable) ) {
- a->enabled = enable;
- arrays->array_info_cache_valid = GL_FALSE;
+ if (a->enabled != enable) {
+ a->enabled = enable;
+ arrays->array_info_cache_valid = GL_FALSE;
+ }
+
+
+ /* If the VBO GLX protocol is supported, the server must also be notified
+ * of any enables or disables of array state. This is another case where,
+ * to ensure correct propogation of errors, we have to blindly send
+ * redundant messages to the server.
+ */
+ if (1) {
+ __GLXcontext *const gc = __glXGetCurrentContext();
+ Display *const dpy = gc->currentDpy;
+ const GLuint cmdlen = 8;
+ const GLint sop = (enable)
+ ? X_GLsop_EnableVertexAttribArray
+ : X_GLsop_DisableVertexAttribArray;
+ GLubyte const *pc = __glXSetupSingleRequest(gc, sop, cmdlen);
+
+ (void) memcpy((void *) (pc + 0), (void *) (&key), 4);
+ (void) memcpy((void *) (pc + 4), (void *) (&index), 4);
+ UnlockDisplay(dpy);
+ SyncHandle();
}
- return (a != NULL);
+ return GL_TRUE;
}