static void get_vertex_attrib( __GLXcontext * gc, unsigned vop, GLuint index, GLenum pname, xReply * reply ) { Display * const dpy = gc->currentDpy; GLubyte * const pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, vop, 8); *((uint32_t *)(pc + 0)) = index; *((uint32_t *)(pc + 4)) = pname; (void) _XReply( dpy, reply, 0, False ); }
GLboolean glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences) { struct glx_context *const gc = __glXGetCurrentContext(); if (gc->isDirect) { const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH(); PFNGLARETEXTURESRESIDENTEXTPROC p = (PFNGLARETEXTURESRESIDENTEXTPROC) table[332]; return p(n, textures, residences); } else { struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { GLubyte const *pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreTexturesResidentEXT, cmdlen); (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); if (n & 3) { /* see comments in __indirect_glAreTexturesResident() */ GLboolean *res4 = malloc((n + 3) & ~3); retval = (GLboolean) __glXReadReply(dpy, 1, res4, GL_TRUE); memcpy(residences, res4, n); free(res4); } else { retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); } UnlockDisplay(dpy); SyncHandle(); } return retval; } }
static void get_parameter( unsigned opcode, unsigned size, GLenum target, GLuint index, void * params ) { __GLXcontext * const gc = __glXGetCurrentContext(); Display * const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, opcode, cmdlen); *((GLenum *)(pc + 0)) = target; *((GLuint *)(pc + 4)) = index; *((GLuint *)(pc + 8)) = 0; (void) __glXReadReply(dpy, size, params, GL_FALSE); UnlockDisplay(dpy); SyncHandle(); } return; }
/* it is defined to gl_dispatch_stub_NNN in indirect.h */ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) { struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->isDirect) { const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH(); PFNGLGETSEPARABLEFILTEREXTPROC p = (PFNGLGETSEPARABLEFILTEREXTPROC) table[359]; p(target, format, type, row, column, span); return; } else #endif { Display *const dpy = gc->currentDpy; const GLuint cmdlen = __GLX_PAD(13); if (dpy != NULL) { const __GLXattribute *const state = gc->client_state_private; xGLXGetSeparableFilterReply reply; GLubyte const *pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetSeparableFilterEXT, cmdlen); unsigned compsize; (void) memcpy((void *) (pc + 0), (void *) (&target), 4); (void) memcpy((void *) (pc + 4), (void *) (&format), 4); (void) memcpy((void *) (pc + 8), (void *) (&type), 4); *(int8_t *) (pc + 12) = state->storePack.swapEndian; (void) _XReply(dpy, (xReply *) & reply, 0, False); compsize = reply.length << 2; if (compsize != 0) { const GLint width = reply.width; const GLint height = reply.height; const GLint widthsize = __glImageSize(width, 1, 1, format, type, 0); const GLint heightsize = __glImageSize(height, 1, 1, format, type, 0); GLubyte *const buf = malloc((widthsize > heightsize) ? widthsize : heightsize); if (buf == NULL) { /* Throw data away */ _XEatData(dpy, compsize); __glXSetError(gc, GL_OUT_OF_MEMORY); UnlockDisplay(dpy); SyncHandle(); return; } else { int extra; extra = 4 - (widthsize & 3); _XRead(dpy, (char *) buf, widthsize); if (extra < 4) { _XEatData(dpy, extra); } __glEmptyImage(gc, 1, width, 1, 1, format, type, buf, row); extra = 4 - (heightsize & 3); _XRead(dpy, (char *) buf, heightsize); if (extra < 4) { _XEatData(dpy, extra); } __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column); free((char *) buf); } } } } }
void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { __GLXcontext * const gc = __glXGetCurrentContext(); if (gc->isDirect) { CALL_GetSeparableFilter(GET_DISPATCH(), (target, format, type, row, column, span)); return; } else { Display *const dpy = gc->currentDpy; const GLuint cmdlen = __GLX_PAD(13); if (dpy != NULL) { const __GLXattribute * const state = gc->client_state_private; xGLXGetSeparableFilterReply reply; GLubyte const *pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetSeparableFilterEXT, cmdlen); unsigned compsize; (void) memcpy((void *) (pc + 0), (void *) (&target), 4); (void) memcpy((void *) (pc + 4), (void *) (&format), 4); (void) memcpy((void *) (pc + 8), (void *) (&type), 4); *(int8_t *) (pc + 12) = state->storePack.swapEndian; (void) _XReply(dpy, (xReply *) & reply, 0, False); compsize = reply.length << 2; if (compsize != 0) { const GLint width = reply.width; const GLint height = reply.height; const GLint widthsize = __glImageSize(width, 1, 1, format, type, 0); const GLint heightsize = __glImageSize(height, 1, 1, format, type, 0); GLubyte * const buf = (GLubyte*) Xmalloc((widthsize > heightsize) ? widthsize : heightsize); if (buf == NULL) { /* Throw data away */ _XEatData(dpy, compsize); __glXSetError(gc, GL_OUT_OF_MEMORY); UnlockDisplay(dpy); SyncHandle(); return; } else { int extra; extra = 4 - (widthsize & 3); _XRead(dpy, (char *)buf, widthsize); if (extra < 4) { _XEatData(dpy, extra); } __glEmptyImage(gc, 1, width, 1, 1, format, type, buf, row); extra = 4 - (heightsize & 3); _XRead(dpy, (char *)buf, heightsize); if (extra < 4) { _XEatData(dpy, extra); } __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column); Xfree((char*) buf); } } } } }