Add interfaces for overriding texture images with driver specific 'offsets'.

To be used by AIGLX for GLX_EXT_texture_from_pixmap without several
additional data copies.
This commit is contained in:
Michel Dänzer
2007-05-22 14:08:10 +02:00
parent 24d965fab5
commit 043d219b6d
3 changed files with 21 additions and 0 deletions

View File

@@ -361,6 +361,18 @@ struct __DRIscreenRec {
void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes, void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
int render_type, int render_type,
void *sharedPrivate, __DRIcontext *pctx); void *sharedPrivate, __DRIcontext *pctx);
/**
* Method to override base texture image with a driver specific 'offset'.
* The depth passed in allows e.g. to ignore the alpha channel of texture
* images where the non-alpha components don't occupy a whole texel.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*
* \since Internal API version 20070121.
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
}; };
/** /**

View File

@@ -995,6 +995,9 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
psc->getMSC = driGetMSC; psc->getMSC = driGetMSC;
psc->createNewContext = driCreateNewContext; psc->createNewContext = driCreateNewContext;
if (internal_api_version >= 20070121)
psc->setTexOffset = psp->DriverAPI.setTexOffset;
if ( (psp->DriverAPI.InitDriver != NULL) if ( (psp->DriverAPI.InitDriver != NULL)
&& !(*psp->DriverAPI.InitDriver)(psp) ) { && !(*psp->DriverAPI.InitDriver)(psp) ) {
_mesa_free( psp ); _mesa_free( psp );

View File

@@ -189,6 +189,12 @@ struct __DriverAPIRec {
/*@}*/ /*@}*/
void (*CopySubBuffer)(__DRIdrawablePrivate *driDrawPriv, void (*CopySubBuffer)(__DRIdrawablePrivate *driDrawPriv,
int x, int y, int w, int h); int x, int y, int w, int h);
/**
* See corresponding field in \c __DRIscreenRec.
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
}; };