From 9e24940bc7464f23151249e309d393f0dd5f10ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 6 Mar 2025 09:12:41 -0500 Subject: [PATCH] glx: don't generate indirect GLX dispatch for ARB_imaging functions Reviewed-by: Adam Jackson Part-of: --- src/glx/apple/apple_glapi.c | 1 - src/glx/apple/apple_xgl_api.h | 3 -- src/glx/apple/apple_xgl_api_read.c | 13 ----- src/glx/meson.build | 1 - src/glx/renderpix.c | 85 ------------------------------ src/glx/singlepix.c | 83 ----------------------------- src/mapi/glapi/gen/glX_XML.py | 4 +- 7 files changed, 3 insertions(+), 187 deletions(-) delete mode 100644 src/glx/singlepix.c diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 9fd0f65d50c..cab61c451be 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -61,7 +61,6 @@ static void _apple_glapi_create_table(void) { _glapi_table_patch(__applegl_api, "ReadPixels", __applegl_glReadPixels); _glapi_table_patch(__applegl_api, "CopyPixels", __applegl_glCopyPixels); - _glapi_table_patch(__applegl_api, "CopyColorTable", __applegl_glCopyColorTable); _glapi_table_patch(__applegl_api, "DrawBuffers", __applegl_glDrawBuffer); _glapi_table_patch(__applegl_api, "Viewport", __applegl_glViewport); } diff --git a/src/glx/apple/apple_xgl_api.h b/src/glx/apple/apple_xgl_api.h index 56e76b0f445..80da881ac66 100644 --- a/src/glx/apple/apple_xgl_api.h +++ b/src/glx/apple/apple_xgl_api.h @@ -32,9 +32,6 @@ void __applegl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); void __applegl_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -void __applegl_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, - GLsizei width); - void __applegl_glDrawBuffer(GLenum mode); void __applegl_glDrawBuffers(GLsizei n, const GLenum * bufs); diff --git a/src/glx/apple/apple_xgl_api_read.c b/src/glx/apple/apple_xgl_api_read.c index 612f5f7b01f..4e6826a3036 100644 --- a/src/glx/apple/apple_xgl_api_read.c +++ b/src/glx/apple/apple_xgl_api_read.c @@ -119,16 +119,3 @@ __applegl_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum t UnsetRead(&saved); } - -void -__applegl_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, - GLsizei width) -{ - struct apple_xgl_saved_state saved; - - SetRead(&saved); - - __ogl_framework_api->CopyColorTable(target, internalformat, x, y, width); - - UnsetRead(&saved); -} diff --git a/src/glx/meson.build b/src/glx/meson.build index 1fe8ac45321..419c065fa7b 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -50,7 +50,6 @@ files_libglx = files( 'render2.c', 'renderpix.c', 'single2.c', - 'singlepix.c', 'vertarr.c', 'xfont.c', ) diff --git a/src/glx/renderpix.c b/src/glx/renderpix.c index 66f5f8a9c63..e9bf197c3aa 100644 --- a/src/glx/renderpix.c +++ b/src/glx/renderpix.c @@ -87,88 +87,3 @@ __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim, /* Free buffer */ free((char *) buf); } - -/************************************************************************/ - -/** - * Implement GLX protocol for \c glSeparableFilter2D. - */ -void -__indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid * row, - const GLvoid * column) -{ - __GLX_DECLARE_VARIABLES(); - GLuint compsize2, hdrlen, totalhdrlen, image1len, image2len; - - __GLX_LOAD_VARIABLES(); - compsize = __glImageSize(width, 1, 1, format, type, 0); - compsize2 = __glImageSize(height, 1, 1, format, type, 0); - totalhdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE); - hdrlen = __GLX_PAD(__GLX_CONV_FILT_HDR_SIZE); - image1len = __GLX_PAD(compsize); - image2len = __GLX_PAD(compsize2); - cmdlen = totalhdrlen + image1len + image2len; - if (!gc->currentDpy) - return; - - if (cmdlen <= gc->maxSmallRenderCommandSize) { - /* Use GLXRender protocol to send small command */ - __GLX_BEGIN_VARIABLE_WITH_PIXEL(X_GLrop_SeparableFilter2D, cmdlen); - __GLX_PUT_LONG(0, target); - __GLX_PUT_LONG(4, internalformat); - __GLX_PUT_LONG(8, width); - __GLX_PUT_LONG(12, height); - __GLX_PUT_LONG(16, format); - __GLX_PUT_LONG(20, type); - pc += hdrlen; - if (compsize > 0) { - __glFillImage(gc, 1, width, 1, 1, format, type, row, pc, - pixelHeaderPC); - pc += image1len; - } - if (compsize2 > 0) { - __glFillImage(gc, 1, height, 1, 1, format, type, column, pc, NULL); - pc += image2len; - } - if ((compsize == 0) && (compsize2 == 0)) { - /* Setup default store modes */ - (void) memcpy(pixelHeaderPC, __glXDefaultPixelStore + 4, 20); - } - __GLX_END(0); - } - else { - GLubyte *buf; - const GLint bufsize = image1len + image2len; - - /* Use GLXRenderLarge protocol to send command */ - __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL(X_GLrop_SeparableFilter2D, - cmdlen + 4); - __GLX_PUT_LONG(0, target); - __GLX_PUT_LONG(4, internalformat); - __GLX_PUT_LONG(8, width); - __GLX_PUT_LONG(12, height); - __GLX_PUT_LONG(16, format); - __GLX_PUT_LONG(20, type); - pc += hdrlen; - - /* Allocate a temporary holding buffer */ - buf = malloc(bufsize); - if (!buf) { - __glXSetError(gc, GL_OUT_OF_MEMORY); - return; - } - __glFillImage(gc, 1, width, 1, 1, format, type, row, buf, - pixelHeaderPC); - - __glFillImage(gc, 1, height, 1, 1, format, type, column, - buf + image1len, pixelHeaderPC); - - /* Send large command */ - __glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), buf, - bufsize); - /* Free buffer */ - free((char *) buf); - } -} diff --git a/src/glx/singlepix.c b/src/glx/singlepix.c deleted file mode 100644 index f4880293226..00000000000 --- a/src/glx/singlepix.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. - * - * SPDX-License-Identifier: SGI-B-2.0 - */ - -#include "packsingle.h" -#include "indirect.h" -#include "glapi.h" -#include - -void -__indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid * row, GLvoid * column, GLvoid * span) -{ - __GLX_SINGLE_DECLARE_VARIABLES(); - const __GLXattribute *state; - xGLXGetSeparableFilterReply reply; - GLubyte *rowBuf, *colBuf; - - if (!dpy) - return; - __GLX_SINGLE_LOAD_VARIABLES(); - state = gc->client_state_private; - - /* Send request */ - __GLX_SINGLE_BEGIN(X_GLsop_GetSeparableFilter, __GLX_PAD(13)); - __GLX_SINGLE_PUT_LONG(0, target); - __GLX_SINGLE_PUT_LONG(4, format); - __GLX_SINGLE_PUT_LONG(8, type); - __GLX_SINGLE_PUT_CHAR(12, state->storePack.swapEndian); - __GLX_SINGLE_READ_XREPLY(); - compsize = reply.length << 2; - - if (compsize != 0) { - GLint width, height; - GLint widthsize, heightsize; - - width = reply.width; - height = reply.height; - - widthsize = __glImageSize(width, 1, 1, format, type, 0); - heightsize = __glImageSize(height, 1, 1, format, type, 0); - - /* Allocate a holding buffer to transform the data from */ - rowBuf = malloc(widthsize); - if (!rowBuf) { - /* Throw data away */ - _XEatData(dpy, compsize); - __glXSetError(gc, GL_OUT_OF_MEMORY); - UnlockDisplay(dpy); - SyncHandle(); - return; - } - else { - __GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize); - __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row); - free((char *) rowBuf); - } - colBuf = malloc(heightsize); - if (!colBuf) { - /* Throw data away */ - _XEatData(dpy, compsize - __GLX_PAD(widthsize)); - __glXSetError(gc, GL_OUT_OF_MEMORY); - UnlockDisplay(dpy); - SyncHandle(); - return; - } - else { - __GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize); - __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column); - free((char *) colBuf); - } - } - else { - /* - ** don't modify user's buffer. - */ - } - __GLX_SINGLE_END(); - -} diff --git a/src/mapi/glapi/gen/glX_XML.py b/src/mapi/glapi/gen/glX_XML.py index 744b0a560ed..53ef3e42582 100644 --- a/src/mapi/glapi/gen/glX_XML.py +++ b/src/mapi/glapi/gen/glX_XML.py @@ -469,7 +469,9 @@ class glx_function(gl_XML.gl_function): """Returns true if the function is supported on the client side for indirect rendering.""" - return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode) + return (not self.ignore and self.exec_flavor != 'skip' and (self.offset != -1) and + (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or + self.client_handcode)) class glx_function_iterator(object):