Changeset 3598 for trunk/src/opengl/mesa/3dfx/fxdrv.h
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/3dfx/fxdrv.h
r2965 r3598 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 75 75 #include "clip.h" 76 76 #include "vbrender.h" 77 #include "mem.h" 77 78 78 79 #ifdef XF86DRI … … 87 88 88 89 90 extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * ); 89 91 #if defined(MESA_DEBUG) && 0 90 extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * );91 92 #define grDrawTriangle fx_sanity_triangle 92 93 #endif … … 113 114 #if FX_USE_PARGB 114 115 115 #define CLIP_XCOORD 0 116 #define CLIP_YCOROD 1 117 #define CLIP_ZCOORD 2 118 #define CLIP_WCOORD 3 119 #define CLIP_GCOORD 4 120 #define CLIP_BCOORD 5 121 #define CLIP_RCOORD 6 122 #define CLIP_ACOORD 7 116 #define CLIP_XCOORD 0 /* normal place */ 117 #define CLIP_YCOROD 1 /* normal place */ 118 #define CLIP_ZCOORD 2 /* normal place */ 119 #define CLIP_WCOORD 3 /* normal place */ 120 #define CLIP_GCOORD 4 /* GR_VERTEX_PARGB_OFFSET */ 121 #define CLIP_BCOORD 5 /* GR_VERTEX_SOW_TMU0_OFFSET */ 122 #define CLIP_RCOORD 6 /* GR_VERTEX_TOW_TMU0_OFFSET */ 123 #define CLIP_ACOORD 7 /* GR_VERTEX_OOW_TMU0_OFFSET */ 123 124 124 125 #else 125 126 126 #define CLIP_XCOORD 0 127 #define CLIP_YCOROD 1 128 #define CLIP_ZCOORD 2 129 #define CLIP_WCOORD 3 130 #define CLIP_GCOORD 4 131 #define CLIP_BCOORD 5 132 #define CLIP_RCOORD 6 133 #define CLIP_ACOORD 7 127 #define CLIP_XCOORD 0 /* normal place */ 128 #define CLIP_YCOROD 1 /* normal place */ 129 #define CLIP_ZCOORD 2 /* GR_VERTEX_Z_OFFSET */ 130 #define CLIP_WCOORD 3 /* GR_VERTEX_R_OFFSET */ 131 #define CLIP_GCOORD 4 /* normal place */ 132 #define CLIP_BCOORD 5 /* normal place */ 133 #define CLIP_RCOORD 6 /* GR_VERTEX_OOZ_OFFSET */ 134 #define CLIP_ACOORD 7 /* normal place */ 134 135 135 136 … … 139 140 */ 140 141 typedef struct { 141 GLfloat f[15]; 142 GLubyte mask; 143 GLubyte usermask; 142 GLfloat f[15]; /* Same layout as GrVertex */ 143 GLubyte mask; /* Unsued */ 144 GLubyte usermask; /* Unused */ 144 145 } fxVertex; 145 146 … … 166 167 #endif 167 168 168 #define FX_VB_COLOR(fxm, color) 169 do { 170 if (sizeof(GLint) == 4*sizeof(GLubyte)) { 171 if (fxm->constColor != *(GLuint*)color) { 172 fxm->constColor = *(GLuint*)color;\173 FX_grConstantColorValue(FXCOLOR4(color));\174 } 175 } else { 176 FX_grConstantColorValue(FXCOLOR4(color)); 177 } 169 #define FX_VB_COLOR(fxm, color) \ 170 do { \ 171 if (sizeof(GLint) == 4*sizeof(GLubyte)) { \ 172 if (fxm->constColor != *(GLuint*)color) { \ 173 fxm->constColor = *(GLuint*)color; \ 174 FX_grConstantColorValue(FXCOLOR4(color)); \ 175 } \ 176 } else { \ 177 FX_grConstantColorValue(FXCOLOR4(color)); \ 178 } \ 178 179 } while (0) 179 180 180 #define GOURAUD(x) { 181 GLubyte *col = VB->ColorPtr->data[(x)]; 182 gWin[(x)].v.r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); 183 gWin[(x)].v.g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); 184 gWin[(x)].v.b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); 185 gWin[(x)].v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); 181 #define GOURAUD(x) { \ 182 GLubyte *col = VB->ColorPtr->data[(x)]; \ 183 gWin[(x)].v.r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \ 184 gWin[(x)].v.g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \ 185 gWin[(x)].v.b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \ 186 gWin[(x)].v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \ 186 187 } 187 188 188 189 #if FX_USE_PARGB 189 #define GOURAUD2(v, c) { 190 GLubyte *col = c; 191 v->argb=MESACOLOR2PARGB(col); 190 #define GOURAUD2(v, c) { \ 191 GLubyte *col = c; \ 192 v->argb=MESACOLOR2PARGB(col); \ 192 193 } 193 194 #else 194 #define GOURAUD2(v, c) { 195 GLubyte *col = c; 196 v->r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); 197 v->g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); 198 v->b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); 199 v->a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); 195 #define GOURAUD2(v, c) { \ 196 GLubyte *col = c; \ 197 v->r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \ 198 v->g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \ 199 v->b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \ 200 v->a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \ 200 201 } 201 202 #endif … … 230 231 #define FX_UM_E0_DECAL 0x00000004 231 232 #define FX_UM_E0_BLEND 0x00000008 232 #define FX_UM_E0_ADD 233 #define FX_UM_E0_ADD 0x00000010 233 234 234 235 #define FX_UM_E1_REPLACE 0x00000020 … … 236 237 #define FX_UM_E1_DECAL 0x00000080 237 238 #define FX_UM_E1_BLEND 0x00000100 238 #define FX_UM_E1_ADD 239 #define FX_UM_E1_ADD 0x00000200 239 240 240 241 #define FX_UM_E_ENVMODE 0x000003ff … … 256 257 #define FX_UM_E_IFMT 0x00fff000 257 258 258 #define FX_UM_COLOR_ITERATED 0x0 0100000259 #define FX_UM_COLOR_CONSTANT 0x0 0200000260 #define FX_UM_ALPHA_ITERATED 0x0 0400000261 #define FX_UM_ALPHA_CONSTANT 0x0 0800000259 #define FX_UM_COLOR_ITERATED 0x01000000 260 #define FX_UM_COLOR_CONSTANT 0x02000000 261 #define FX_UM_ALPHA_ITERATED 0x04000000 262 #define FX_UM_ALPHA_CONSTANT 0x08000000 262 263 263 264 typedef void (*tfxRenderVBFunc)(GLcontext *); … … 272 273 273 274 typedef struct { 274 GLsizei width, height; 275 G Lint glideFormat;276 277 unsigned short *data;278 GLboolean translated, used;275 GLsizei width, height; /* image size */ 276 GrTextureFormat_t glideFormat; /* Glide image format */ 277 unsigned short *data; /* Glide-formated texture image */ 278 GLboolean translated; /* True if data points to a reformated image */ 279 GLboolean used; /* True if we've given the image to Glide */ 279 280 } tfxMipMapLevel; 280 281 … … 306 307 307 308 GLfloat sScale, tScale; 308 GLint int_sScale, int_tScale; 309 310 311 309 GLint int_sScale, int_tScale; /* x86 floating point trick for 310 * multiplication by powers of 2. 311 * Used in fxfasttmp.h 312 */ 312 313 313 314 GuTexPalette palette; … … 326 327 327 328 typedef void (*tfxTriViewClipFunc)( struct vertex_buffer *VB, 328 329 329 GLuint v[], 330 GLubyte mask ); 330 331 331 332 typedef void (*tfxTriClipFunc)( struct vertex_buffer *VB, 332 333 333 GLuint v[], 334 GLuint mask ); 334 335 335 336 336 337 typedef void (*tfxLineClipFunc)( struct vertex_buffer *VB, 337 338 338 GLuint v1, GLuint v2, 339 GLubyte mask ); 339 340 340 341 … … 396 397 void *vert_store; 397 398 #if defined(FX_GLIDE3) 398 GrVertex **triangle_b; 399 GrVertex **strips_b; 399 GrVertex **triangle_b; /* Triangle buffer */ 400 GrVertex **strips_b; /* Strips buffer */ 400 401 #endif 401 402 … … 438 439 GrBuffer_t currentFB; 439 440 441 GLboolean bgrOrder; 440 442 GrColor_t color; 441 443 GrColor_t clearC; 442 444 GrAlpha_t clearA; 443 445 GLuint constColor; 446 GrCullMode_t cullMode; 444 447 445 448 tfxUnitsState unitsState; … … 455 458 GLuint render_index; 456 459 GLuint last_tri_caps; 457 GLuint stw_hint_state; 460 GLuint stw_hint_state; /* for grHints */ 458 461 GLuint is_in_hardware; 459 462 GLuint new_state; … … 476 479 GLenum fogTableMode; 477 480 GLfloat fogDensity; 481 GLfloat fogStart, fogEnd; 478 482 GrFog_t *fogTable; 483 GLint textureAlign; 479 484 480 485 /* Acc. functions */ … … 499 504 500 505 GLboolean verbose; 501 GLboolean haveTwoTMUs; 502 GLboolean emulateTwoTMUs; 506 GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */ 507 GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */ 503 508 GLboolean haveAlphaBuffer; 504 509 GLboolean haveZBuffer; … … 530 535 extern int glbCurrentBoard; 531 536 537 extern void fxPrintSetupFlags( const char *msg, GLuint flags ); 532 538 extern void fxSetupFXUnits(GLcontext *); 533 539 extern void fxSetupDDPointers(GLcontext *); … … 542 548 543 549 extern void fxRenderClippedLine( struct vertex_buffer *VB, 544 550 GLuint v1, GLuint v2 ); 545 551 546 552 extern void fxRenderClippedTriangle( struct vertex_buffer *VB, 547 553 GLuint n, GLuint vlist[] ); 548 554 549 555 … … 562 568 extern void fxSetupDDSpanPointers(GLcontext *); 563 569 564 extern void fxDDBufferSize(GLcontext *, GLuint *, GLuint *);565 566 570 extern void fxPrintTextureData(tfxTexInfo *ti); 567 extern void fxDDTexEnv(GLcontext *, GLenum, const GLfloat *);568 571 extern void fxDDTexImg(GLcontext *, GLenum, struct gl_texture_object *, 569 GLint, GLint, const struct gl_texture_image *); 572 GLint, GLint, const struct gl_texture_image *); 573 extern void fxDDTexSubImg(GLcontext *, GLenum, struct gl_texture_object *, 574 GLint, GLint, GLint, GLint, GLint, GLint, 575 const struct gl_texture_image *); 576 extern GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level, 577 GLenum format, GLenum type, const GLvoid *pixels, 578 const struct gl_pixelstore_attrib *packing, 579 struct gl_texture_object *texObj, 580 struct gl_texture_image *texImage, 581 GLboolean *retainInternalCopy); 582 extern GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, 583 GLint xoffset, GLint yoffset, 584 GLsizei width, GLsizei height, 585 GLenum format, GLenum type, const GLvoid *pixels, 586 const struct gl_pixelstore_attrib *packing, 587 struct gl_texture_object *texObj, 588 struct gl_texture_image *texImage); 589 extern void fxDDTexEnv(GLcontext *, GLenum, GLenum, const GLfloat *); 570 590 extern void fxDDTexParam(GLcontext *, GLenum, struct gl_texture_object *, 571 591 GLenum, const GLfloat *); 572 592 extern void fxDDTexBind(GLcontext *, GLenum, struct gl_texture_object *); 573 593 extern void fxDDTexDel(GLcontext *, struct gl_texture_object *); 574 594 extern void fxDDTexPalette(GLcontext *, struct gl_texture_object *); 575 extern void fxDDTexuseGlbPalette(GLcontext *, GLboolean);576 extern void fxDDTexSubImg(GLcontext *, GLenum, struct gl_texture_object *, GLint,577 GLint, GLint, GLint, GLint, GLint, const struct gl_texture_image *);578 595 extern void fxDDTexUseGlbPalette(GLcontext *, GLboolean); 579 596 … … 589 606 590 607 extern void fxDDCheckMergeAndRender( GLcontext *ctx, 591 608 struct gl_pipeline_stage *d ); 592 609 593 610 extern void fxDDMergeAndRender( struct vertex_buffer *VB ); 594 611 595 612 extern void fxDDCheckPartialRasterSetup( GLcontext *ctx, 596 613 struct gl_pipeline_stage *d ); 597 614 598 615 extern void fxDDPartialRasterSetup( struct vertex_buffer *VB ); … … 601 618 602 619 extern GLuint fxDDRegisterPipelineStages( struct gl_pipeline_stage *out, 603 604 620 const struct gl_pipeline_stage *in, 621 GLuint nr ); 605 622 606 623 extern GLboolean fxDDBuildPrecalcPipeline( GLcontext *ctx ); 607 624 608 625 extern void fxDDOptimizePrecalcPipeline( GLcontext *ctx, 609 626 struct gl_pipeline *pipe ); 610 627 611 628 extern void fxDDRenderElementsDirect( struct vertex_buffer *VB ); … … 617 634 extern void fxTMInit(fxMesaContext ctx); 618 635 extern void fxTMClose(fxMesaContext ctx); 636 extern void fxTMRestoreTextures_NoLock(fxMesaContext ctx); 619 637 extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint); 620 638 extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *); 639 #define fxTMMoveOutTM_NoLock fxTMMoveOutTM 621 640 extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *); 622 641 extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *, GLint); 623 642 extern void fxTMReloadSubMipMapLevel(fxMesaContext, struct gl_texture_object *, 624 643 GLint, GLint, GLint); 625 644 626 645 extern void fxTexGetFormat(GLenum, GrTextureFormat_t *, GLint *); 627 646 extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *, 628 647 float *, float *, int *, int *, int *, int *); 629 648 630 649 extern void fxDDScissor( GLcontext *ctx, 631 650 GLint x, GLint y, GLsizei w, GLsizei h ); 632 651 extern void fxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ); 633 652 extern GLboolean fxDDColorMask(GLcontext *ctx, 634 GLboolean r, GLboolean g, 635 GLboolean b, GLboolean a ); 636 637 extern GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx, 638 GLuint n, GLint x, GLint y, 639 const GLdepth z[], 640 GLubyte mask[]); 641 642 extern void fxDDDepthTestPixelsGeneric(GLcontext* ctx, 643 GLuint n, 644 const GLint x[], const GLint y[], 645 const GLdepth z[], GLubyte mask[]); 646 647 extern void fxDDReadDepthSpanFloat(GLcontext *ctx, 648 GLuint n, GLint x, GLint y, GLfloat depth[]); 649 650 extern void fxDDReadDepthSpanInt(GLcontext *ctx, 651 GLuint n, GLint x, GLint y, GLdepth depth[]); 652 653 GLboolean r, GLboolean g, 654 GLboolean b, GLboolean a ); 655 656 extern void fxDDWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, 657 const GLdepth depth[], const GLubyte mask[]); 658 659 extern void fxDDReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, 660 GLdepth depth[]); 661 662 extern void fxDDWriteDepthPixels(GLcontext *ctx, GLuint n, 663 const GLint x[], const GLint y[], 664 const GLdepth depth[], const GLubyte mask[]); 665 666 extern void fxDDReadDepthPixels(GLcontext *ctx, GLuint n, 667 const GLint x[], const GLint y[], 668 GLdepth depth[]); 653 669 654 670 extern void fxDDFastPath( struct vertex_buffer *VB ); … … 669 685 extern void fxSetScissorValues(GLcontext *ctx); 670 686 extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, 671 struct gl_texture_object *tObj, 672 GLint where); 673 extern void fxSetupTexture_NoLock(GLcontext *ctx); 674 extern void fxSetupTexture(GLcontext *ctx); 675 676 extern void fxInitPixelTables(GLboolean bgrOrder); 677 678 #endif 687 struct gl_texture_object *tObj, 688 GLint where); 689 extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder); 690 691 #endif
Note:
See TracChangeset
for help on using the changeset viewer.