1 /* $Id: fxddspan.c,v 1.26 2003/10/09 15:12:21 dborca Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 /* fxdd.c - 3Dfx VooDoo Mesa span and pixel functions */
48 #include "swrast/swrast.h"
51 #define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
52 FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
56 /* KW: Rearranged the args in the call to grLfbWriteRegion().
58 #define LFB_WRITE_SPAN_MESA(dst_buffer, \
64 writeRegionClipped(fxMesa, dst_buffer, \
67 GR_LFB_SRC_FMT_8888, \
74 /************************************************************************/
75 /***** Span functions *****/
76 /************************************************************************/
77 #define TDFXPACKCOLOR1555( r, g, b, a ) \
78 ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
80 #define TDFXPACKCOLOR565( r, g, b ) \
81 ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
82 #define TDFXPACKCOLOR8888( r, g, b, a ) \
83 (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
84 /************************************************************************/
91 GLuint pitch = info.strideInBytes; \
92 GLuint height = fxMesa->height; \
93 char *buf = (char *)((char *)info.lfbPtr + 0 /* x, y offset */); \
97 #define CLIPPIXEL( _x, _y ) ( _x >= minx && _x < maxx && \
98 _y >= miny && _y < maxy )
100 #define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
101 if ( _y < miny || _y >= maxy ) { \
106 if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx;\
107 if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \
110 #define Y_FLIP(_y) (height - _y - 1)
112 #define HW_WRITE_LOCK() \
113 fxMesaContext fxMesa = FX_CONTEXT(ctx); \
115 info.size = sizeof(GrLfbInfo_t); \
116 if ( grLfbLock( GR_LFB_WRITE_ONLY, \
117 fxMesa->currentFB, LFB_MODE, \
118 GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
120 #define HW_WRITE_UNLOCK() \
121 grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->currentFB ); \
124 #define HW_READ_LOCK() \
125 fxMesaContext fxMesa = FX_CONTEXT(ctx); \
127 info.size = sizeof(GrLfbInfo_t); \
128 if ( grLfbLock( GR_LFB_READ_ONLY, fxMesa->currentFB, \
129 LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
131 #define HW_READ_UNLOCK() \
132 grLfbUnlock( GR_LFB_READ_ONLY, fxMesa->currentFB ); \
135 #define HW_WRITE_CLIPLOOP() \
137 int _nc = 1; /* numcliprects */ \
139 const int minx = fxMesa->clipMinX; \
140 const int miny = fxMesa->clipMinY; \
141 const int maxx = fxMesa->clipMaxX; \
142 const int maxy = fxMesa->clipMaxY;
144 #define HW_READ_CLIPLOOP() \
146 int _nc = 1; /* numcliprects */ \
148 const int minx = fxMesa->clipMinX; \
149 const int miny = fxMesa->clipMinY; \
150 const int maxx = fxMesa->clipMaxX; \
151 const int maxy = fxMesa->clipMaxY;
153 #define HW_ENDCLIPLOOP() \
158 /* 16 bit, ARGB1555 color spanline and pixel functions */
161 #define LFB_MODE GR_LFBWRITEMODE_1555
164 #define BYTESPERPIXEL 2
166 #undef INIT_MONO_PIXEL
167 #define INIT_MONO_PIXEL(p, color) \
168 p = TDFXPACKCOLOR1555( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] )
170 #define WRITE_RGBA( _x, _y, r, g, b, a ) \
171 *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
172 TDFXPACKCOLOR1555( r, g, b, a )
174 #define WRITE_PIXEL( _x, _y, p ) \
175 *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
177 #define READ_RGBA( rgba, _x, _y ) \
179 GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
180 rgba[0] = FX_rgb_scale_5[(p >> 10) & 0x1F]; \
181 rgba[1] = FX_rgb_scale_5[(p >> 5) & 0x1F]; \
182 rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \
183 rgba[3] = (p & 0x8000) ? 255 : 0; \
186 #define TAG(x) tdfx##x##_ARGB1555
187 #include "../dri/common/spantmp.h"
190 /* 16 bit, RGB565 color spanline and pixel functions */
193 #define LFB_MODE GR_LFBWRITEMODE_565
196 #define BYTESPERPIXEL 2
198 #undef INIT_MONO_PIXEL
199 #define INIT_MONO_PIXEL(p, color) \
200 p = TDFXPACKCOLOR565( color[RCOMP], color[GCOMP], color[BCOMP] )
202 #define WRITE_RGBA( _x, _y, r, g, b, a ) \
203 *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
204 TDFXPACKCOLOR565( r, g, b )
206 #define WRITE_PIXEL( _x, _y, p ) \
207 *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
209 #define READ_RGBA( rgba, _x, _y ) \
211 GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
212 rgba[0] = FX_rgb_scale_5[(p >> 11) & 0x1F]; \
213 rgba[1] = FX_rgb_scale_6[(p >> 5) & 0x3F]; \
214 rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \
218 #define TAG(x) tdfx##x##_RGB565
219 #include "../dri/common/spantmp.h"
222 /* 32 bit, ARGB8888 color spanline and pixel functions */
225 #define LFB_MODE GR_LFBWRITEMODE_8888
228 #define BYTESPERPIXEL 4
230 #undef INIT_MONO_PIXEL
231 #define INIT_MONO_PIXEL(p, color) \
232 p = TDFXPACKCOLOR8888( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] )
234 #define WRITE_RGBA( _x, _y, r, g, b, a ) \
235 *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
236 TDFXPACKCOLOR8888( r, g, b, a )
238 #define WRITE_PIXEL( _x, _y, p ) \
239 *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
241 #define READ_RGBA( rgba, _x, _y ) \
243 GLuint p = *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
244 rgba[0] = (p >> 16) & 0xff; \
245 rgba[1] = (p >> 8) & 0xff; \
246 rgba[2] = (p >> 0) & 0xff; \
247 rgba[3] = (p >> 24) & 0xff; \
250 #define TAG(x) tdfx##x##_ARGB8888
251 #include "../dri/common/spantmp.h"
254 /************************************************************************/
255 /***** Span functions (optimized) *****/
256 /************************************************************************/
259 * Read a span of 15-bit RGB pixels. Note, we don't worry about cliprects
260 * since OpenGL says obscured pixels have undefined values.
262 static void fxReadRGBASpan_ARGB1555 (const GLcontext
* ctx
,
267 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
269 info
.size
= sizeof(GrLfbInfo_t
);
270 if (grLfbLock(GR_LFB_READ_ONLY
, fxMesa
->currentFB
,
271 GR_LFBWRITEMODE_ANY
, GR_ORIGIN_UPPER_LEFT
, FXFALSE
, &info
)) {
272 const GLint winX
= 0;
273 const GLint winY
= fxMesa
->height
- 1;
274 const GLushort
*data16
= (const GLushort
*)((const GLubyte
*)info
.lfbPtr
+
275 (winY
- y
) * info
.strideInBytes
+
277 const GLuint
*data32
= (const GLuint
*) data16
;
279 GLuint extraPixel
= (n
& 1);
282 for (i
= j
= 0; i
< n
; i
+= 2, j
++) {
283 GLuint pixel
= data32
[j
];
284 rgba
[i
][0] = FX_rgb_scale_5
[(pixel
>> 10) & 0x1F];
285 rgba
[i
][1] = FX_rgb_scale_5
[(pixel
>> 5) & 0x1F];
286 rgba
[i
][2] = FX_rgb_scale_5
[ pixel
& 0x1F];
287 rgba
[i
][3] = (pixel
& 0x8000) ? 255 : 0;
288 rgba
[i
+1][0] = FX_rgb_scale_5
[(pixel
>> 26) & 0x1F];
289 rgba
[i
+1][1] = FX_rgb_scale_5
[(pixel
>> 21) & 0x1F];
290 rgba
[i
+1][2] = FX_rgb_scale_5
[(pixel
>> 16) & 0x1F];
291 rgba
[i
+1][3] = (pixel
& 0x80000000) ? 255 : 0;
294 GLushort pixel
= data16
[n
];
295 rgba
[n
][0] = FX_rgb_scale_5
[(pixel
>> 10) & 0x1F];
296 rgba
[n
][1] = FX_rgb_scale_5
[(pixel
>> 5) & 0x1F];
297 rgba
[n
][2] = FX_rgb_scale_5
[ pixel
& 0x1F];
298 rgba
[n
][3] = (pixel
& 0x8000) ? 255 : 0;
301 grLfbUnlock(GR_LFB_READ_ONLY
, fxMesa
->currentFB
);
306 * Read a span of 16-bit RGB pixels. Note, we don't worry about cliprects
307 * since OpenGL says obscured pixels have undefined values.
309 static void fxReadRGBASpan_RGB565 (const GLcontext
* ctx
,
314 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
316 info
.size
= sizeof(GrLfbInfo_t
);
317 if (grLfbLock(GR_LFB_READ_ONLY
, fxMesa
->currentFB
,
318 GR_LFBWRITEMODE_ANY
, GR_ORIGIN_UPPER_LEFT
, FXFALSE
, &info
)) {
319 const GLint winX
= 0;
320 const GLint winY
= fxMesa
->height
- 1;
321 const GLushort
*data16
= (const GLushort
*)((const GLubyte
*)info
.lfbPtr
+
322 (winY
- y
) * info
.strideInBytes
+
324 const GLuint
*data32
= (const GLuint
*) data16
;
326 GLuint extraPixel
= (n
& 1);
329 for (i
= j
= 0; i
< n
; i
+= 2, j
++) {
330 GLuint pixel
= data32
[j
];
332 GLuint pixel0
= pixel
& 0xffff;
333 GLuint pixel1
= pixel
>> 16;
334 rgba
[i
][RCOMP
] = FX_PixelToR
[pixel0
];
335 rgba
[i
][GCOMP
] = FX_PixelToG
[pixel0
];
336 rgba
[i
][BCOMP
] = FX_PixelToB
[pixel0
];
337 rgba
[i
][ACOMP
] = 255;
338 rgba
[i
+ 1][RCOMP
] = FX_PixelToR
[pixel1
];
339 rgba
[i
+ 1][GCOMP
] = FX_PixelToG
[pixel1
];
340 rgba
[i
+ 1][BCOMP
] = FX_PixelToB
[pixel1
];
341 rgba
[i
+ 1][ACOMP
] = 255;
343 rgba
[i
][0] = FX_rgb_scale_5
[(pixel
>> 11) & 0x1F];
344 rgba
[i
][1] = FX_rgb_scale_6
[(pixel
>> 5) & 0x3F];
345 rgba
[i
][2] = FX_rgb_scale_5
[ pixel
& 0x1F];
347 rgba
[i
+1][0] = FX_rgb_scale_5
[(pixel
>> 27) & 0x1F];
348 rgba
[i
+1][1] = FX_rgb_scale_6
[(pixel
>> 21) & 0x3F];
349 rgba
[i
+1][2] = FX_rgb_scale_5
[(pixel
>> 16) & 0x1F];
354 GLushort pixel
= data16
[n
];
356 rgba
[n
][RCOMP
] = FX_PixelToR
[pixel
];
357 rgba
[n
][GCOMP
] = FX_PixelToG
[pixel
];
358 rgba
[n
][BCOMP
] = FX_PixelToB
[pixel
];
359 rgba
[n
][ACOMP
] = 255;
361 rgba
[n
][0] = FX_rgb_scale_5
[(pixel
>> 11) & 0x1F];
362 rgba
[n
][1] = FX_rgb_scale_6
[(pixel
>> 5) & 0x3F];
363 rgba
[n
][2] = FX_rgb_scale_5
[ pixel
& 0x1F];
368 grLfbUnlock(GR_LFB_READ_ONLY
, fxMesa
->currentFB
);
373 * Read a span of 32-bit RGB pixels. Note, we don't worry about cliprects
374 * since OpenGL says obscured pixels have undefined values.
376 static void fxReadRGBASpan_ARGB8888 (const GLcontext
* ctx
,
381 /* Hack alert: WRONG! */
382 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
383 grLfbReadRegion(fxMesa
->currentFB
, x
, fxMesa
->height
- 1 - y
, n
, 1, n
* 4, rgba
);
387 /************************************************************************/
388 /***** Depth functions *****/
389 /************************************************************************/
392 fxDDWriteDepthSpan(GLcontext
* ctx
,
393 GLuint n
, GLint x
, GLint y
, const GLdepth depth
[],
394 const GLubyte mask
[])
396 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
397 GLint bottom
= fxMesa
->height
- 1;
399 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
400 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
406 for (i
= 0; i
< n
; i
++) {
408 GLshort d
= depth
[i
];
409 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, x
+ i
, bottom
- y
,
410 GR_LFB_SRC_FMT_ZA16
, 1, 1, 0, (void *) &d
);
415 GLushort depth16
[MAX_WIDTH
];
417 for (i
= 0; i
< n
; i
++) {
418 depth16
[i
] = depth
[i
];
420 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, x
, bottom
- y
,
421 GR_LFB_SRC_FMT_ZA16
, n
, 1, 0, (void *) depth16
);
427 fxDDWriteDepth32Span(GLcontext
* ctx
,
428 GLuint n
, GLint x
, GLint y
, const GLdepth depth
[],
429 const GLubyte mask
[])
431 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
432 GLint bottom
= fxMesa
->height
- 1;
435 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
436 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
441 for (i
= 0; i
< n
; i
++) {
443 GLuint d
= depth
[i
] << 8;
444 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, x
+ i
, bottom
- y
,
445 GR_LFBWRITEMODE_Z32
, 1, 1, 0, (void *) &d
);
450 GLuint depth32
[MAX_WIDTH
];
451 for (i
= 0; i
< n
; i
++) {
452 depth32
[i
] = depth
[i
] << 8;
454 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, x
, bottom
- y
,
455 GR_LFBWRITEMODE_Z32
, n
, 1, 0, (void *) depth32
);
461 fxDDReadDepthSpan(GLcontext
* ctx
,
462 GLuint n
, GLint x
, GLint y
, GLdepth depth
[])
464 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
465 GLint bottom
= fxMesa
->height
- 1;
466 GLushort depth16
[MAX_WIDTH
];
469 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
470 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
473 grLfbReadRegion(GR_BUFFER_AUXBUFFER
, x
, bottom
- y
, n
, 1, 0, depth16
);
474 for (i
= 0; i
< n
; i
++) {
475 depth
[i
] = depth16
[i
];
481 fxDDReadDepth32Span(GLcontext
* ctx
,
482 GLuint n
, GLint x
, GLint y
, GLdepth depth
[])
484 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
485 GLint bottom
= fxMesa
->height
- 1;
487 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
488 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
491 grLfbReadRegion(GR_BUFFER_AUXBUFFER
, x
, bottom
- y
, n
, 1, 0, depth
);
497 fxDDWriteDepthPixels(GLcontext
* ctx
,
498 GLuint n
, const GLint x
[], const GLint y
[],
499 const GLdepth depth
[], const GLubyte mask
[])
501 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
502 GLint bottom
= fxMesa
->height
- 1;
505 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
506 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
509 for (i
= 0; i
< n
; i
++) {
512 int ypos
= bottom
- y
[i
];
513 GLushort d
= depth
[i
];
514 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, xpos
, ypos
,
515 GR_LFB_SRC_FMT_ZA16
, 1, 1, 0, (void *) &d
);
522 fxDDWriteDepth32Pixels(GLcontext
* ctx
,
523 GLuint n
, const GLint x
[], const GLint y
[],
524 const GLdepth depth
[], const GLubyte mask
[])
526 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
527 GLint bottom
= fxMesa
->height
- 1;
530 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
531 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
534 for (i
= 0; i
< n
; i
++) {
537 int ypos
= bottom
- y
[i
];
538 GLuint d
= depth
[i
] << 8;
539 writeRegionClipped(fxMesa
, GR_BUFFER_AUXBUFFER
, xpos
, ypos
,
540 GR_LFBWRITEMODE_Z32
, 1, 1, 0, (void *) &d
);
547 fxDDReadDepthPixels(GLcontext
* ctx
, GLuint n
,
548 const GLint x
[], const GLint y
[], GLdepth depth
[])
550 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
551 GLint bottom
= fxMesa
->height
- 1;
554 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
555 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
558 for (i
= 0; i
< n
; i
++) {
560 int ypos
= bottom
- y
[i
];
562 grLfbReadRegion(GR_BUFFER_AUXBUFFER
, xpos
, ypos
, 1, 1, 0, &d
);
569 fxDDReadDepth32Pixels(GLcontext
* ctx
, GLuint n
,
570 const GLint x
[], const GLint y
[], GLdepth depth
[])
572 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
573 GLint bottom
= fxMesa
->height
- 1;
576 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
577 fprintf(stderr
, "%s(...)\n", __FUNCTION__
);
580 for (i
= 0; i
< n
; i
++) {
582 int ypos
= bottom
- y
[i
];
583 grLfbReadRegion(GR_BUFFER_AUXBUFFER
, xpos
, ypos
, 1, 1, 0, &depth
[i
]);
589 /* Set the buffer used for reading */
590 /* XXX support for separate read/draw buffers hasn't been tested */
592 fxDDSetBuffer(GLcontext
* ctx
, GLframebuffer
* buffer
, GLuint bufferBit
)
594 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
597 if (TDFX_DEBUG
& VERBOSE_DRIVER
) {
598 fprintf(stderr
, "%s(%x)\n", __FUNCTION__
, (int)bufferBit
);
601 if (bufferBit
== FRONT_LEFT_BIT
) {
602 fxMesa
->currentFB
= GR_BUFFER_FRONTBUFFER
;
603 grRenderBuffer(fxMesa
->currentFB
);
605 else if (bufferBit
== BACK_LEFT_BIT
) {
606 fxMesa
->currentFB
= GR_BUFFER_BACKBUFFER
;
607 grRenderBuffer(fxMesa
->currentFB
);
612 /************************************************************************/
617 fxSetupDDSpanPointers(GLcontext
* ctx
)
619 struct swrast_device_driver
*swdd
= _swrast_GetDeviceDriverReference( ctx
);
620 fxMesaContext fxMesa
= FX_CONTEXT(ctx
);
622 swdd
->SetBuffer
= fxDDSetBuffer
;
624 switch (fxMesa
->colDepth
) {
626 swdd
->WriteRGBASpan
= tdfxWriteRGBASpan_ARGB1555
;
627 swdd
->WriteRGBSpan
= tdfxWriteRGBSpan_ARGB1555
;
628 swdd
->WriteRGBAPixels
= tdfxWriteRGBAPixels_ARGB1555
;
629 swdd
->WriteMonoRGBASpan
= tdfxWriteMonoRGBASpan_ARGB1555
;
630 swdd
->WriteMonoRGBAPixels
= tdfxWriteMonoRGBAPixels_ARGB1555
;
631 swdd
->ReadRGBASpan
= /*td*/fxReadRGBASpan_ARGB1555
;
632 swdd
->ReadRGBAPixels
= tdfxReadRGBAPixels_ARGB1555
;
634 swdd
->WriteDepthSpan
= fxDDWriteDepthSpan
;
635 swdd
->WriteDepthPixels
= fxDDWriteDepthPixels
;
636 swdd
->ReadDepthSpan
= fxDDReadDepthSpan
;
637 swdd
->ReadDepthPixels
= fxDDReadDepthPixels
;
640 swdd
->WriteRGBASpan
= tdfxWriteRGBASpan_RGB565
;
641 swdd
->WriteRGBSpan
= tdfxWriteRGBSpan_RGB565
;
642 swdd
->WriteRGBAPixels
= tdfxWriteRGBAPixels_RGB565
;
643 swdd
->WriteMonoRGBASpan
= tdfxWriteMonoRGBASpan_RGB565
;
644 swdd
->WriteMonoRGBAPixels
= tdfxWriteMonoRGBAPixels_RGB565
;
645 swdd
->ReadRGBASpan
= /*td*/fxReadRGBASpan_RGB565
;
646 swdd
->ReadRGBAPixels
= tdfxReadRGBAPixels_RGB565
;
648 swdd
->WriteDepthSpan
= fxDDWriteDepthSpan
;
649 swdd
->WriteDepthPixels
= fxDDWriteDepthPixels
;
650 swdd
->ReadDepthSpan
= fxDDReadDepthSpan
;
651 swdd
->ReadDepthPixels
= fxDDReadDepthPixels
;
654 swdd
->WriteRGBASpan
= tdfxWriteRGBASpan_ARGB8888
;
655 swdd
->WriteRGBSpan
= tdfxWriteRGBSpan_ARGB8888
;
656 swdd
->WriteRGBAPixels
= tdfxWriteRGBAPixels_ARGB8888
;
657 swdd
->WriteMonoRGBASpan
= tdfxWriteMonoRGBASpan_ARGB8888
;
658 swdd
->WriteMonoRGBAPixels
= tdfxWriteMonoRGBAPixels_ARGB8888
;
659 swdd
->ReadRGBASpan
= tdfxReadRGBASpan_ARGB8888
;
660 swdd
->ReadRGBAPixels
= tdfxReadRGBAPixels_ARGB8888
;
662 swdd
->WriteDepthSpan
= fxDDWriteDepth32Span
;
663 swdd
->WriteDepthPixels
= fxDDWriteDepth32Pixels
;
664 swdd
->ReadDepthSpan
= fxDDReadDepth32Span
;
665 swdd
->ReadDepthPixels
= fxDDReadDepth32Pixels
;
670 if ( fxMesa
->haveHwStencil
) {
671 swdd
->WriteStencilSpan
= write_stencil_span
;
672 swdd
->ReadStencilSpan
= read_stencil_span
;
673 swdd
->WriteStencilPixels
= write_stencil_pixels
;
674 swdd
->ReadStencilPixels
= read_stencil_pixels
;
677 swdd
->WriteDepthSpan
= tdfxDDWriteDepthSpan
;
678 swdd
->WriteDepthPixels
= tdfxDDWriteDepthPixels
;
679 swdd
->ReadDepthSpan
= tdfxDDReadDepthSpan
;
680 swdd
->ReadDepthPixels
= tdfxDDReadDepthPixels
;
682 swdd
->WriteCI8Span
= NULL
;
683 swdd
->WriteCI32Span
= NULL
;
684 swdd
->WriteMonoCISpan
= NULL
;
685 swdd
->WriteCI32Pixels
= NULL
;
686 swdd
->WriteMonoCIPixels
= NULL
;
687 swdd
->ReadCI32Span
= NULL
;
688 swdd
->ReadCI32Pixels
= NULL
;
690 swdd
->SpanRenderStart
= tdfxSpanRenderStart
; /* BEGIN_BOARD_LOCK */
691 swdd
->SpanRenderFinish
= tdfxSpanRenderFinish
; /* END_BOARD_LOCK */
700 * Need this to provide at least one external definition.
703 extern int gl_fx_dummy_function_span(void);
705 gl_fx_dummy_function_span(void)