glx: don't generate indirect GLX dispatch for ARB_imaging functions
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34002>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ files_libglx = files(
|
||||
'render2.c',
|
||||
'renderpix.c',
|
||||
'single2.c',
|
||||
'singlepix.c',
|
||||
'vertarr.c',
|
||||
'xfont.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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <GL/glxproto.h>
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user