#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
+#include "drivers/common/driverfuncs.h"
+
#include "r128_context.h"
#include "r128_ioctl.h"
#include "r128_dd.h"
#include "vblank.h"
#include "utils.h"
#include "texmem.h"
-
-/* R128 configuration
- */
-#include "xmlpool.h"
-
-const char __driConfigOptions[] =
-DRI_CONF_BEGIN
-#if ENABLE_PERF_BOXES
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_PERFORMANCE_BOXES(false)
- DRI_CONF_SECTION_END
-#endif
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-#if ENABLE_PERF_BOXES
-const GLuint __driNConfigOptions = 2;
-#else
-const GLuint __driNConfigOptions = 1;
-#endif
+#include "xmlpool.h" /* for symbolic values of enum-type options */
#ifndef R128_DEBUG
int R128_DEBUG = 0;
static const char * const card_extensions[] =
{
+ "GL_ARB_multisample",
"GL_ARB_multitexture",
+ "GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_texture_edge_clamp",
- "GL_EXT_texture_env_add",
- "GL_IBM_texture_mirrored_repeat",
+ "GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
- "GL_SGIS_texture_edge_clamp",
NULL
};
{
GLcontext *ctx, *shareCtx;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ struct dd_function_table functions;
r128ContextPtr rmesa;
r128ScreenPtr r128scrn;
int i;
if ( !rmesa )
return GL_FALSE;
+ /* Init default driver functions then plug in our Radeon-specific functions
+ * (the texture functions are especially important)
+ */
+ _mesa_init_driver_functions( &functions );
+ r128InitDriverFuncs( &functions );
+ r128InitIoctlFuncs( &functions );
+ r128InitTextureFuncs( &functions );
+
/* Allocate the Mesa context */
if (sharedContextPrivate)
shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE);
+ rmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
+ &functions, (void *) rmesa);
if (!rmesa->glCtx) {
FREE(rmesa);
return GL_FALSE;
driParseConfigFiles (&rmesa->optionCache, &r128scrn->optionCache,
r128scrn->driScreen->myNum, "r128");
- rmesa->sarea = (R128SAREAPrivPtr)((char *)sPriv->pSAREA +
+ rmesa->sarea = (drm_r128_sarea_t *)((char *)sPriv->pSAREA +
r128scrn->sarea_priv_offset);
rmesa->CurrentTexObj[0] = NULL;
r128scrn->texSize[i],
12,
R128_NR_TEX_REGIONS,
- rmesa->sarea->texList[i],
- & rmesa->sarea->texAge[i],
- & rmesa->swapped,
+ (drmTextureRegionPtr)rmesa->sarea->tex_list[i],
+ &rmesa->sarea->tex_age[i],
+ &rmesa->swapped,
sizeof( r128TexObj ),
(destroy_texture_object_t *) r128DestroyTexObj );
driSetTextureSwapCounterLocation( rmesa->texture_heaps[i],
& rmesa->c_textureSwaps );
}
+ rmesa->texture_depth = driQueryOptioni (&rmesa->optionCache,
+ "texture_depth");
+ if (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
+ rmesa->texture_depth = ( r128scrn->cpp == 4 ) ?
+ DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
rmesa->RenderIndex = -1; /* Impossible value */
*/
ctx->Const.MaxTextureUnits = 2;
+ ctx->Const.MaxTextureImageUnits = 2;
+ ctx->Const.MaxTextureCoordUnits = 2;
driCalculateMaxTextureLevels( rmesa->texture_heaps,
rmesa->nr_heaps,
/* _tnl_destroy_pipeline( ctx ); */
/* _tnl_install_pipeline( ctx, r128_pipeline ); */
- /* Configure swrast to match hardware characteristics:
+ /* Configure swrast and T&L to match hardware characteristics:
*/
_swrast_allow_pixel_fog( ctx, GL_FALSE );
_swrast_allow_vertex_fog( ctx, GL_TRUE );
+ _tnl_allow_pixel_fog( ctx, GL_FALSE );
+ _tnl_allow_vertex_fog( ctx, GL_TRUE );
driInitExtensions( ctx, card_extensions, GL_TRUE );
if (sPriv->drmMinor >= 4)
r128InitVB( ctx );
r128InitTriFuncs( ctx );
- r128DDInitDriverFuncs( ctx );
- r128DDInitIoctlFuncs( ctx );
r128DDInitStateFuncs( ctx );
r128DDInitSpanFuncs( ctx );
- r128DDInitTextureFuncs( ctx );
r128DDInitState( rmesa );
rmesa->vblank_flags = (rmesa->r128Screen->irq != 0)
*/
int i;
- assert( is_empty_list( & rmesa->swapped ) );
-
for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
driDestroyTextureHeap( rmesa->texture_heaps[ i ] );
rmesa->texture_heaps[ i ] = NULL;
}
+
+ assert( is_empty_list( & rmesa->swapped ) );
}
/* free the option cache */