_mesa_enable_1_4_extensions(mesaCtx);
_mesa_enable_1_5_extensions(mesaCtx);
_mesa_enable_2_0_extensions(mesaCtx);
-#if ENABLE_EXT_texure_compression_s3tc
- if (c->Mesa_DXTn) {
- _mesa_enable_extension(mesaCtx, "GL_EXT_texture_compression_s3tc");
- _mesa_enable_extension(mesaCtx, "GL_S3_s3tc");
- }
- _mesa_enable_extension(mesaCtx, "GL_3DFX_texture_compression_FXT1");
-#endif
-#if ENABLE_EXT_timer_query
- _mesa_enable_extension(mesaCtx, "GL_EXT_timer_query");
-#endif
#ifdef XFree86Server
/* If we're running in the X server, do bounds checking to prevent
}
-/**
- * In SW, we don't really compress GL_COMPRESSED_RGB[A] textures!
- */
-static const struct gl_texture_format *
-choose_tex_format( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_ARB:
- return &_mesa_texformat_rgb;
- case GL_COMPRESSED_RGBA_ARB:
- return &_mesa_texformat_rgba;
- default:
- return _mesa_choose_tex_format(ctx, internalFormat, format, type);
- }
-}
-
-
/**
* Called by glViewport.
* This is a good time for us to poll the current X window size and adjust
}
-#if ENABLE_EXT_timer_query
-
-/*
- * The GL_EXT_timer_query extension is not enabled for the XServer
- * indirect renderer. Not sure about how/if wrapping of gettimeofday()
- * is done, etc.
- */
-
-struct xmesa_query_object
-{
- struct gl_query_object Base;
- struct timeval StartTime;
-};
-
-
-static struct gl_query_object *
-xmesa_new_query_object(GLcontext *ctx, GLuint id)
-{
- struct xmesa_query_object *q = CALLOC_STRUCT(xmesa_query_object);
- if (q) {
- q->Base.Id = id;
- q->Base.Ready = GL_TRUE;
- }
- return &q->Base;
-}
-
-
-static void
-xmesa_begin_query(GLcontext *ctx, struct gl_query_object *q)
-{
- if (q->Target == GL_TIME_ELAPSED_EXT) {
- struct xmesa_query_object *xq = (struct xmesa_query_object *) q;
- (void) gettimeofday(&xq->StartTime, NULL);
- }
-}
-
-
-/**
- * Return the difference between the two given times in microseconds.
- */
-#ifdef __VMS
-#define suseconds_t unsigned int
-#endif
-static GLuint64EXT
-time_diff(const struct timeval *t0, const struct timeval *t1)
-{
- GLuint64EXT seconds0 = t0->tv_sec & 0xff; /* 0 .. 255 seconds */
- GLuint64EXT seconds1 = t1->tv_sec & 0xff; /* 0 .. 255 seconds */
- GLuint64EXT nanosec0 = (seconds0 * 1000000 + t0->tv_usec) * 1000;
- GLuint64EXT nanosec1 = (seconds1 * 1000000 + t1->tv_usec) * 1000;
- return nanosec1 - nanosec0;
-}
-
-
-static void
-xmesa_end_query(GLcontext *ctx, struct gl_query_object *q)
-{
- if (q->Target == GL_TIME_ELAPSED_EXT) {
- struct xmesa_query_object *xq = (struct xmesa_query_object *) q;
- struct timeval endTime;
- (void) gettimeofday(&endTime, NULL);
- /* result is in nanoseconds! */
- q->Result = time_diff(&xq->StartTime, &endTime);
- }
- q->Ready = GL_TRUE;
-}
-
-#endif /* ENABLE_timer_query */
-
-
/**
* Initialize the device driver function table with the functions
* we implement in this driver.
#endif
driver->Viewport = xmesa_viewport;
driver->TestProxyTexImage = test_proxy_teximage;
-#if ENABLE_EXT_texure_compression_s3tc
- driver->ChooseTextureFormat = choose_tex_format;
-#else
- (void) choose_tex_format;
-#endif
-
-#if ENABLE_EXT_timer_query
- driver->NewQueryObject = xmesa_new_query_object;
- driver->BeginQuery = xmesa_begin_query;
- driver->EndQuery = xmesa_end_query;
-#endif
-
}