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 "swrast/swrast.h"
15 #define S3V_DATE "20020207"
18 /* Return the width and height of the current color buffer.
20 static void s3vDDGetBufferSize( GLframebuffer
*buffer
,
21 GLuint
*width
, GLuint
*height
)
23 GET_CURRENT_CONTEXT(ctx
);
24 s3vContextPtr vmesa
= S3V_CONTEXT(ctx
);
26 /* S3VHW_LOCK( vmesa ); */
27 *width
= vmesa
->driDrawable
->w
;
28 *height
= vmesa
->driDrawable
->h
;
29 /* S3VHW_UNLOCK( vmesa ); */
33 /* Return various strings for glGetString().
35 static const GLubyte
*s3vDDGetString( GLcontext
*ctx
, GLenum name
)
37 static char buffer
[128];
41 return (GLubyte
*)"Max Lingua (ladybug)";
44 sprintf( buffer
, "Mesa DRI S3 Virge " S3V_DATE
);
46 /* Append any CPU-specific information.
49 if ( _mesa_x86_cpu_features
) {
50 strncat( buffer
, " x86", 4 );
55 strncat( buffer
, "/MMX", 4 );
59 if ( cpu_has_3dnow
) {
60 strncat( buffer
, "/3DNow!", 7 );
65 strncat( buffer
, "/SSE", 4 );
69 return (GLubyte
*)buffer
;
76 /* Enable the extensions supported by this driver.
78 void s3vInitExtensions( GLcontext
*ctx
)
83 /* Initialize the driver's misc functions.
85 void s3vInitDriverFuncs( GLcontext
*ctx
)
87 ctx
->Driver
.GetBufferSize
= s3vDDGetBufferSize
;
88 ctx
->Driver
.GetString
= s3vDDGetString
;
90 ctx
->Driver
.Error
= NULL
;
92 /* Pixel path fallbacks
94 ctx
->Driver
.Accum
= _swrast_Accum
;
95 ctx
->Driver
.Bitmap
= _swrast_Bitmap
;
96 ctx
->Driver
.CopyPixels
= _swrast_CopyPixels
;
97 ctx
->Driver
.DrawPixels
= _swrast_DrawPixels
;
98 ctx
->Driver
.ReadPixels
= _swrast_ReadPixels
;
99 ctx
->Driver
.ResizeBuffers
= _swrast_alloc_buffers
;
101 /* Swrast hooks for imaging extensions:
103 ctx
->Driver
.CopyColorTable
= _swrast_CopyColorTable
;
104 ctx
->Driver
.CopyColorSubTable
= _swrast_CopyColorSubTable
;
105 ctx
->Driver
.CopyConvolutionFilter1D
= _swrast_CopyConvolutionFilter1D
;
106 ctx
->Driver
.CopyConvolutionFilter2D
= _swrast_CopyConvolutionFilter2D
;