#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
+#include "drivers/common/driverfuncs.h"
+
#include "context.h"
#include "simple_list.h"
#include "imports.h"
#include "matrix.h"
#include "extensions.h"
#if defined(USE_X86_ASM)
-#include "X86/common_x86_asm.h"
+#include "x86/common_x86_asm.h"
#endif
#include "simple_list.h"
#include "mm.h"
#include "gamma_vb.h"
#include "gamma_tris.h"
-extern const struct gl_pipeline_stage _gamma_render_stage;
+extern const struct tnl_pipeline_stage _gamma_render_stage;
-static const struct gl_pipeline_stage *gamma_pipeline[] = {
+static const struct tnl_pipeline_stage *gamma_pipeline[] = {
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
gammaContextPtr gmesa;
gammaScreenPtr gammascrn;
GLINTSAREADRIPtr saPriv=(GLINTSAREADRIPtr)(((char*)sPriv->pSAREA)+
- sizeof(XF86DRISAREARec));
+ sizeof(drm_sarea_t));
+ struct dd_function_table functions;
gmesa = (gammaContextPtr) CALLOC( sizeof(*gmesa) );
- if ( !gmesa ) return GL_FALSE;
+ if (!gmesa)
+ return GL_FALSE;
+
+ /* Init default driver functions then plug in our gamma-specific functions
+ * (the texture functions are especially important)
+ */
+ _mesa_init_driver_functions( &functions );
+ gammaDDInitTextureFuncs( &functions );
/* Allocate the Mesa context */
if (sharedContextPrivate)
else
shareCtx = NULL;
- gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) gmesa, GL_TRUE);
+ gmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
+ &functions, (void *) gmesa);
if (!gmesa->glCtx) {
FREE(gmesa);
return GL_FALSE;
ctx = gmesa->glCtx;
- ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */
+ ctx->Const.MaxTextureLevels = GAMMA_TEX_MAXLEVELS;
ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */
+ ctx->Const.MaxTextureImageUnits = 1;
+ ctx->Const.MaxTextureCoordUnits = 1;
ctx->Const.MinLineWidth = 0.0;
ctx->Const.MaxLineWidth = 255.0;
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
+ _vbo_CreateContext( ctx );
_tnl_CreateContext( ctx );
_swsetup_CreateContext( ctx );
_tnl_destroy_pipeline( ctx );
_tnl_install_pipeline( ctx, gamma_pipeline );
- /* Configure swrast to match hardware characteristics:
+ /* Configure swrast & TNL 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 );
gammaInitVB( ctx );
gammaDDInitExtensions( ctx );
+ /* XXX these should really go right after _mesa_init_driver_functions() */
gammaDDInitDriverFuncs( ctx );
gammaDDInitStateFuncs( ctx );
gammaDDInitSpanFuncs( ctx );
- gammaDDInitTextureFuncs( ctx );
gammaDDInitTriFuncs( ctx );
gammaDDInitState( gmesa );
+ gammaInitTextureObjects( ctx );
+
driContextPriv->driverPrivate = (void *)gmesa;
GET_FIRST_DMA(gmesa->driFd, gmesa->hHWContext,