Add render stage for unclipped vb's to fx driver.
[mesa.git] / src / mesa / drivers / glide / fxglidew.h
1
2 /*
3 * Mesa 3-D graphics library
4 * Version: 3.3
5 *
6 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 *
26 * Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
27 * terms stated above.
28 *
29 * Thank you for your contribution, David!
30 *
31 * Please make note of the above copyright/license statement. If you
32 * contributed code or bug fixes to this code under the previous (GNU
33 * Library) license and object to the new license, your code will be
34 * removed at your request. Please see the Mesa docs/COPYRIGHT file
35 * for more information.
36 *
37 * Additional Mesa/3Dfx driver developers:
38 * Daryll Strauss <daryll@precisioninsight.com>
39 * Keith Whitwell <keith@precisioninsight.com>
40 *
41 * See fxapi.h for more revision/author details.
42 */
43
44
45 #ifndef __FX_GLIDE_WARPER__
46 #define __FX_GLIDE_WARPER__
47
48 #include <glide.h>
49
50 /*
51 * General context:
52 */
53 #if !defined(FX_GLIDE3)
54 typedef FxU32 FX_GrContext_t; /* Not used in Glide2 */
55 #else
56 typedef GrContext_t FX_GrContext_t;
57 #endif
58
59 /*
60 * Glide3 emulation on Glide2:
61 */
62 #if !defined(FX_GLIDE3)
63 /* Constanst for FX_grGetInteger( ) */
64 #define FX_FOG_TABLE_ENTRIES 0x0004 /* The number of entries in the hardware fog table. */
65 #define FX_GLIDE_STATE_SIZE 0x0006 /* Size of buffer, in bytes, needed to save Glide state. */
66 #define FX_LFB_PIXEL_PIPE 0x0009 /* 1 if LFB writes can go through the 3D pixel pipe. */
67 #define FX_PENDING_BUFFERSWAPS 0x0014 /* The number of buffer swaps pending. */
68 #define FX_TEXTURE_ALIGN 0x0024 /* The required alignment for textures */
69 #else
70 #define FX_FOG_TABLE_ENTRIES GR_FOG_TABLE_ENTRIES
71 #define FX_GLIDE_STATE_SIZE GR_GLIDE_STATE_SIZE
72 #define FX_LFB_PIXEL_PIPE GR_LFB_PIXEL_PIPE
73 #define FX_PENDING_BUFFERSWAPS GR_PENDING_BUFFERSWAPS
74 #define FX_TEXTURE_ALIGN GR_TEXTURE_ALIGN
75 #endif
76
77 /*
78 * Genral warper functions for Glide2/Glide3:
79 */
80 extern FxI32 FX_grGetInteger(FxU32 pname);
81 extern FxI32 FX_grGetInteger_NoLock(FxU32 pname);
82
83 /*
84 * Glide2 emulation on Glide3:
85 */
86 #if defined(FX_GLIDE3)
87
88 #define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1
89 #define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1
90 #define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1
91 #define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1
92 #define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2
93 #define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4
94 #define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8
95
96 #define GR_LOD_256 GR_LOD_LOG2_256
97 #define GR_LOD_128 GR_LOD_LOG2_128
98 #define GR_LOD_64 GR_LOD_LOG2_64
99 #define GR_LOD_32 GR_LOD_LOG2_32
100 #define GR_LOD_16 GR_LOD_LOG2_16
101 #define GR_LOD_8 GR_LOD_LOG2_8
102 #define GR_LOD_4 GR_LOD_LOG2_4
103 #define GR_LOD_2 GR_LOD_LOG2_2
104 #define GR_LOD_1 GR_LOD_LOG2_1
105
106 #define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q
107
108 typedef int GrSstType;
109
110 #define MAX_NUM_SST 4
111
112 #define GR_SSTTYPE_VOODOO 0
113 #define GR_SSTTYPE_SST96 1
114 #define GR_SSTTYPE_AT3D 2
115 #define GR_SSTTYPE_Voodoo2 3
116
117 typedef struct GrTMUConfig_St {
118 int tmuRev; /* Rev of Texelfx chip */
119 int tmuRam; /* 1, 2, or 4 MB */
120 } GrTMUConfig_t;
121
122 typedef struct GrVoodooConfig_St {
123 int fbRam; /* 1, 2, or 4 MB */
124 int fbiRev; /* Rev of Pixelfx chip */
125 int nTexelfx; /* How many texelFX chips are there? */
126 FxBool sliDetect; /* Is it a scan-line interleaved board? */
127 GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
128 } GrVoodooConfig_t;
129
130 typedef struct GrSst96Config_St {
131 int fbRam; /* How much? */
132 int nTexelfx;
133 GrTMUConfig_t tmuConfig;
134 } GrSst96Config_t;
135
136 typedef GrVoodooConfig_t GrVoodoo2Config_t;
137
138 typedef struct GrAT3DConfig_St {
139 int rev;
140 } GrAT3DConfig_t;
141
142 typedef struct {
143 int num_sst; /* # of HW units in the system */
144 struct {
145 GrSstType type; /* Which hardware is it? */
146 union SstBoard_u {
147 GrVoodooConfig_t VoodooConfig;
148 GrSst96Config_t SST96Config;
149 GrAT3DConfig_t AT3DConfig;
150 GrVoodoo2Config_t Voodoo2Config;
151 } sstBoard;
152 } SSTs[MAX_NUM_SST]; /* configuration for each board */
153 } GrHwConfiguration;
154
155 typedef FxU32 GrHint_t;
156 #define GR_HINTTYPE_MIN 0
157 #define GR_HINT_STWHINT 0
158
159 typedef FxU32 GrSTWHint_t;
160 #define GR_STWHINT_W_DIFF_FBI FXBIT(0)
161 #define GR_STWHINT_W_DIFF_TMU0 FXBIT(1)
162 #define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2)
163 #define GR_STWHINT_W_DIFF_TMU1 FXBIT(3)
164 #define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4)
165 #define GR_STWHINT_W_DIFF_TMU2 FXBIT(5)
166 #define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
167
168 #define GR_CONTROL_ACTIVATE 1
169 #define GR_CONTROL_DEACTIVATE 0
170
171 #define GrState void
172
173 /*
174 ** move the vertex layout defintion to application
175 */
176 typedef struct {
177 float sow; /* s texture ordinate (s over w) */
178 float tow; /* t texture ordinate (t over w) */
179 float oow; /* 1/w (used mipmapping - really 0xfff/w) */
180 } GrTmuVertex;
181
182
183 typedef struct
184 {
185 float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
186 float r, g, b; /* R, G, B, ([0..255.0]) */
187 float ooz; /* 65535/Z (used for Z-buffering) */
188 float a; /* Alpha [0..255.0] */
189 float oow; /* 1/W (used for W-buffering, texturing) */
190 GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
191 } GrVertex;
192
193 #define GR_VERTEX_X_OFFSET 0
194 #define GR_VERTEX_Y_OFFSET 1
195 #define GR_VERTEX_Z_OFFSET 2
196 #define GR_VERTEX_R_OFFSET 3
197 #define GR_VERTEX_G_OFFSET 4
198 #define GR_VERTEX_B_OFFSET 5
199 #define GR_VERTEX_OOZ_OFFSET 6
200 #define GR_VERTEX_A_OFFSET 7
201 #define GR_VERTEX_OOW_OFFSET 8
202 #define GR_VERTEX_SOW_TMU0_OFFSET 9
203 #define GR_VERTEX_TOW_TMU0_OFFSET 10
204 #define GR_VERTEX_OOW_TMU0_OFFSET 11
205 #define GR_VERTEX_SOW_TMU1_OFFSET 12
206 #define GR_VERTEX_TOW_TMU1_OFFSET 13
207 #define GR_VERTEX_OOW_TMU1_OFFSET 14
208
209 #endif
210
211
212 /*
213 * Glide2 functions for Glide3
214 */
215 #if defined(FX_GLIDE3)
216 #define FX_grTexDownloadTable(TMU,type,data) \
217 do { \
218 BEGIN_BOARD_LOCK(); \
219 grTexDownloadTable(type,data); \
220 END_BOARD_LOCK(); \
221 } while (0);
222 #define FX_grTexDownloadTable_NoLock(TMU,type,data) \
223 grTexDownloadTable(type, data)
224 #else
225 #define FX_grTexDownloadTable(TMU,type,data) \
226 do { \
227 BEGIN_BOARD_LOCK(); \
228 grTexDownloadTable(TMU,type,data); \
229 END_BOARD_LOCK(); \
230 } while (0);
231 #define FX_grTexDownloadTable_NoLock grTexDownloadTable
232 #endif
233
234 /*
235 * Flush
236 */
237 #if defined(FX_GLIDE3)
238 #define FX_grFlush() \
239 do { \
240 BEGIN_BOARD_LOCK(); \
241 grFlush(); \
242 END_BOARD_LOCK(); \
243 } while (0)
244 #else
245 #define FX_grFlush() \
246 do { \
247 BEGIN_BOARD_LOCK(); \
248 grSstIdle(); \
249 END_BOARD_LOCK(); \
250 } while (0)
251 #endif
252
253 #define FX_grFinish() \
254 do { \
255 BEGIN_BOARD_LOCK(); \
256 grFinish(); \
257 END_BOARD_LOCK(); \
258 } while (0)
259
260 /*
261 * Write region: ToDo possible exploit the PixelPipe parameter.
262 */
263 #if defined(FX_GLIDE3)
264 #define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
265 do { \
266 BEGIN_BOARD_LOCK(); \
267 grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
268 END_BOARD_LOCK(); \
269 } while(0)
270 #else
271 #define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
272 do { \
273 BEGIN_BOARD_LOCK(); \
274 grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \
275 END_BOARD_LOCK(); \
276 } while (0)
277 #endif
278
279 /*
280 * Read region
281 */
282 #define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
283 do { \
284 BEGIN_BOARD_LOCK(); \
285 grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
286 END_BOARD_LOCK(); \
287 } while (0);
288
289 /*
290 * Draw triangle
291 */
292 #define FX_grDrawTriangle(a,b,c) \
293 do { \
294 BEGIN_CLIP_LOOP(); \
295 grDrawTriangle(a,b,c); \
296 END_CLIP_LOOP(); \
297 } while (0)
298
299 /*
300 * For Lod/LodLog2 conversion.
301 */
302 #if defined(FX_GLIDE3)
303 #define FX_largeLodLog2(info) (info).largeLodLog2
304 #else
305 #define FX_largeLodLog2(info) (info).largeLod
306 #endif
307
308 #if defined(FX_GLIDE3)
309 #define FX_aspectRatioLog2(info) (info).aspectRatioLog2
310 #else
311 #define FX_aspectRatioLog2(info) (info).aspectRatio
312 #endif
313
314 #if defined(FX_GLIDE3)
315 #define FX_smallLodLog2(info) (info).smallLodLog2
316 #else
317 #define FX_smallLodLog2(info) (info).smallLod
318 #endif
319
320 #if defined(FX_GLIDE3)
321 #define FX_lodToValue(val) ((int)(GR_LOD_256-val))
322 #else
323 #define FX_lodToValue(val) ((int)(val))
324 #endif
325
326 #if defined(FX_GLIDE3)
327 #define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2))
328 #else
329 #define FX_largeLodValue(info) ((int)(info).largeLod)
330 #endif
331 #define FX_largeLodValue_NoLock FX_largeLodValue
332
333 #if defined(FX_GLIDE3)
334 #define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2))
335 #else
336 #define FX_smallLodValue(info) ((int)(info).smallLod)
337 #endif
338 #define FX_smallLodValue_NoLock FX_smallLodValue
339
340 #if defined(FX_GLIDE3)
341 #define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val))
342 #else
343 #define FX_valueToLod(val) ((GrLOD_t)(val))
344 #endif
345
346 /*
347 * ScreenWidth/Height stuff.
348 */
349 extern int FX_grSstScreenWidth(void);
350 extern int FX_grSstScreenHeight(void);
351
352
353
354 /*
355 * Version string.
356 */
357 #if defined(FX_GLIDE3)
358 extern void FX_grGlideGetVersion(char *buf);
359 #else
360 #define FX_grGlideGetVersion(b) \
361 do { \
362 BEGIN_BOARD_LOCK(); \
363 grGlideGetVersion(b); \
364 END_BOARD_LOCK(); \
365 } while (0)
366 #endif
367 /*
368 * Performance statistics
369 */
370 #if defined(FX_GLIDE3)
371 extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
372 #else
373 #define FX_grSstPerfStats(s) \
374 do { \
375 BEGIN_BOARD_LOCK(); \
376 grSstPerfStats(s); \
377 END_BOARD_LOCK(); \
378 } while (0)
379 #endif
380
381 /*
382 * Hardware Query
383 */
384 extern int FX_grSstQueryHardware(GrHwConfiguration *config);
385
386 /*
387 * GrHints
388 */
389 #if defined(FX_GLIDE3)
390 extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
391 extern void FX_grHints(GrHint_t hintType, FxU32 hintMask);
392 #else
393 #define FX_grHints(t,m) \
394 do { \
395 BEGIN_BOARD_LOCK(); \
396 grHints(t, m); \
397 END_BOARD_LOCK(); \
398 } while(0)
399 #define FX_grHints_NoLock grHints
400 #endif
401 /*
402 * Antialiashed line+point drawing.
403 */
404 #if defined(FX_GLIDE3)
405 extern void FX_grAADrawLine(GrVertex *a,GrVertex *b);
406 #else
407 #define FX_grAADrawLine(a,b) \
408 do { \
409 BEGIN_CLIP_LOOP(); \
410 grAADrawLine(a,b); \
411 END_CLIP_LOOP(); \
412 } while (0)
413 #endif
414
415 #if defined(FX_GLIDE3)
416 extern void FX_grAADrawPoint(GrVertex *a);
417 #else
418 #define FX_grAADrawPoint(a) \
419 do { \
420 BEGIN_CLIP_LOOP(); \
421 grAADrawPoint(a); \
422 END_CLIP_LOOP(); \
423 } while (0)
424 #endif
425
426 /*
427 * Needed for Glide3 only, to set up Glide2 compatible vertex layout.
428 */
429 #if defined(FX_GLIDE3)
430 extern void FX_setupGrVertexLayout(void);
431 #else
432 #define FX_setupGrVertexLayout() do {} while (0)
433 #endif
434 /*
435 * grSstControl stuff
436 */
437 extern FxBool FX_grSstControl(FxU32 code);
438
439 /*
440 * grGammaCorrectionValue
441 */
442 #if defined(FX_GLIDE3)
443 extern void FX_grGammaCorrectionValue(float val);
444 #else
445 #define FX_grGammaCorrectionValue(v) \
446 do { \
447 BEGIN_BOARD_LOCK(); \
448 grGammaCorrectionValue(v) \
449 END_BOARD_LOCK(); \
450 } while (0)
451 #endif
452
453 #if defined(FX_GLIDE3)
454 #define FX_grSstWinClose(w) \
455 do { \
456 BEGIN_BOARD_LOCK(); \
457 grSstWinClose(w); \
458 END_BOARD_LOCK(); \
459 } while (0)
460 #else
461 #define FX_grSstWinClose(w) \
462 do { \
463 BEGIN_BOARD_LOCK(); \
464 grSstWinClose(); \
465 END_BOARD_LOCK(); \
466 } while (0)
467 #endif
468
469
470 extern FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
471 GrScreenResolution_t screen_resolution,
472 GrScreenRefresh_t refresh_rate,
473 GrColorFormat_t color_format,
474 GrOriginLocation_t origin_location,
475 int nColBuffers,
476 int nAuxBuffers);
477
478
479 #define FX_grDrawLine(v1, v2) \
480 do { \
481 BEGIN_CLIP_LOOP(); \
482 grDrawLine(v1, v2); \
483 END_CLIP_LOOP(); \
484 } while (0)
485
486 #define FX_grDrawPoint(p) \
487 do { \
488 BEGIN_CLIP_LOOP(); \
489 grDrawPoint(p); \
490 END_CLIP_LOOP(); \
491 } while (0)
492
493 #if defined(FX_GLIDE3)
494 extern void FX_grDrawPolygonVertexList(int n, GrVertex *v);
495 #else
496 #define FX_grDrawPolygonVertexList(n, v) \
497 do { \
498 BEGIN_CLIP_LOOP(); \
499 grDrawPolygonVertexList(n, v); \
500 END_CLIP_LOOP(); \
501 } while (0)
502 #endif
503
504 #define FX_grDitherMode(m) \
505 do { \
506 BEGIN_BOARD_LOCK(); \
507 grDitherMode(m); \
508 END_BOARD_LOCK(); \
509 } while (0)
510
511 #define FX_grRenderBuffer(b) \
512 do { \
513 BEGIN_BOARD_LOCK(); \
514 grRenderBuffer(b); \
515 END_BOARD_LOCK(); \
516 } while (0)
517
518 #define FX_grBufferClear(c, a, d) \
519 do { \
520 BEGIN_CLIP_LOOP(); \
521 grBufferClear(c, a, d); \
522 END_CLIP_LOOP(); \
523 } while (0)
524
525 #define FX_grDepthMask(m) \
526 do { \
527 BEGIN_BOARD_LOCK(); \
528 grDepthMask(m); \
529 END_BOARD_LOCK(); \
530 } while (0)
531
532 #define FX_grColorMask(c, a) \
533 do { \
534 BEGIN_BOARD_LOCK(); \
535 grColorMask(c, a); \
536 END_BOARD_LOCK(); \
537 } while (0)
538
539 extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
540 GrLfbWriteMode_t writeMode,
541 GrOriginLocation_t origin, FxBool pixelPipeline,
542 GrLfbInfo_t *info );
543
544 #define FX_grLfbUnlock(t, b) \
545 do { \
546 BEGIN_BOARD_LOCK(); \
547 grLfbUnlock(t, b); \
548 END_BOARD_LOCK(); \
549 } while (0)
550
551 #define FX_grConstantColorValue(v) \
552 do { \
553 BEGIN_BOARD_LOCK(); \
554 grConstantColorValue(v); \
555 END_BOARD_LOCK(); \
556 } while (0)
557
558 #define FX_grConstantColorValue_NoLock grConstantColorValue
559
560 #define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \
561 do { \
562 BEGIN_CLIP_LOOP(); \
563 grAADrawTriangle(a, b, c, ab, bc, ca); \
564 END_CLIP_LOOP(); \
565 } while (0)
566
567 #define FX_grAlphaBlendFunction(rs, rd, as, ad) \
568 do { \
569 BEGIN_BOARD_LOCK(); \
570 grAlphaBlendFunction(rs, rd, as, ad); \
571 END_BOARD_LOCK(); \
572 } while (0)
573
574 #define FX_grAlphaCombine(func, fact, loc, oth, inv) \
575 do { \
576 BEGIN_BOARD_LOCK(); \
577 grAlphaCombine(func, fact, loc, oth, inv); \
578 END_BOARD_LOCK(); \
579 } while (0)
580
581 #define FX_grAlphaCombine_NoLock grAlphaCombine
582
583 #define FX_grAlphaTestFunction(f) \
584 do { \
585 BEGIN_BOARD_LOCK(); \
586 grAlphaTestFunction(f); \
587 END_BOARD_LOCK(); \
588 } while (0)
589
590 #define FX_grAlphaTestReferenceValue(v) \
591 do { \
592 BEGIN_BOARD_LOCK(); \
593 grAlphaTestReferenceValue(v); \
594 END_BOARD_LOCK(); \
595 } while (0)
596
597 #define FX_grClipWindow(minx, miny, maxx, maxy) \
598 do { \
599 BEGIN_BOARD_LOCK(); \
600 grClipWindow(minx, miny, maxx, maxy); \
601 END_BOARD_LOCK(); \
602 } while (0)
603
604 #define FX_grClipWindow_NoLock grClipWindow
605
606 #define FX_grColorCombine(func, fact, loc, oth, inv) \
607 do { \
608 BEGIN_BOARD_LOCK(); \
609 grColorCombine(func, fact, loc, oth, inv); \
610 END_BOARD_LOCK(); \
611 } while (0)
612
613 #define FX_grColorCombine_NoLock grColorCombine
614
615 #define FX_grCullMode(m) \
616 do { \
617 BEGIN_BOARD_LOCK(); \
618 grCullMode(m); \
619 END_BOARD_LOCK(); \
620 } while (0)
621
622 #define FX_grDepthBiasLevel(lev) \
623 do { \
624 BEGIN_BOARD_LOCK(); \
625 grDepthBiasLevel(lev); \
626 END_BOARD_LOCK(); \
627 } while (0)
628
629 #define FX_grDepthBufferFunction(func) \
630 do { \
631 BEGIN_BOARD_LOCK(); \
632 grDepthBufferFunction(func); \
633 END_BOARD_LOCK(); \
634 } while (0)
635
636 #define FX_grFogColorValue(c) \
637 do { \
638 BEGIN_BOARD_LOCK(); \
639 grFogColorValue(c); \
640 END_BOARD_LOCK(); \
641 } while (0)
642
643 #define FX_grFogMode(m) \
644 do { \
645 BEGIN_BOARD_LOCK(); \
646 grFogMode(m); \
647 END_BOARD_LOCK(); \
648 } while (0)
649
650 #define FX_grFogTable(t) \
651 do { \
652 BEGIN_BOARD_LOCK(); \
653 grFogTable(t); \
654 END_BOARD_LOCK(); \
655 } while (0)
656
657 #define FX_grTexClampMode(t, sc, tc) \
658 do { \
659 BEGIN_BOARD_LOCK(); \
660 grTexClampMode(t, sc, tc); \
661 END_BOARD_LOCK(); \
662 } while (0)
663
664 #define FX_grTexClampMode_NoLock grTexClampMode
665
666 #define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \
667 do { \
668 BEGIN_BOARD_LOCK(); \
669 grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \
670 END_BOARD_LOCK(); \
671 } while (0)
672
673 #define FX_grTexCombine_NoLock grTexCombine
674
675 #define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \
676 do { \
677 BEGIN_BOARD_LOCK(); \
678 grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \
679 END_BOARD_LOCK(); \
680 } while (0)
681
682 #define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel
683
684 #define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
685 do { \
686 BEGIN_BOARD_LOCK(); \
687 grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
688 END_BOARD_LOCK(); \
689 } while (0)
690
691 #define FX_grTexFilterMode(t, minf, magf) \
692 do { \
693 BEGIN_BOARD_LOCK(); \
694 grTexFilterMode(t, minf, magf); \
695 END_BOARD_LOCK(); \
696 } while (0)
697
698 #define FX_grTexFilterMode_NoLock grTexFilterMode
699
700 extern FxU32 FX_grTexMinAddress(GrChipID_t tmu);
701 extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu);
702
703 #define FX_grTexMipMapMode(t, m, lod) \
704 do { \
705 BEGIN_BOARD_LOCK(); \
706 grTexMipMapMode(t, m, lod); \
707 END_BOARD_LOCK(); \
708 } while (0)
709
710 #define FX_grTexMipMapMode_NoLock grTexMipMapMode
711
712 #define FX_grTexSource(t, sa, eo, i) \
713 do { \
714 BEGIN_BOARD_LOCK(); \
715 grTexSource(t, sa, eo, i); \
716 END_BOARD_LOCK(); \
717 } while (0)
718
719 #define FX_grTexSource_NoLock grTexSource
720
721 extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info);
722 #define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired
723
724 #define FX_grGlideGetState(s) \
725 do { \
726 BEGIN_BOARD_LOCK(); \
727 grGlideGetState(s); \
728 END_BOARD_LOCK(); \
729 } while (0)
730 #define FX_grGlideGetState_NoLock(s) grGlideGetState(s);
731
732 #define FX_grDRIBufferSwap(i) \
733 do { \
734 BEGIN_BOARD_LOCK(); \
735 grDRIBufferSwap(i); \
736 END_BOARD_LOCK(); \
737 } while (0)
738
739 #define FX_grSstSelect(b) \
740 do { \
741 BEGIN_BOARD_LOCK(); \
742 grSstSelect(b); \
743 END_BOARD_LOCK(); \
744 } while (0)
745
746 #define FX_grSstSelect_NoLock grSstSelect
747
748 #define FX_grGlideSetState(s) \
749 do { \
750 BEGIN_BOARD_LOCK(); \
751 grGlideSetState(s); \
752 END_BOARD_LOCK(); \
753 } while (0)
754 #define FX_grGlideSetState_NoLock(s) grGlideSetState(s);
755
756 #define FX_grDepthBufferMode(m) \
757 do { \
758 BEGIN_BOARD_LOCK(); \
759 grDepthBufferMode(m); \
760 END_BOARD_LOCK(); \
761 } while (0)
762
763 #define FX_grLfbWriteColorFormat(f) \
764 do { \
765 BEGIN_BOARD_LOCK(); \
766 grLfbWriteColorFormat(f); \
767 END_BOARD_LOCK(); \
768 } while (0)
769
770 #define FX_grDrawVertexArray(m, c, p) \
771 do { \
772 BEGIN_CLIP_LOOP(); \
773 grDrawVertexArray(m, c, p); \
774 END_CLIP_LOOP(); \
775 } while (0)
776
777 #define FX_grGlideShutdown() \
778 do { \
779 BEGIN_BOARD_LOCK(); \
780 grGlideShutdown(); \
781 END_BOARD_LOCK(); \
782 } while (0)
783
784 #define FX_grTexLodBiasValue_NoLock(t, v) grTexLodBiasValue(t, v)
785
786 #define FX_grTexLodBiasValue(t, v) \
787 do { \
788 BEGIN_BOARD_LOCK(); \
789 grTexLodBiasValue(t, v); \
790 END_BOARD_LOCK(); \
791 } while (0)
792
793 #define FX_grGlideInit_NoLock grGlideInit
794 #define FX_grSstWinOpen_NoLock grSstWinOpen
795
796 extern int FX_getFogTableSize(void);
797 extern int FX_getGrStateSize(void);
798
799 #endif /* __FX_GLIDE_WARPER__ */
800