e3a865b0d45d0bab57b3749a2da20315600ffcba
[mesa.git] / src / mesa / drivers / glide / fxdrv.h
1 /* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
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:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
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.
25 *
26 *
27 * Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
28 * terms stated above.
29 *
30 * Thank you for your contribution, David!
31 *
32 * Please make note of the above copyright/license statement. If you
33 * contributed code or bug fixes to this code under the previous (GNU
34 * Library) license and object to the new license, your code will be
35 * removed at your request. Please see the Mesa docs/COPYRIGHT file
36 * for more information.
37 *
38 * Additional Mesa/3Dfx driver developers:
39 * Daryll Strauss <daryll@precisioninsight.com>
40 * Keith Whitwell <keith@precisioninsight.com>
41 *
42 * See fxapi.h for more revision/author details.
43 */
44
45
46 #ifndef FXDRV_H
47 #define FXDRV_H
48
49 /* If you comment out this define, a variable takes its place, letting
50 * you turn debugging on/off from the debugger.
51 */
52
53 #ifdef XFree86Server
54 #include "GL/xf86glx.h"
55 #else
56 #include "glheader.h"
57 #endif
58
59
60 #if defined(__linux__)
61 #include <signal.h>
62 #endif
63
64 #include "context.h"
65 #include "macros.h"
66 #include "matrix.h"
67 #include "mem.h"
68 #include "texture.h"
69 #include "types.h"
70 #include "vb.h"
71 #include "xform.h"
72 #include "clip.h"
73 #include "vbrender.h"
74
75 #ifdef XF86DRI
76 typedef struct tfxMesaContext *fxMesaContext;
77 #else
78 #include "GL/fxmesa.h"
79 #endif
80 #include "fxglidew.h"
81 /* use gl/gl.h GLAPI/GLAPIENTRY/GLCALLBACK in place of WINGDIAPI/APIENTRY/CALLBACK, */
82 /* these are defined in mesa gl/gl.h - tjump@spgs.com */
83
84
85
86 extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * );
87 #if defined(MESA_DEBUG) && 0
88 #define grDrawTriangle fx_sanity_triangle
89 #endif
90
91
92 /* Define some shorter names for these things.
93 */
94 #define XCOORD GR_VERTEX_X_OFFSET
95 #define YCOORD GR_VERTEX_Y_OFFSET
96 #define ZCOORD GR_VERTEX_OOZ_OFFSET
97 #define OOWCOORD GR_VERTEX_OOW_OFFSET
98
99 #define RCOORD GR_VERTEX_R_OFFSET
100 #define GCOORD GR_VERTEX_G_OFFSET
101 #define BCOORD GR_VERTEX_B_OFFSET
102 #define ACOORD GR_VERTEX_A_OFFSET
103
104 #define S0COORD GR_VERTEX_SOW_TMU0_OFFSET
105 #define T0COORD GR_VERTEX_TOW_TMU0_OFFSET
106 #define S1COORD GR_VERTEX_SOW_TMU1_OFFSET
107 #define T1COORD GR_VERTEX_TOW_TMU1_OFFSET
108
109
110 #if FX_USE_PARGB
111
112 #define CLIP_XCOORD 0 /* normal place */
113 #define CLIP_YCOROD 1 /* normal place */
114 #define CLIP_ZCOORD 2 /* normal place */
115 #define CLIP_WCOORD 3 /* normal place */
116 #define CLIP_GCOORD 4 /* GR_VERTEX_PARGB_OFFSET */
117 #define CLIP_BCOORD 5 /* GR_VERTEX_SOW_TMU0_OFFSET */
118 #define CLIP_RCOORD 6 /* GR_VERTEX_TOW_TMU0_OFFSET */
119 #define CLIP_ACOORD 7 /* GR_VERTEX_OOW_TMU0_OFFSET */
120
121 #else
122
123 #define CLIP_XCOORD 0 /* normal place */
124 #define CLIP_YCOROD 1 /* normal place */
125 #define CLIP_ZCOORD 2 /* GR_VERTEX_Z_OFFSET */
126 #define CLIP_WCOORD 3 /* GR_VERTEX_R_OFFSET */
127 #define CLIP_GCOORD 4 /* normal place */
128 #define CLIP_BCOORD 5 /* normal place */
129 #define CLIP_RCOORD 6 /* GR_VERTEX_OOZ_OFFSET */
130 #define CLIP_ACOORD 7 /* normal place */
131
132
133 #endif
134
135 /* Should have size == 16 * sizeof(float).
136 */
137 typedef struct {
138 GLfloat f[15]; /* Same layout as GrVertex */
139 GLubyte mask; /* Unsued */
140 GLubyte usermask; /* Unused */
141 } fxVertex;
142
143
144
145
146 #if defined(FXMESA_USE_ARGB)
147 #define FXCOLOR4( c ) ( \
148 ( ((unsigned int)(c[3]))<<24 ) | \
149 ( ((unsigned int)(c[0]))<<16 ) | \
150 ( ((unsigned int)(c[1]))<<8 ) | \
151 ( (unsigned int)(c[2])) )
152
153 #else
154 #ifdef __i386__
155 #define FXCOLOR4( c ) (* (int *)c)
156 #else
157 #define FXCOLOR4( c ) ( \
158 ( ((unsigned int)(c[3]))<<24 ) | \
159 ( ((unsigned int)(c[2]))<<16 ) | \
160 ( ((unsigned int)(c[1]))<<8 ) | \
161 ( (unsigned int)(c[0])) )
162 #endif
163 #endif
164
165 #define FX_VB_COLOR(fxm, color) \
166 do { \
167 if (sizeof(GLint) == 4*sizeof(GLubyte)) { \
168 if (fxm->constColor != *(GLuint*)color) { \
169 fxm->constColor = *(GLuint*)color; \
170 FX_grConstantColorValue(FXCOLOR4(color)); \
171 } \
172 } else { \
173 FX_grConstantColorValue(FXCOLOR4(color)); \
174 } \
175 } while (0)
176
177 #define GOURAUD(x) { \
178 GLubyte *col = VB->ColorPtr->data[(x)]; \
179 gWin[(x)].v.r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \
180 gWin[(x)].v.g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \
181 gWin[(x)].v.b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \
182 gWin[(x)].v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
183 }
184
185 #if FX_USE_PARGB
186 #define GOURAUD2(v, c) { \
187 GLubyte *col = c; \
188 v->argb=MESACOLOR2PARGB(col); \
189 }
190 #else
191 #define GOURAUD2(v, c) { \
192 GLubyte *col = c; \
193 v->r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \
194 v->g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \
195 v->b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \
196 v->a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
197 }
198 #endif
199
200
201 /* Mergable items first
202 */
203 #define SETUP_RGBA 0x1
204 #define SETUP_TMU0 0x2
205 #define SETUP_TMU1 0x4
206 #define SETUP_XY 0x8
207 #define SETUP_Z 0x10
208 #define SETUP_W 0x20
209
210 #define MAX_MERGABLE 0x8
211
212
213 #define FX_NUM_TMU 2
214
215 #define FX_TMU0 GR_TMU0
216 #define FX_TMU1 GR_TMU1
217 #define FX_TMU_SPLIT 98
218 #define FX_TMU_BOTH 99
219 #define FX_TMU_NONE 100
220
221 /* Used for fxMesa->lastUnitsMode */
222
223 #define FX_UM_NONE 0x00000000
224
225 #define FX_UM_E0_REPLACE 0x00000001
226 #define FX_UM_E0_MODULATE 0x00000002
227 #define FX_UM_E0_DECAL 0x00000004
228 #define FX_UM_E0_BLEND 0x00000008
229 #define FX_UM_E0_ADD 0x00000010
230
231 #define FX_UM_E1_REPLACE 0x00000020
232 #define FX_UM_E1_MODULATE 0x00000040
233 #define FX_UM_E1_DECAL 0x00000080
234 #define FX_UM_E1_BLEND 0x00000100
235 #define FX_UM_E1_ADD 0x00000200
236
237 #define FX_UM_E_ENVMODE 0x000003ff
238
239 #define FX_UM_E0_ALPHA 0x00001000
240 #define FX_UM_E0_LUMINANCE 0x00002000
241 #define FX_UM_E0_LUMINANCE_ALPHA 0x00004000
242 #define FX_UM_E0_INTENSITY 0x00008000
243 #define FX_UM_E0_RGB 0x00010000
244 #define FX_UM_E0_RGBA 0x00020000
245
246 #define FX_UM_E1_ALPHA 0x00040000
247 #define FX_UM_E1_LUMINANCE 0x00080000
248 #define FX_UM_E1_LUMINANCE_ALPHA 0x00100000
249 #define FX_UM_E1_INTENSITY 0x00200000
250 #define FX_UM_E1_RGB 0x00400000
251 #define FX_UM_E1_RGBA 0x00800000
252
253 #define FX_UM_E_IFMT 0x00fff000
254
255 #define FX_UM_COLOR_ITERATED 0x01000000
256 #define FX_UM_COLOR_CONSTANT 0x02000000
257 #define FX_UM_ALPHA_ITERATED 0x04000000
258 #define FX_UM_ALPHA_CONSTANT 0x08000000
259
260 typedef void (*tfxRenderVBFunc)(GLcontext *);
261
262 /*
263 Memory range from startAddr to endAddr-1
264 */
265 typedef struct MemRange_t {
266 struct MemRange_t *next;
267 FxU32 startAddr, endAddr;
268 } MemRange;
269
270 typedef struct {
271 GLsizei width, height; /* image size */
272 GrTextureFormat_t glideFormat; /* Glide image format */
273 unsigned short *data; /* Glide-formated texture image */
274 } tfxMipMapLevel;
275
276 typedef struct tfxTexInfo_t {
277 struct tfxTexInfo *next;
278 struct gl_texture_object *tObj;
279
280 GLuint lastTimeUsed;
281 FxU32 whichTMU;
282 GLboolean isInTM;
283
284 tfxMipMapLevel mipmapLevel[MAX_TEXTURE_LEVELS];
285
286 MemRange *tm[FX_NUM_TMU];
287
288 GLint minLevel, maxLevel;
289 GLint baseLevelInternalFormat;
290
291 GrTexInfo info;
292
293 GrTextureFilterMode_t minFilt;
294 GrTextureFilterMode_t maxFilt;
295 FxBool LODblend;
296
297 GrTextureClampMode_t sClamp;
298 GrTextureClampMode_t tClamp;
299
300 GrMipMapMode_t mmMode;
301
302 GLfloat sScale, tScale;
303 GLint int_sScale, int_tScale; /* x86 floating point trick for
304 * multiplication by powers of 2.
305 * Used in fxfasttmp.h
306 */
307
308 GuTexPalette palette;
309
310 GLboolean fixedPalette;
311 GLboolean validated;
312 } tfxTexInfo;
313
314 typedef struct {
315 GLuint swapBuffer;
316 GLuint reqTexUpload;
317 GLuint texUpload;
318 GLuint memTexUpload;
319 } tfxStats;
320
321
322 typedef void (*tfxTriViewClipFunc)( struct vertex_buffer *VB,
323 GLuint v[],
324 GLubyte mask );
325
326 typedef void (*tfxTriClipFunc)( struct vertex_buffer *VB,
327 GLuint v[],
328 GLuint mask );
329
330
331 typedef void (*tfxLineClipFunc)( struct vertex_buffer *VB,
332 GLuint v1, GLuint v2,
333 GLubyte mask );
334
335
336 extern tfxTriViewClipFunc fxTriViewClipTab[0x8];
337 extern tfxTriClipFunc fxTriClipStrideTab[0x8];
338 extern tfxLineClipFunc fxLineClipTab[0x8];
339
340 typedef struct {
341 /* Alpha test */
342
343 GLboolean alphaTestEnabled;
344 GrCmpFnc_t alphaTestFunc;
345 GrAlpha_t alphaTestRefValue;
346
347 /* Blend function */
348
349 GLboolean blendEnabled;
350 GrAlphaBlendFnc_t blendSrcFuncRGB;
351 GrAlphaBlendFnc_t blendDstFuncRGB;
352 GrAlphaBlendFnc_t blendSrcFuncAlpha;
353 GrAlphaBlendFnc_t blendDstFuncAlpha;
354
355 /* Depth test */
356
357 GLboolean depthTestEnabled;
358 GLboolean depthMask;
359 GrCmpFnc_t depthTestFunc;
360 } tfxUnitsState;
361
362
363 /* Flags for render_index.
364 */
365 #define FX_OFFSET 0x1
366 #define FX_TWOSIDE 0x2
367 #define FX_FRONT_BACK 0x4
368 #define FX_FLAT 0x8
369 #define FX_ANTIALIAS 0x10
370 #define FX_FALLBACK 0x20
371
372
373 /* Flags for fxMesa->new_state
374 */
375 #define FX_NEW_TEXTURING 0x1
376 #define FX_NEW_BLEND 0x2
377 #define FX_NEW_ALPHA 0x4
378 #define FX_NEW_DEPTH 0x8
379 #define FX_NEW_FOG 0x10
380 #define FX_NEW_SCISSOR 0x20
381 #define FX_NEW_COLOR_MASK 0x40
382 #define FX_NEW_CULL 0x80
383
384 /* FX struct stored in VB->driver_data.
385 */
386 struct tfxMesaVertexBuffer {
387 GLvector1ui clipped_elements;
388
389 fxVertex *verts;
390 fxVertex *last_vert;
391 void *vert_store;
392 #if defined(FX_GLIDE3)
393 GrVertex **triangle_b; /* Triangle buffer */
394 GrVertex **strips_b; /* Strips buffer */
395 #endif
396
397 GLuint size;
398 };
399
400 #define FX_DRIVER_DATA(vb) ((struct tfxMesaVertexBuffer *)((vb)->driver_data))
401 #define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx))
402 #define FX_TEXTURE_DATA(t) fxTMGetTexInfo((t)->Current)
403
404 #if defined(XFree86Server) || defined(GLX_DIRECT_RENDERING)
405 #include "tdfx_init.h"
406 #else
407 #define DRI_FX_CONTEXT
408 #define BEGIN_BOARD_LOCK()
409 #define END_BOARD_LOCK()
410 #define BEGIN_CLIP_LOOP()
411 #define END_CLIP_LOOP()
412 #endif
413
414
415 /* These lookup table are used to extract RGB values in [0,255] from
416 * 16-bit pixel values.
417 */
418 extern GLubyte FX_PixelToR[0x10000];
419 extern GLubyte FX_PixelToG[0x10000];
420 extern GLubyte FX_PixelToB[0x10000];
421
422
423 struct tfxMesaContext {
424 GuTexPalette glbPalette;
425
426 GLcontext *glCtx; /* the core Mesa context */
427 #if !defined(XFree86Server) && !defined(GLX_DIRECT_RENDERING)
428 GLvisual *glVis; /* describes the color buffer */
429 GLframebuffer *glBuffer; /* the ancillary buffers */
430 #endif
431
432 GLint board; /* the board used for this context */
433 GLint width, height; /* size of color buffer */
434
435 GrBuffer_t currentFB;
436
437 GLboolean bgrOrder;
438 GrColor_t color;
439 GrColor_t clearC;
440 GrAlpha_t clearA;
441 GLuint constColor;
442 GrCullMode_t cullMode;
443
444 tfxUnitsState unitsState;
445 tfxUnitsState restoreUnitsState; /* saved during multipass */
446
447 GLuint tmu_source[FX_NUM_TMU];
448 GLuint tex_dest[MAX_TEXTURE_UNITS];
449 GLuint setupindex;
450 GLuint partial_setup_index;
451 GLuint setupdone;
452 GLuint mergeindex;
453 GLuint mergeinputs;
454 GLuint render_index;
455 GLuint last_tri_caps;
456 GLuint stw_hint_state; /* for grHints */
457 GLuint is_in_hardware;
458 GLuint new_state;
459 GLuint using_fast_path, passes, multipass;
460
461 tfxLineClipFunc clip_line;
462 tfxTriClipFunc clip_tri_stride;
463 tfxTriViewClipFunc view_clip_tri;
464
465
466 /* Texture Memory Manager Data */
467
468 GLuint texBindNumber;
469 GLint tmuSrc;
470 GLuint lastUnitsMode;
471 GLuint freeTexMem[FX_NUM_TMU];
472 MemRange *tmPool;
473 MemRange *tmFree[FX_NUM_TMU];
474
475 GLenum fogTableMode;
476 GLfloat fogDensity;
477 GLfloat fogStart, fogEnd;
478 GrFog_t *fogTable;
479 GLint textureAlign;
480
481 /* Acc. functions */
482
483 points_func PointsFunc;
484 line_func LineFunc;
485 triangle_func TriangleFunc;
486 quad_func QuadFunc;
487
488 render_func **RenderVBTables;
489
490 render_func *RenderVBClippedTab;
491 render_func *RenderVBCulledTab;
492 render_func *RenderVBRawTab;
493
494
495 tfxStats stats;
496
497 void *state;
498
499 /* Options */
500
501 GLboolean verbose;
502 GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */
503 GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */
504 GLboolean haveAlphaBuffer;
505 GLboolean haveZBuffer;
506 GLboolean haveDoubleBuffer;
507 GLboolean haveGlobalPaletteTexture;
508 GLint swapInterval;
509 GLint maxPendingSwapBuffers;
510
511 FX_GrContext_t glideContext;
512
513 int x_offset;
514 int y_offset;
515 int y_delta;
516 int screen_width;
517 int screen_height;
518 int initDone;
519 int clipMinX;
520 int clipMaxX;
521 int clipMinY;
522 int clipMaxY;
523 int needClip;
524
525 DRI_FX_CONTEXT
526 };
527
528 typedef void (*tfxSetupFunc)(struct vertex_buffer *, GLuint, GLuint);
529
530 extern GrHwConfiguration glbHWConfig;
531 extern int glbCurrentBoard;
532
533 extern void fxPrintSetupFlags( const char *msg, GLuint flags );
534 extern void fxSetupFXUnits(GLcontext *);
535 extern void fxSetupDDPointers(GLcontext *);
536 extern void fxDDSetNearFar(GLcontext *, GLfloat, GLfloat);
537
538 extern void fxDDSetupInit(void);
539 extern void fxDDCvaInit(void);
540 extern void fxDDTrifuncInit(void);
541 extern void fxDDFastPathInit(void);
542
543 extern void fxDDChooseRenderState( GLcontext *ctx );
544
545 extern void fxRenderClippedLine( struct vertex_buffer *VB,
546 GLuint v1, GLuint v2 );
547
548 extern void fxRenderClippedTriangle( struct vertex_buffer *VB,
549 GLuint n, GLuint vlist[] );
550
551
552 extern tfxSetupFunc fxDDChooseSetupFunction(GLcontext *);
553
554 extern points_func fxDDChoosePointsFunction(GLcontext *);
555 extern line_func fxDDChooseLineFunction(GLcontext *);
556 extern triangle_func fxDDChooseTriangleFunction(GLcontext *);
557 extern quad_func fxDDChooseQuadFunction(GLcontext *);
558 extern render_func **fxDDChooseRenderVBTables(GLcontext *);
559
560 extern void fxDDRenderInit(GLcontext *);
561 extern void fxDDClipInit(void);
562
563 extern void fxUpdateDDSpanPointers(GLcontext *);
564 extern void fxSetupDDSpanPointers(GLcontext *);
565
566 extern void fxPrintTextureData(tfxTexInfo *ti);
567 extern GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
568 GLenum format, GLenum type, const GLvoid *pixels,
569 const struct gl_pixelstore_attrib *packing,
570 struct gl_texture_object *texObj,
571 struct gl_texture_image *texImage,
572 GLboolean *retainInternalCopy);
573 extern GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
574 GLint xoffset, GLint yoffset,
575 GLsizei width, GLsizei height,
576 GLenum format, GLenum type, const GLvoid *pixels,
577 const struct gl_pixelstore_attrib *packing,
578 struct gl_texture_object *texObj,
579 struct gl_texture_image *texImage);
580 extern GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
581 const struct gl_texture_object *texObj,
582 GLenum *formatOut, GLenum *typeOut,
583 GLboolean *freeImageOut );
584 extern void fxDDTexEnv(GLcontext *, GLenum, GLenum, const GLfloat *);
585 extern void fxDDTexParam(GLcontext *, GLenum, struct gl_texture_object *,
586 GLenum, const GLfloat *);
587 extern void fxDDTexBind(GLcontext *, GLenum, struct gl_texture_object *);
588 extern void fxDDTexDel(GLcontext *, struct gl_texture_object *);
589 extern void fxDDTexPalette(GLcontext *, struct gl_texture_object *);
590 extern void fxDDTexUseGlbPalette(GLcontext *, GLboolean);
591
592 extern void fxDDEnable(GLcontext *, GLenum, GLboolean);
593 extern void fxDDAlphaFunc(GLcontext *, GLenum, GLclampf);
594 extern void fxDDBlendFunc(GLcontext *, GLenum, GLenum);
595 extern void fxDDDepthMask(GLcontext *, GLboolean);
596 extern void fxDDDepthFunc(GLcontext *, GLenum);
597
598 extern void fxDDRegisterVB( struct vertex_buffer *VB );
599 extern void fxDDUnregisterVB( struct vertex_buffer *VB );
600 extern void fxDDResizeVB( struct vertex_buffer *VB, GLuint size );
601
602 extern void fxDDCheckMergeAndRender( GLcontext *ctx,
603 struct gl_pipeline_stage *d );
604
605 extern void fxDDMergeAndRender( struct vertex_buffer *VB );
606
607 extern void fxDDCheckPartialRasterSetup( GLcontext *ctx,
608 struct gl_pipeline_stage *d );
609
610 extern void fxDDPartialRasterSetup( struct vertex_buffer *VB );
611
612 extern void fxDDDoRasterSetup( struct vertex_buffer *VB );
613
614 extern GLuint fxDDRegisterPipelineStages( struct gl_pipeline_stage *out,
615 const struct gl_pipeline_stage *in,
616 GLuint nr );
617
618 extern GLboolean fxDDBuildPrecalcPipeline( GLcontext *ctx );
619
620 extern void fxDDOptimizePrecalcPipeline( GLcontext *ctx,
621 struct gl_pipeline *pipe );
622
623 extern void fxDDRenderElementsDirect( struct vertex_buffer *VB );
624 extern void fxDDRenderVBIndirectDirect( struct vertex_buffer *VB );
625
626 extern void fxDDInitExtensions( GLcontext *ctx );
627
628 #define fxTMGetTexInfo(o) ((tfxTexInfo*)((o)->DriverData))
629 extern void fxTMInit(fxMesaContext ctx);
630 extern void fxTMClose(fxMesaContext ctx);
631 extern void fxTMRestoreTextures_NoLock(fxMesaContext ctx);
632 extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint);
633 extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *);
634 #define fxTMMoveOutTM_NoLock fxTMMoveOutTM
635 extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *);
636 extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *, GLint);
637 extern void fxTMReloadSubMipMapLevel(fxMesaContext, struct gl_texture_object *,
638 GLint, GLint, GLint);
639
640 extern void fxTexGetFormat(GLenum, GrTextureFormat_t *, GLint *);
641 extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *,
642 float *, float *, int *, int *, int *, int *);
643
644 extern void fxDDScissor( GLcontext *ctx,
645 GLint x, GLint y, GLsizei w, GLsizei h );
646 extern void fxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params );
647 extern void fxDDColorMask(GLcontext *ctx,
648 GLboolean r, GLboolean g,
649 GLboolean b, GLboolean a );
650
651 extern void fxDDWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
652 const GLdepth depth[], const GLubyte mask[]);
653
654 extern void fxDDReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
655 GLdepth depth[]);
656
657 extern void fxDDWriteDepthPixels(GLcontext *ctx, GLuint n,
658 const GLint x[], const GLint y[],
659 const GLdepth depth[], const GLubyte mask[]);
660
661 extern void fxDDReadDepthPixels(GLcontext *ctx, GLuint n,
662 const GLint x[], const GLint y[],
663 GLdepth depth[]);
664
665 extern void fxDDFastPath( struct vertex_buffer *VB );
666
667 extern void fxDDShadeModel(GLcontext *ctx, GLenum mode);
668
669 extern void fxDDCullFace(GLcontext *ctx, GLenum mode);
670 extern void fxDDFrontFace(GLcontext *ctx, GLenum mode);
671
672 extern void fxPrintRenderState( const char *msg, GLuint state );
673 extern void fxPrintHintState( const char *msg, GLuint state );
674
675 extern void fxDDDoRenderVB( struct vertex_buffer *VB );
676
677 extern int fxDDInitFxMesaContext( fxMesaContext fxMesa );
678
679
680 extern void fxSetScissorValues(GLcontext *ctx);
681 extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa,
682 struct gl_texture_object *tObj,
683 GLint where);
684 extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder);
685
686 #endif