mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-23 04:58:09 +02:00
Disable check for fbconfig for now so we can create RGBA textures from 32
bit visuals. Implement GLX_texture_from_drawable.
This commit is contained in:
parent
e0cbd33e85
commit
e821ad884e
4 changed files with 141 additions and 1 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,3 +1,14 @@
|
|||
2006-01-27 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* GL/glx/glxcmds.c (DoCreateGLXPixmap): Disable check for fbconfig
|
||||
for now so we can create RGBA textures from 32 bit visuals.
|
||||
|
||||
* GL/glx/glxcmds.c (__glXBindTexImageEXT)
|
||||
(__glXReleaseTexImageEXT), (__glXVendorPrivate):
|
||||
* GL/glx/glxcmdsswap.c: (__glXSwapBindTexImageEXT),
|
||||
(__glXSwapReleaseTexImageEXT), (__glXSwapVendorPrivate):
|
||||
* GL/glx/glxext.h: Implement GLX_texture_from_drawable.
|
||||
|
||||
2006-01-26 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* GL/glx/glxutil.c (__glXCreateDrawablePrivate)
|
||||
|
|
|
|||
|
|
@ -1162,6 +1162,7 @@ int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
|
|||
** Get configuration of the visual.
|
||||
*/
|
||||
pGlxScreen = &__glXActiveScreens[screenNum];
|
||||
#if 0
|
||||
modes = _gl_context_modes_find_visual( pGlxScreen->modes, visual );
|
||||
if (modes == NULL) {
|
||||
/*
|
||||
|
|
@ -1170,7 +1171,7 @@ int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
|
|||
client->errorValue = visual;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
#endif
|
||||
pGlxPixmap = (__GLXpixmap *) __glXMalloc(sizeof(__GLXpixmap));
|
||||
if (!pGlxPixmap) {
|
||||
return BadAlloc;
|
||||
|
|
@ -1391,6 +1392,79 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
ClientPtr client = cl->client;
|
||||
PixmapPtr pixmap;
|
||||
__GLXpixmap *pGlxPixmap;
|
||||
GLXDrawable drawId;
|
||||
int buffer;
|
||||
int error;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = *((CARD32 *) (pc));
|
||||
buffer = *((INT32 *) (pc + 4));
|
||||
|
||||
if (buffer != GLX_FRONT_LEFT_EXT)
|
||||
return __glXBadPixmap;
|
||||
|
||||
if (!__glXForceCurrent (cl, req->contextTag, &error))
|
||||
return error;
|
||||
|
||||
pGlxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes);
|
||||
if (!pGlxPixmap) {
|
||||
client->errorValue = drawId;
|
||||
return __glXBadPixmap;
|
||||
}
|
||||
|
||||
pixmap = (PixmapPtr) pGlxPixmap->pDraw;
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, pixmap->devKind / 4) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, pixmap->drawable.y) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, pixmap->drawable.x) );
|
||||
|
||||
CALL_TexImage2D( GET_DISPATCH(),
|
||||
( GL_TEXTURE_RECTANGLE_ARB,
|
||||
0,
|
||||
4,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height,
|
||||
0,
|
||||
GL_BGRA,
|
||||
GL_UNSIGNED_BYTE,
|
||||
pixmap->devPrivate.ptr ) );
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
ClientPtr client = cl->client;
|
||||
__GLXpixmap *pGlxPixmap;
|
||||
GLXDrawable drawId;
|
||||
int buffer;
|
||||
int error;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = *((CARD32 *) (pc));
|
||||
buffer = *((INT32 *) (pc + 4));
|
||||
|
||||
if (!__glXForceCurrent (cl, req->contextTag, &error))
|
||||
return error;
|
||||
|
||||
pGlxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes);
|
||||
if (!pGlxPixmap) {
|
||||
client->errorValue = drawId;
|
||||
return __glXBadDrawable;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
|
@ -1965,6 +2039,10 @@ int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
|
|||
return Success;
|
||||
case X_GLXvop_BindSwapBarrierSGIX:
|
||||
return __glXBindSwapBarrierSGIX(cl, pc);
|
||||
case X_GLXvop_BindTexImageEXT:
|
||||
return __glXBindTexImageEXT(cl, pc);
|
||||
case X_GLXvop_ReleaseTexImageEXT:
|
||||
return __glXReleaseTexImageEXT(cl, pc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -389,6 +389,48 @@ int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
|
|||
return __glXQueryContextInfoEXT(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
GLXDrawable *drawId;
|
||||
int *buffer;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = ((GLXDrawable *) (pc));
|
||||
buffer = ((int *) (pc + 4));
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(drawId);
|
||||
__GLX_SWAP_INT(buffer);
|
||||
|
||||
return __glXBindTexImageEXT(cl, (GLbyte *)pc);
|
||||
}
|
||||
|
||||
int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
GLXDrawable *drawId;
|
||||
int *buffer;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = ((GLXDrawable *) (pc));
|
||||
buffer = ((int *) (pc + 4));
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(drawId);
|
||||
__GLX_SWAP_INT(buffer);
|
||||
|
||||
return __glXReleaseTexImageEXT(cl, (GLbyte *)pc);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
@ -824,6 +866,10 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
|
|||
__GLX_SWAP_INT(pc + 4);
|
||||
CALL_SamplePatternSGIS( GET_DISPATCH(), (*(GLenum *)(pc + 4)) );
|
||||
return Success;
|
||||
case X_GLXvop_BindTexImageEXT:
|
||||
return __glXSwapBindTexImageEXT(cl, pc);
|
||||
case X_GLXvop_ReleaseTexImageEXT:
|
||||
return __glXSwapReleaseTexImageEXT(cl, pc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ extern void __glXResetLargeCommandStatus(__GLXclientState*);
|
|||
extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
|
||||
extern int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
extern int __glXSwapBindTexImageEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
extern int __glXReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
extern int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
|
||||
extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
|
||||
GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
|
||||
extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue