Move new texOffset extension to the new extension mechanism.

This commit is contained in:
Kristian Høgsberg 2007-05-22 12:26:02 -04:00 committed by Kristian Høgsberg
parent ecdb45cb29
commit f29f0ae838
4 changed files with 28 additions and 20 deletions

View File

@ -63,6 +63,7 @@ typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
typedef struct __DRIallocateExtensionRec __DRIallocateExtension;
typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
/*@}*/
@ -169,6 +170,22 @@ struct __DRImediaStreamCounterExtensionRec {
};
#define __DRI_TEX_OFFSET "DRI_TexOffset"
struct __DRItexOffsetExtensionRec {
__DRIextension base;
/**
* 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.
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
};
/**
* Macros for building symbol and strings. Standard CPP two step...
*/
@ -379,18 +396,6 @@ struct __DRIscreenRec {
int render_type,
__DRIcontext *shared,
drm_context_t hwContext, __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

@ -752,9 +752,6 @@ void * __DRI_CREATE_NEW_SCREEN( int scrn, __DRIscreen *psc,
psc->createNewDrawable = driCreateNewDrawable;
psc->createNewContext = driCreateNewContext;
if (internal_api_version >= 20070121)
psc->setTexOffset = psp->DriverAPI.setTexOffset;
*driver_modes = __driDriverInitScreen(psp);
if (*driver_modes == NULL) {
_mesa_free(psp);

View File

@ -333,14 +333,19 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
}
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
static const __DRIallocateExtension r200AllocateExtension = {
{ __DRI_ALLOCATE },
r200AllocateMemoryMESA,
r200FreeMemoryMESA,
r200GetMemoryOffsetMESA
};
#endif
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
static const __DRItexOffsetExtension r300texOffsetExtension = {
{ __DRI_TEX_OFFSET },
r300SetTexOffset,
};
#endif
/* Create the device specific screen private data struct.
@ -755,6 +760,10 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
screen->extensions[i++] = &r200AllocateExtension.base;
#endif
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
screen->extensions[i++] = &r300texOffsetExtension.base;
#endif
screen->extensions[i++] = NULL;
sPriv->extensions = screen->extensions;
@ -956,9 +965,6 @@ static struct __DriverAPIRec radeonAPI = {
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
.CopySubBuffer = radeonCopySubBuffer,
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
.setTexOffset = r300SetTexOffset,
#endif
};
#else
static const struct __DriverAPIRec r200API = {

View File

@ -104,7 +104,7 @@ typedef struct {
/* Configuration cache with default values for all contexts */
driOptionCache optionCache;
const __DRIextension *extensions[7];
const __DRIextension *extensions[8];
} radeonScreenRec, *radeonScreenPtr;
#define IS_R100_CLASS(screen) \