GL_INTENSITY case was incorrect in extract_float_rgba()
[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 {
119 int tmuRev; /* Rev of Texelfx chip */
120 int tmuRam; /* 1, 2, or 4 MB */
121 }
122 GrTMUConfig_t;
123
124 typedef struct GrVoodooConfig_St
125 {
126 int fbRam; /* 1, 2, or 4 MB */
127 int fbiRev; /* Rev of Pixelfx chip */
128 int nTexelfx; /* How many texelFX chips are there? */
129 FxBool sliDetect; /* Is it a scan-line interleaved board? */
130 GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
131 }
132 GrVoodooConfig_t;
133
134 typedef struct GrSst96Config_St
135 {
136 int fbRam; /* How much? */
137 int nTexelfx;
138 GrTMUConfig_t tmuConfig;
139 }
140 GrSst96Config_t;
141
142 typedef GrVoodooConfig_t GrVoodoo2Config_t;
143
144 typedef struct GrAT3DConfig_St
145 {
146 int rev;
147 }
148 GrAT3DConfig_t;
149
150 typedef struct
151 {
152 int num_sst; /* # of HW units in the system */
153 struct
154 {
155 GrSstType type; /* Which hardware is it? */
156 union SstBoard_u
157 {
158 GrVoodooConfig_t VoodooConfig;
159 GrSst96Config_t SST96Config;
160 GrAT3DConfig_t AT3DConfig;
161 GrVoodoo2Config_t Voodoo2Config;
162 }
163 sstBoard;
164 }
165 SSTs[MAX_NUM_SST]; /* configuration for each board */
166 }
167 GrHwConfiguration;
168
169 typedef FxU32 GrHint_t;
170 #define GR_HINTTYPE_MIN 0
171 #define GR_HINT_STWHINT 0
172
173 typedef FxU32 GrSTWHint_t;
174 #define GR_STWHINT_W_DIFF_FBI FXBIT(0)
175 #define GR_STWHINT_W_DIFF_TMU0 FXBIT(1)
176 #define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2)
177 #define GR_STWHINT_W_DIFF_TMU1 FXBIT(3)
178 #define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4)
179 #define GR_STWHINT_W_DIFF_TMU2 FXBIT(5)
180 #define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
181
182 #define GR_CONTROL_ACTIVATE 1
183 #define GR_CONTROL_DEACTIVATE 0
184
185 #define GrState void
186
187 /*
188 ** move the vertex layout defintion to application
189 */
190 typedef struct
191 {
192 float sow; /* s texture ordinate (s over w) */
193 float tow; /* t texture ordinate (t over w) */
194 float oow; /* 1/w (used mipmapping - really 0xfff/w) */
195 }
196 GrTmuVertex;
197
198
199 typedef struct
200 {
201 float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
202 float r, g, b; /* R, G, B, ([0..255.0]) */
203 float ooz; /* 65535/Z (used for Z-buffering) */
204 float a; /* Alpha [0..255.0] */
205 float oow; /* 1/W (used for W-buffering, texturing) */
206 GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
207 }
208 GrVertex;
209
210 #define GR_VERTEX_X_OFFSET 0
211 #define GR_VERTEX_Y_OFFSET 1
212 #define GR_VERTEX_Z_OFFSET 2
213 #define GR_VERTEX_R_OFFSET 3
214 #define GR_VERTEX_G_OFFSET 4
215 #define GR_VERTEX_B_OFFSET 5
216 #define GR_VERTEX_OOZ_OFFSET 6
217 #define GR_VERTEX_A_OFFSET 7
218 #define GR_VERTEX_OOW_OFFSET 8
219 #define GR_VERTEX_SOW_TMU0_OFFSET 9
220 #define GR_VERTEX_TOW_TMU0_OFFSET 10
221 #define GR_VERTEX_OOW_TMU0_OFFSET 11
222 #define GR_VERTEX_SOW_TMU1_OFFSET 12
223 #define GR_VERTEX_TOW_TMU1_OFFSET 13
224 #define GR_VERTEX_OOW_TMU1_OFFSET 14
225
226 #endif
227
228
229 /*
230 * Glide2 functions for Glide3
231 */
232 #if defined(FX_GLIDE3)
233 #define FX_grTexDownloadTable(TMU,type,data) \
234 do { \
235 BEGIN_BOARD_LOCK(); \
236 grTexDownloadTable(type,data); \
237 END_BOARD_LOCK(); \
238 } while (0);
239 #define FX_grTexDownloadTable_NoLock(TMU,type,data) \
240 grTexDownloadTable(type, data)
241 #else
242 #define FX_grTexDownloadTable(TMU,type,data) \
243 do { \
244 BEGIN_BOARD_LOCK(); \
245 grTexDownloadTable(TMU,type,data); \
246 END_BOARD_LOCK(); \
247 } while (0);
248 #define FX_grTexDownloadTable_NoLock grTexDownloadTable
249 #endif
250
251 /*
252 * Flush
253 */
254 #if defined(FX_GLIDE3)
255 #define FX_grFlush() \
256 do { \
257 BEGIN_BOARD_LOCK(); \
258 grFlush(); \
259 END_BOARD_LOCK(); \
260 } while (0)
261 #else
262 #define FX_grFlush() \
263 do { \
264 BEGIN_BOARD_LOCK(); \
265 grSstIdle(); \
266 END_BOARD_LOCK(); \
267 } while (0)
268 #endif
269
270 #define FX_grFinish() \
271 do { \
272 BEGIN_BOARD_LOCK(); \
273 grFinish(); \
274 END_BOARD_LOCK(); \
275 } while (0)
276
277 /*
278 * Write region: ToDo possible exploit the PixelPipe parameter.
279 */
280 #if defined(FX_GLIDE3)
281 #define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
282 do { \
283 BEGIN_BOARD_LOCK(); \
284 grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
285 END_BOARD_LOCK(); \
286 } while(0)
287 #else
288 #define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
289 do { \
290 BEGIN_BOARD_LOCK(); \
291 grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \
292 END_BOARD_LOCK(); \
293 } while (0)
294 #endif
295
296 /*
297 * Read region
298 */
299 #define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
300 do { \
301 BEGIN_BOARD_LOCK(); \
302 grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
303 END_BOARD_LOCK(); \
304 } while (0);
305
306 /*
307 * Draw triangle
308 */
309 #define FX_grDrawTriangle(a,b,c) \
310 do { \
311 BEGIN_CLIP_LOOP(); \
312 grDrawTriangle(a,b,c); \
313 END_CLIP_LOOP(); \
314 } while (0)
315
316 /*
317 * For Lod/LodLog2 conversion.
318 */
319 #if defined(FX_GLIDE3)
320 #define FX_largeLodLog2(info) (info).largeLodLog2
321 #else
322 #define FX_largeLodLog2(info) (info).largeLod
323 #endif
324
325 #if defined(FX_GLIDE3)
326 #define FX_aspectRatioLog2(info) (info).aspectRatioLog2
327 #else
328 #define FX_aspectRatioLog2(info) (info).aspectRatio
329 #endif
330
331 #if defined(FX_GLIDE3)
332 #define FX_smallLodLog2(info) (info).smallLodLog2
333 #else
334 #define FX_smallLodLog2(info) (info).smallLod
335 #endif
336
337 #if defined(FX_GLIDE3)
338 #define FX_lodToValue(val) ((int)(GR_LOD_256-val))
339 #else
340 #define FX_lodToValue(val) ((int)(val))
341 #endif
342
343 #if defined(FX_GLIDE3)
344 #define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2))
345 #else
346 #define FX_largeLodValue(info) ((int)(info).largeLod)
347 #endif
348 #define FX_largeLodValue_NoLock FX_largeLodValue
349
350 #if defined(FX_GLIDE3)
351 #define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2))
352 #else
353 #define FX_smallLodValue(info) ((int)(info).smallLod)
354 #endif
355 #define FX_smallLodValue_NoLock FX_smallLodValue
356
357 #if defined(FX_GLIDE3)
358 #define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val))
359 #else
360 #define FX_valueToLod(val) ((GrLOD_t)(val))
361 #endif
362
363 /*
364 * ScreenWidth/Height stuff.
365 */
366 extern int FX_grSstScreenWidth(void);
367 extern int FX_grSstScreenHeight(void);
368
369
370
371 /*
372 * Version string.
373 */
374 #if defined(FX_GLIDE3)
375 extern void FX_grGlideGetVersion(char *buf);
376 #else
377 #define FX_grGlideGetVersion(b) \
378 do { \
379 BEGIN_BOARD_LOCK(); \
380 grGlideGetVersion(b); \
381 END_BOARD_LOCK(); \
382 } while (0)
383 #endif
384 /*
385 * Performance statistics
386 */
387 #if defined(FX_GLIDE3)
388 extern void FX_grSstPerfStats(GrSstPerfStats_t * st);
389 #else
390 #define FX_grSstPerfStats(s) \
391 do { \
392 BEGIN_BOARD_LOCK(); \
393 grSstPerfStats(s); \
394 END_BOARD_LOCK(); \
395 } while (0)
396 #endif
397
398 /*
399 * Hardware Query
400 */
401 extern int FX_grSstQueryHardware(GrHwConfiguration * config);
402
403 /*
404 * GrHints
405 */
406 #if defined(FX_GLIDE3)
407 extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
408 extern void FX_grHints(GrHint_t hintType, FxU32 hintMask);
409 #else
410 #define FX_grHints(t,m) \
411 do { \
412 BEGIN_BOARD_LOCK(); \
413 grHints(t, m); \
414 END_BOARD_LOCK(); \
415 } while(0)
416 #define FX_grHints_NoLock grHints
417 #endif
418 /*
419 * Antialiashed line+point drawing.
420 */
421 #if defined(FX_GLIDE3)
422 extern void FX_grAADrawLine(GrVertex * a, GrVertex * b);
423 #else
424 #define FX_grAADrawLine(a,b) \
425 do { \
426 BEGIN_CLIP_LOOP(); \
427 grAADrawLine(a,b); \
428 END_CLIP_LOOP(); \
429 } while (0)
430 #endif
431
432 #if defined(FX_GLIDE3)
433 extern void FX_grAADrawPoint(GrVertex * a);
434 #else
435 #define FX_grAADrawPoint(a) \
436 do { \
437 BEGIN_CLIP_LOOP(); \
438 grAADrawPoint(a); \
439 END_CLIP_LOOP(); \
440 } while (0)
441 #endif
442
443 /*
444 * Needed for Glide3 only, to set up Glide2 compatible vertex layout.
445 */
446 #if defined(FX_GLIDE3)
447 extern void FX_setupGrVertexLayout(void);
448 #else
449 #define FX_setupGrVertexLayout() do {} while (0)
450 #endif
451 /*
452 * grSstControl stuff
453 */
454 extern FxBool FX_grSstControl(FxU32 code);
455
456 /*
457 * grGammaCorrectionValue
458 */
459 #if defined(FX_GLIDE3)
460 extern void FX_grGammaCorrectionValue(float val);
461 #else
462 #define FX_grGammaCorrectionValue(v) \
463 do { \
464 BEGIN_BOARD_LOCK(); \
465 grGammaCorrectionValue(v) \
466 END_BOARD_LOCK(); \
467 } while (0)
468 #endif
469
470 #if defined(FX_GLIDE3)
471 #define FX_grSstWinClose(w) \
472 do { \
473 BEGIN_BOARD_LOCK(); \
474 grSstWinClose(w); \
475 END_BOARD_LOCK(); \
476 } while (0)
477 #else
478 #define FX_grSstWinClose(w) \
479 do { \
480 BEGIN_BOARD_LOCK(); \
481 grSstWinClose(); \
482 END_BOARD_LOCK(); \
483 } while (0)
484 #endif
485
486
487 extern FX_GrContext_t FX_grSstWinOpen(FxU32 hWnd,
488 GrScreenResolution_t screen_resolution,
489 GrScreenRefresh_t refresh_rate,
490 GrColorFormat_t color_format,
491 GrOriginLocation_t origin_location,
492 int nColBuffers, int nAuxBuffers);
493
494
495 #define FX_grDrawLine(v1, v2) \
496 do { \
497 BEGIN_CLIP_LOOP(); \
498 grDrawLine(v1, v2); \
499 END_CLIP_LOOP(); \
500 } while (0)
501
502 #define FX_grDrawPoint(p) \
503 do { \
504 BEGIN_CLIP_LOOP(); \
505 grDrawPoint(p); \
506 END_CLIP_LOOP(); \
507 } while (0)
508
509 #if defined(FX_GLIDE3)
510 extern void FX_grDrawPolygonVertexList(int n, GrVertex * v);
511 #else
512 #define FX_grDrawPolygonVertexList(n, v) \
513 do { \
514 BEGIN_CLIP_LOOP(); \
515 grDrawPolygonVertexList(n, v); \
516 END_CLIP_LOOP(); \
517 } while (0)
518 #endif
519
520 #define FX_grDitherMode(m) \
521 do { \
522 BEGIN_BOARD_LOCK(); \
523 grDitherMode(m); \
524 END_BOARD_LOCK(); \
525 } while (0)
526
527 #define FX_grRenderBuffer(b) \
528 do { \
529 BEGIN_BOARD_LOCK(); \
530 grRenderBuffer(b); \
531 END_BOARD_LOCK(); \
532 } while (0)
533
534 #define FX_grBufferClear(c, a, d) \
535 do { \
536 BEGIN_CLIP_LOOP(); \
537 grBufferClear(c, a, d); \
538 END_CLIP_LOOP(); \
539 } while (0)
540
541 #define FX_grDepthMask(m) \
542 do { \
543 BEGIN_BOARD_LOCK(); \
544 grDepthMask(m); \
545 END_BOARD_LOCK(); \
546 } while (0)
547
548 #define FX_grColorMask(c, a) \
549 do { \
550 BEGIN_BOARD_LOCK(); \
551 grColorMask(c, a); \
552 END_BOARD_LOCK(); \
553 } while (0)
554
555 extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
556 GrLfbWriteMode_t writeMode,
557 GrOriginLocation_t origin, FxBool pixelPipeline,
558 GrLfbInfo_t * info);
559
560 #define FX_grLfbUnlock(t, b) \
561 do { \
562 BEGIN_BOARD_LOCK(); \
563 grLfbUnlock(t, b); \
564 END_BOARD_LOCK(); \
565 } while (0)
566
567 #define FX_grConstantColorValue(v) \
568 do { \
569 BEGIN_BOARD_LOCK(); \
570 grConstantColorValue(v); \
571 END_BOARD_LOCK(); \
572 } while (0)
573
574 #define FX_grConstantColorValue_NoLock grConstantColorValue
575
576 #define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \
577 do { \
578 BEGIN_CLIP_LOOP(); \
579 grAADrawTriangle(a, b, c, ab, bc, ca); \
580 END_CLIP_LOOP(); \
581 } while (0)
582
583 #define FX_grAlphaBlendFunction(rs, rd, as, ad) \
584 do { \
585 BEGIN_BOARD_LOCK(); \
586 grAlphaBlendFunction(rs, rd, as, ad); \
587 END_BOARD_LOCK(); \
588 } while (0)
589
590 #define FX_grAlphaCombine(func, fact, loc, oth, inv) \
591 do { \
592 BEGIN_BOARD_LOCK(); \
593 grAlphaCombine(func, fact, loc, oth, inv); \
594 END_BOARD_LOCK(); \
595 } while (0)
596
597 #define FX_grAlphaCombine_NoLock grAlphaCombine
598
599 #define FX_grAlphaTestFunction(f) \
600 do { \
601 BEGIN_BOARD_LOCK(); \
602 grAlphaTestFunction(f); \
603 END_BOARD_LOCK(); \
604 } while (0)
605
606 #define FX_grAlphaTestReferenceValue(v) \
607 do { \
608 BEGIN_BOARD_LOCK(); \
609 grAlphaTestReferenceValue(v); \
610 END_BOARD_LOCK(); \
611 } while (0)
612
613 #define FX_grClipWindow(minx, miny, maxx, maxy) \
614 do { \
615 BEGIN_BOARD_LOCK(); \
616 grClipWindow(minx, miny, maxx, maxy); \
617 END_BOARD_LOCK(); \
618 } while (0)
619
620 #define FX_grClipWindow_NoLock grClipWindow
621
622 #define FX_grColorCombine(func, fact, loc, oth, inv) \
623 do { \
624 BEGIN_BOARD_LOCK(); \
625 grColorCombine(func, fact, loc, oth, inv); \
626 END_BOARD_LOCK(); \
627 } while (0)
628
629 #define FX_grColorCombine_NoLock grColorCombine
630
631 #define FX_grCullMode(m) \
632 do { \
633 BEGIN_BOARD_LOCK(); \
634 grCullMode(m); \
635 END_BOARD_LOCK(); \
636 } while (0)
637
638 #define FX_grDepthBiasLevel(lev) \
639 do { \
640 BEGIN_BOARD_LOCK(); \
641 grDepthBiasLevel(lev); \
642 END_BOARD_LOCK(); \
643 } while (0)
644
645 #define FX_grDepthBufferFunction(func) \
646 do { \
647 BEGIN_BOARD_LOCK(); \
648 grDepthBufferFunction(func); \
649 END_BOARD_LOCK(); \
650 } while (0)
651
652 #define FX_grFogColorValue(c) \
653 do { \
654 BEGIN_BOARD_LOCK(); \
655 grFogColorValue(c); \
656 END_BOARD_LOCK(); \
657 } while (0)
658
659 #define FX_grFogMode(m) \
660 do { \
661 BEGIN_BOARD_LOCK(); \
662 grFogMode(m); \
663 END_BOARD_LOCK(); \
664 } while (0)
665
666 #define FX_grFogTable(t) \
667 do { \
668 BEGIN_BOARD_LOCK(); \
669 grFogTable(t); \
670 END_BOARD_LOCK(); \
671 } while (0)
672
673 #define FX_grTexClampMode(t, sc, tc) \
674 do { \
675 BEGIN_BOARD_LOCK(); \
676 grTexClampMode(t, sc, tc); \
677 END_BOARD_LOCK(); \
678 } while (0)
679
680 #define FX_grTexClampMode_NoLock grTexClampMode
681
682 #define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \
683 do { \
684 BEGIN_BOARD_LOCK(); \
685 grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \
686 END_BOARD_LOCK(); \
687 } while (0)
688
689 #define FX_grTexCombine_NoLock grTexCombine
690
691 #define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \
692 do { \
693 BEGIN_BOARD_LOCK(); \
694 grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \
695 END_BOARD_LOCK(); \
696 } while (0)
697
698 #define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel
699
700 #define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
701 do { \
702 BEGIN_BOARD_LOCK(); \
703 grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
704 END_BOARD_LOCK(); \
705 } while (0)
706
707 #define FX_grTexFilterMode(t, minf, magf) \
708 do { \
709 BEGIN_BOARD_LOCK(); \
710 grTexFilterMode(t, minf, magf); \
711 END_BOARD_LOCK(); \
712 } while (0)
713
714 #define FX_grTexFilterMode_NoLock grTexFilterMode
715
716 extern FxU32 FX_grTexMinAddress(GrChipID_t tmu);
717 extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu);
718
719 #define FX_grTexMipMapMode(t, m, lod) \
720 do { \
721 BEGIN_BOARD_LOCK(); \
722 grTexMipMapMode(t, m, lod); \
723 END_BOARD_LOCK(); \
724 } while (0)
725
726 #define FX_grTexMipMapMode_NoLock grTexMipMapMode
727
728 #define FX_grTexSource(t, sa, eo, i) \
729 do { \
730 BEGIN_BOARD_LOCK(); \
731 grTexSource(t, sa, eo, i); \
732 END_BOARD_LOCK(); \
733 } while (0)
734
735 #define FX_grTexSource_NoLock grTexSource
736
737 extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info);
738 #define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired
739
740 #define FX_grGlideGetState(s) \
741 do { \
742 BEGIN_BOARD_LOCK(); \
743 grGlideGetState(s); \
744 END_BOARD_LOCK(); \
745 } while (0)
746 #define FX_grGlideGetState_NoLock(s) grGlideGetState(s);
747
748 #define FX_grDRIBufferSwap(i) \
749 do { \
750 BEGIN_BOARD_LOCK(); \
751 grDRIBufferSwap(i); \
752 END_BOARD_LOCK(); \
753 } while (0)
754
755 #define FX_grSstSelect(b) \
756 do { \
757 BEGIN_BOARD_LOCK(); \
758 grSstSelect(b); \
759 END_BOARD_LOCK(); \
760 } while (0)
761
762 #define FX_grSstSelect_NoLock grSstSelect
763
764 #define FX_grGlideSetState(s) \
765 do { \
766 BEGIN_BOARD_LOCK(); \
767 grGlideSetState(s); \
768 END_BOARD_LOCK(); \
769 } while (0)
770 #define FX_grGlideSetState_NoLock(s) grGlideSetState(s);
771
772 #define FX_grDepthBufferMode(m) \
773 do { \
774 BEGIN_BOARD_LOCK(); \
775 grDepthBufferMode(m); \
776 END_BOARD_LOCK(); \
777 } while (0)
778
779 #define FX_grLfbWriteColorFormat(f) \
780 do { \
781 BEGIN_BOARD_LOCK(); \
782 grLfbWriteColorFormat(f); \
783 END_BOARD_LOCK(); \
784 } while (0)
785
786 #define FX_grDrawVertexArray(m, c, p) \
787 do { \
788 BEGIN_CLIP_LOOP(); \
789 grDrawVertexArray(m, c, p); \
790 END_CLIP_LOOP(); \
791 } while (0)
792
793 #define FX_grGlideShutdown() \
794 do { \
795 BEGIN_BOARD_LOCK(); \
796 grGlideShutdown(); \
797 END_BOARD_LOCK(); \
798 } while (0)
799
800 #define FX_grTexLodBiasValue_NoLock(t, v) grTexLodBiasValue(t, v)
801
802 #define FX_grTexLodBiasValue(t, v) \
803 do { \
804 BEGIN_BOARD_LOCK(); \
805 grTexLodBiasValue(t, v); \
806 END_BOARD_LOCK(); \
807 } while (0)
808
809 #define FX_grGlideInit_NoLock grGlideInit
810 #define FX_grSstWinOpen_NoLock grSstWinOpen
811
812 extern int FX_getFogTableSize(void);
813 extern int FX_getGrStateSize(void);
814
815 #endif /* __FX_GLIDE_WARPER__ */