DRI: Add TexOffset driver hooks.

To be used by AIGLX for GLX_EXT_texture_from_pixmap without several data copies.

The texOffsetStart hook must make sure that the given pixmap is accessible by
the GPU for texturing and return an 'offset' that can be used by the 3D
driver for that purpose.

The texOffsetFinish hook is called when the pixmap is no longer being used for
texturing.
This commit is contained in:
Michel Dänzer 2007-05-22 10:51:52 +02:00
parent ff2eae86b6
commit 5006d08d7f
2 changed files with 24 additions and 2 deletions

View File

@ -2210,6 +2210,19 @@ DRIGetContext(ScreenPtr pScreen)
return pDRIPriv->myContext;
}
void
DRIGetTexOffsetFuncs(ScreenPtr pScreen,
DRITexOffsetStartProcPtr *texOffsetStartFunc,
DRITexOffsetFinishProcPtr *texOffsetFinishFunc)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if (!pDRIPriv) return;
*texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart;
*texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish;
}
/* This lets get at the unwrapped functions so that they can correctly
* call the lowerlevel functions, and choose whether they will be
* called at every level of recursion (eg in validatetree).

View File

@ -107,9 +107,12 @@ typedef struct {
*/
#define DRIINFO_MAJOR_VERSION 5
#define DRIINFO_MINOR_VERSION 2
#define DRIINFO_MINOR_VERSION 3
#define DRIINFO_PATCH_VERSION 0
typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix);
typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix);
typedef struct {
/* driver call back functions
*
@ -180,6 +183,10 @@ typedef struct {
/* New with DRI version 5.2.0 */
Bool allocSarea;
Bool keepFDOpen;
/* New with DRI version 5.3.0 */
DRITexOffsetStartProcPtr texOffsetStart;
DRITexOffsetFinishProcPtr texOffsetFinish;
} DRIInfoRec, *DRIInfoPtr;
@ -358,7 +365,9 @@ extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
DRITexOffsetStartProcPtr *texOffsetStartFunc,
DRITexOffsetFinishProcPtr *texOffsetFinishFunc);
#define _DRI_H_