2 * Author: Max Lingua <sunmax@libero.it>
5 #include "s3v_context.h"
8 #if defined(USE_X86_ASM)
9 #include "x86/common_x86_asm.h"
13 #include "framebuffer.h"
14 #include "swrast/swrast.h"
16 #define S3V_DATE "20020207"
19 /* Return the width and height of the current color buffer.
21 static void s3vDDGetBufferSize( GLframebuffer
*buffer
,
22 GLuint
*width
, GLuint
*height
)
24 GET_CURRENT_CONTEXT(ctx
);
25 s3vContextPtr vmesa
= S3V_CONTEXT(ctx
);
27 /* S3VHW_LOCK( vmesa ); */
28 *width
= vmesa
->driDrawable
->w
;
29 *height
= vmesa
->driDrawable
->h
;
30 /* S3VHW_UNLOCK( vmesa ); */
34 /* Return various strings for glGetString().
36 static const GLubyte
*s3vDDGetString( GLcontext
*ctx
, GLenum name
)
38 static char buffer
[128];
42 return (GLubyte
*)"Max Lingua (ladybug)";
45 sprintf( buffer
, "Mesa DRI S3 Virge " S3V_DATE
);
47 /* Append any CPU-specific information.
50 if ( _mesa_x86_cpu_features
) {
51 strncat( buffer
, " x86", 4 );
56 strncat( buffer
, "/MMX", 4 );
60 if ( cpu_has_3dnow
) {
61 strncat( buffer
, "/3DNow!", 7 );
66 strncat( buffer
, "/SSE", 4 );
70 return (GLubyte
*)buffer
;
77 /* Enable the extensions supported by this driver.
79 void s3vInitExtensions( GLcontext
*ctx
)
84 /* Initialize the driver's misc functions.
86 void s3vInitDriverFuncs( GLcontext
*ctx
)
88 ctx
->Driver
.GetBufferSize
= s3vDDGetBufferSize
;
89 ctx
->Driver
.GetString
= s3vDDGetString
;
91 ctx
->Driver
.Error
= NULL
;
93 /* Pixel path fallbacks
95 ctx
->Driver
.Accum
= _swrast_Accum
;
96 ctx
->Driver
.Bitmap
= _swrast_Bitmap
;
97 ctx
->Driver
.CopyPixels
= _swrast_CopyPixels
;
98 ctx
->Driver
.DrawPixels
= _swrast_DrawPixels
;
99 ctx
->Driver
.ReadPixels
= _swrast_ReadPixels
;
100 ctx
->Driver
.ResizeBuffers
= _mesa_resize_framebuffer
;
102 /* Swrast hooks for imaging extensions:
104 ctx
->Driver
.CopyColorTable
= _swrast_CopyColorTable
;
105 ctx
->Driver
.CopyColorSubTable
= _swrast_CopyColorSubTable
;
106 ctx
->Driver
.CopyConvolutionFilter1D
= _swrast_CopyConvolutionFilter1D
;
107 ctx
->Driver
.CopyConvolutionFilter2D
= _swrast_CopyConvolutionFilter2D
;