mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
Send GL_PACK_INVERT_MESA state to the server. This fixes bug #2538.
This commit is contained in:
parent
b52673117b
commit
2e823f29e4
1 changed files with 47 additions and 10 deletions
|
|
@ -37,6 +37,31 @@
|
|||
#include "glxclient.h"
|
||||
#include "indirect.h"
|
||||
|
||||
/**
|
||||
* Send glPixelStore command to the server
|
||||
*
|
||||
* \param gc Current GLX context
|
||||
* \param sop Either \c X_GLsop_PixelStoref or \c X_GLsop_PixelStorei
|
||||
* \param pname Selector of which pixel parameter is to be set.
|
||||
* \param param Value that \c pname is set to.
|
||||
*
|
||||
* \sa __indirect_glPixelStorei, __indirect_glPixelStoref
|
||||
*/
|
||||
static void
|
||||
send_PixelStore( __GLXcontext * gc, unsigned sop, GLenum pname,
|
||||
const void * param )
|
||||
{
|
||||
Display * const dpy = gc->currentDpy;
|
||||
const GLuint cmdlen = 8;
|
||||
if (__builtin_expect(dpy != NULL, 1)) {
|
||||
GLubyte const * pc = __glXSetupSingleRequest(gc, sop, cmdlen);
|
||||
(void) memcpy((void *)(pc + 0), (void *)(&pname), 4);
|
||||
(void) memcpy((void *)(pc + 4), param, 4);
|
||||
UnlockDisplay(dpy); SyncHandle();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Specify parameters that control the storage format of pixel arrays.
|
||||
*/
|
||||
|
|
@ -165,12 +190,18 @@ void __indirect_glPixelStoref(GLenum pname, GLfloat param)
|
|||
case GL_UNPACK_LSB_FIRST:
|
||||
state->storeUnpack.lsbFirst = (param != 0);
|
||||
break;
|
||||
|
||||
/* Group all of the pixel store modes that need to be sent to the
|
||||
* server here. Care must be used to only send modes to the server that
|
||||
* won't affect the size of the data sent to or received from the
|
||||
* server. GL_PACK_INVERT_MESA is safe in this respect, but other,
|
||||
* future modes may not be.
|
||||
*/
|
||||
case GL_PACK_INVERT_MESA:
|
||||
send_PixelStore( gc, X_GLsop_PixelStoref, pname, & param );
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
** NOTE: there are currently no pixel storage commands that need to
|
||||
** be sent to the server. This may change in future versions
|
||||
** of the API, however.
|
||||
*/
|
||||
__glXSetError(gc, GL_INVALID_ENUM);
|
||||
break;
|
||||
}
|
||||
|
|
@ -288,12 +319,18 @@ void __indirect_glPixelStorei(GLenum pname, GLint param)
|
|||
case GL_UNPACK_LSB_FIRST:
|
||||
state->storeUnpack.lsbFirst = (param != 0);
|
||||
break;
|
||||
|
||||
/* Group all of the pixel store modes that need to be sent to the
|
||||
* server here. Care must be used to only send modes to the server that
|
||||
* won't affect the size of the data sent to or received from the
|
||||
* server. GL_PACK_INVERT_MESA is safe in this respect, but other,
|
||||
* future modes may not be.
|
||||
*/
|
||||
case GL_PACK_INVERT_MESA:
|
||||
send_PixelStore( gc, X_GLsop_PixelStorei, pname, & param );
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
** NOTE: there are currently no pixel storage commands that need to
|
||||
** be sent to the server. This may change in future versions
|
||||
** of the API, however.
|
||||
*/
|
||||
__glXSetError(gc, GL_INVALID_ENUM);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue