Changeset 3598 for trunk/src/opengl/mesa/vbxform.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
-
trunk/src/opengl/mesa/vbxform.c (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/vbxform.c
r2962 r3598 1 /* $Id: vbxform.c,v 1. 2 2000-03-01 18:49:39jeroen Exp $ */1 /* $Id: vbxform.c,v 1.3 2000-05-23 20:41:03 jeroen Exp $ */ 2 2 3 3 /* … … 30 30 #include "all.h" 31 31 #else 32 #ifndef XFree86Server 33 #include <math.h> 34 #include <stdlib.h> 35 #include <stdio.h> 36 #else 37 #include "GL/xf86glx.h" 38 #endif 32 #include "glheader.h" 39 33 #include "types.h" 40 34 #include "context.h" … … 59 53 #include "vbxform.h" 60 54 #include "xform.h" 55 #include "mem.h" 56 #include "state.h" 61 57 #endif 62 58 … … 132 128 { 133 129 if (VB->Count != IM->Count && 0) { 134 fprintf(stderr, "Trying to copy vertices in the middle of an IM (%d/%d)!!\n",135 VB->Count, IM->Count);130 fprintf(stderr, "Trying to copy vertices in the middle of an IM (%d/%d)!!\n", 131 VB->Count, IM->Count); 136 132 } 137 133 else if (VB->pipeline->copy_transformed_data) { 138 134 139 for (dst = start ; dst < VB_START ; dst++)140 {141 GLuint src = VB->Copy[dst];142 143 if (MESA_VERBOSE&VERBOSE_IMMEDIATE)144 fprintf(stderr, "copying vertex %u to %u\n", src, dst);145 146 COPY_4FV( VB->Clip.data[dst], VEC_ELT(VB->ClipPtr, GLfloat, src) );147 COPY_4FV( VB->Win.data[dst], VB->Win.data[src] );148 149 VB->UserClipMask[dst] = VB->UserClipMask[src];150 VB->ClipMask[dst] = (GLubyte) (VB->ClipMask[src] & ~CLIP_CULLED_BIT);151 VB->ClipAndMask &= VB->ClipMask[dst];152 VB->ClipOrMask |= VB->ClipMask[dst];153 VB->ClipMask[src] = 0;/* hack for bounds_cull_vb */154 155 COPY_4UBV( IM->Color[dst], IM->Color[src] );156 COPY_4UBV( VB->Spec[0][dst], VB->Spec[0][src] );157 COPY_4UBV( VB->Spec[1][dst], VB->Spec[1][src] );158 COPY_4UBV( VB->BColor.data[dst], VB->BColor.data[src] );159 IM->Index[dst] = IM->Index[src];160 VB->BIndex.data[dst] = VB->BIndex.data[src];161 162 if (VB->TexCoordPtr[0] == &IM->v.TexCoord[0])163 COPY_4FV( IM->TexCoord[0][dst], IM->TexCoord[0][src] );164 165 if (VB->TexCoordPtr[1] == &IM->v.TexCoord[1])166 COPY_4FV( IM->TexCoord[1][dst], IM->TexCoord[1][src] );167 168 IM->Elt[dst] = IM->Elt[src];169 VB->SavedOrFlag |= IM->Flag[src];170 }135 for (dst = start ; dst < VB_START ; dst++) 136 { 137 GLuint src = VB->Copy[dst]; 138 139 if (MESA_VERBOSE&VERBOSE_IMMEDIATE) 140 fprintf(stderr, "copying vertex %u to %u\n", src, dst); 141 142 COPY_4FV( VB->Clip.data[dst], VEC_ELT(VB->ClipPtr, GLfloat, src) ); 143 COPY_4FV( VB->Win.data[dst], VB->Win.data[src] ); 144 145 VB->UserClipMask[dst] = VB->UserClipMask[src]; 146 VB->ClipMask[dst] = (GLubyte) (VB->ClipMask[src] & ~CLIP_CULLED_BIT); 147 VB->ClipAndMask &= VB->ClipMask[dst]; 148 VB->ClipOrMask |= VB->ClipMask[dst]; 149 VB->ClipMask[src] = 0; /* hack for bounds_cull_vb */ 150 151 COPY_4UBV( IM->Color[dst], IM->Color[src] ); 152 COPY_4UBV( VB->Spec[0][dst], VB->Spec[0][src] ); 153 COPY_4UBV( VB->Spec[1][dst], VB->Spec[1][src] ); 154 COPY_4UBV( VB->BColor.data[dst], VB->BColor.data[src] ); 155 IM->Index[dst] = IM->Index[src]; 156 VB->BIndex.data[dst] = VB->BIndex.data[src]; 157 158 if (VB->TexCoordPtr[0] == &IM->v.TexCoord[0]) 159 COPY_4FV( IM->TexCoord[0][dst], IM->TexCoord[0][src] ); 160 161 if (VB->TexCoordPtr[1] == &IM->v.TexCoord[1]) 162 COPY_4FV( IM->TexCoord[1][dst], IM->TexCoord[1][src] ); 163 164 IM->Elt[dst] = IM->Elt[src]; 165 VB->SavedOrFlag |= IM->Flag[src]; 166 } 171 167 } 172 168 … … 198 194 */ 199 195 void gl_copy_prev_vertices( struct vertex_buffer *VB, 200 struct immediate *prev,201 struct immediate *next )196 struct immediate *prev, 197 struct immediate *next ) 202 198 { 203 199 GLuint dst; … … 206 202 if (MESA_VERBOSE&VERBOSE_CULL) 207 203 fprintf(stderr, "copy prev vertices im: prev %d next %d copystart %d\n", 208 prev->id, next->id, VB->CopyStart);204 prev->id, next->id, VB->CopyStart); 209 205 210 206 /* VB_START is correct as vertex copying is only required when an … … 216 212 217 213 if (MESA_VERBOSE&VERBOSE_CULL) 218 fprintf(stderr, "copy_prev: copy %d to %d\n", src, dst );214 fprintf(stderr, "copy_prev: copy %d to %d\n", src, dst ); 219 215 220 216 COPY_4FV( next->Obj[dst], prev->Obj[src] ); 221 217 222 218 if ((flags&VERT_TEX0_ANY) && VB->TexCoordPtr[0] == &prev->v.TexCoord[0]) 223 COPY_4FV( next->TexCoord[0][dst], prev->TexCoord[0][src] );224 219 COPY_4FV( next->TexCoord[0][dst], prev->TexCoord[0][src] ); 220 225 221 if ((flags&VERT_TEX1_ANY) && VB->TexCoordPtr[1] == &prev->v.TexCoord[1]) 226 COPY_4FV( next->TexCoord[1][dst], prev->TexCoord[1][src] );222 COPY_4FV( next->TexCoord[1][dst], prev->TexCoord[1][src] ); 227 223 228 224 COPY_4UBV( next->Color[dst], prev->Color[src] ); … … 270 266 if (0) 271 267 fprintf(stderr, 272 "in reset_input(IM %d), BeginState is %x, setting prim[%d] to %s\n",273 IM->id,274 VERT_BEGIN_0,275 IM->Start, gl_lookup_enum_by_nr(ctx->Current.Primitive));268 "in reset_input(IM %d), BeginState is %x, setting prim[%d] to %s\n", 269 IM->id, 270 VERT_BEGIN_0, 271 IM->Start, gl_lookup_enum_by_nr(ctx->Current.Primitive)); 276 272 277 273 IM->ArrayAndFlags = ~ctx->Array.Flags; … … 290 286 for (;;) { 291 287 if ((flag[++i] & match) == 0) { 292 COPY_4FV(data[i], data[i-1]);293 flag[i] |= (flag[i-1] & match);294 if (flag[i] & VERT_END_VB) break;288 COPY_4FV(data[i], data[i-1]); 289 flag[i] |= (flag[i-1] & match); 290 if (flag[i] & VERT_END_VB) break; 295 291 } 296 292 } … … 308 304 for (;;) { 309 305 if ((flag[++i] & match) == 0) { 310 COPY_3V(data[i], data[i-1]);311 flag[i] |= match;312 if (flag[i] & VERT_END_VB) break;306 COPY_3V(data[i], data[i-1]); 307 flag[i] |= match; 308 if (flag[i] & VERT_END_VB) break; 313 309 } 314 310 } … … 323 319 for (;;) { 324 320 if ((flag[++i] & match) == 0) { 325 data[i] = data[i-1];326 if (flag[i] & VERT_END_VB) break;321 data[i] = data[i-1]; 322 if (flag[i] & VERT_END_VB) break; 327 323 } 328 324 } … … 337 333 for (;;) { 338 334 if ((flag[++i] & match) == 0) { 339 data[i] = data[i-1];340 if (flag[i] & VERT_END_VB) break;335 data[i] = data[i-1]; 336 if (flag[i] & VERT_END_VB) break; 341 337 } 342 338 } … … 352 348 for (;;) { 353 349 if ((flag[++i] & match) == 0) { 354 COPY_4UBV(data[i], data[i-1]);355 if (flag[i] & VERT_END_VB) break;350 COPY_4UBV(data[i], data[i-1]); 351 if (flag[i] & VERT_END_VB) break; 356 352 } 357 353 } … … 365 361 find_last_3f( float data[][3], GLuint flag[], GLuint match, GLuint count ) 366 362 { 367 GLuint i = count;368 369 for (;;)363 int i = count; 364 365 do { 370 366 if ((flag[--i] & match) != 0) { 371 COPY_3V(data[count], data[i]); 372 return; 373 } 367 COPY_3V(data[count], data[i]); 368 return; 369 } 370 } while (i >= 0); 371 372 /* To reach this point excercises a bug that seems only to exist on 373 * dec alpha installations. I want to leave this print statement 374 * enabled on the 3.3 branch so that we are reminded to track down 375 * the problem. 376 */ 377 fprintf(stderr, 378 "didn't find VERT_NORM in find_last_3f" 379 "(Dec alpha problem?)\n"); 374 380 } 375 381 376 382 static void 377 383 fixup_first_4v( GLfloat data[][4], GLuint flag[], GLuint match, 378 GLuint start, GLfloat *dflt )384 GLuint start, GLfloat *dflt ) 379 385 { 380 386 GLuint i = start-1; … … 388 394 static void 389 395 fixup_first_1ui( GLuint data[], GLuint flag[], GLuint match, 390 GLuint start, GLuint dflt )396 GLuint start, GLuint dflt ) 391 397 { 392 398 GLuint i = start-1; … … 400 406 static void 401 407 fixup_first_1ub( GLubyte data[], GLuint flag[], GLuint match, 402 GLuint start, GLubyte dflt )408 GLuint start, GLubyte dflt ) 403 409 { 404 410 GLuint i = start-1; … … 412 418 static void 413 419 fixup_first_4ub( GLubyte data[][4], GLuint flag[], GLuint match, 414 GLuint start, GLubyte dflt[4] )420 GLuint start, GLubyte dflt[4] ) 415 421 { 416 422 GLuint i = start-1; … … 425 431 426 432 static GLuint vertex_sizes[16] = { 0, 427 1,428 2, 2,429 3, 3, 3, 3,430 4, 4, 4, 4, 4, 4, 4, 4 };433 1, 434 2, 2, 435 3, 3, 3, 3, 436 4, 4, 4, 4, 4, 4, 4, 4 }; 431 437 432 438 … … 450 456 for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) { 451 457 if (orflag & VERT_TEX_ANY(i)) { 452 GLuint szflag = ((orflag>>(VERT_TEX0_SHIFT+i*NR_TEXSIZE_BITS))453 & 0xf);454 IM->v.TexCoord[i].size = vertex_sizes[szflag];458 GLuint szflag = ((orflag>>(VERT_TEX0_SHIFT+i*NR_TEXSIZE_BITS)) 459 & 0xf); 460 IM->v.TexCoord[i].size = vertex_sizes[szflag]; 455 461 } 456 462 } … … 505 511 { 506 512 fprintf(stderr, "Start: %u Count: %u LastData: %u\n", 507 IM->Start, IM->Count, IM->LastData);513 IM->Start, IM->Count, IM->LastData); 508 514 gl_print_vert_flags("Orflag", orflag); 509 515 gl_print_vert_flags("Andflag", andflag); … … 541 547 542 548 if (ctx->ExecuteFlag && (fixup & ~IM->Flag[start])) { 543 GLuint copy = fixup & ~IM->Flag[start];544 545 if (copy & VERT_NORM) 546 COPY_3V( IM->Normal[start], ctx->Current.Normal );547 548 if (copy & VERT_RGBA)549 COPY_4UBV( IM->Color[start], ctx->Current.ByteColor);550 551 if (copy & VERT_INDEX)552 IM->Index[start] = ctx->Current.Index;553 554 if (copy & VERT_EDGE)555 IM->EdgeFlag[start] = ctx->Current.EdgeFlag;556 557 if (copy & VERT_TEX0_ANY)558 COPY_4FV( IM->TexCoord[0][start], ctx->Current.Texcoord[0] );559 560 if (copy & VERT_TEX1_ANY)561 COPY_4FV( IM->TexCoord[1][start], ctx->Current.Texcoord[1] );549 GLuint copy = fixup & ~IM->Flag[start]; 550 551 if (copy & VERT_NORM) 552 COPY_3V( IM->Normal[start], ctx->Current.Normal ); 553 554 if (copy & VERT_RGBA) 555 COPY_4UBV( IM->Color[start], ctx->Current.ByteColor); 556 557 if (copy & VERT_INDEX) 558 IM->Index[start] = ctx->Current.Index; 559 560 if (copy & VERT_EDGE) 561 IM->EdgeFlag[start] = ctx->Current.EdgeFlag; 562 563 if (copy & VERT_TEX0_ANY) 564 COPY_4FV( IM->TexCoord[0][start], ctx->Current.Texcoord[0] ); 565 566 if (copy & VERT_TEX1_ANY) 567 COPY_4FV( IM->TexCoord[1][start], ctx->Current.Texcoord[1] ); 562 568 } 563 569 564 570 565 571 if (MESA_VERBOSE&VERBOSE_IMMEDIATE) 566 gl_print_vert_flags("fixup", fixup);572 gl_print_vert_flags("fixup", fixup); 567 573 568 574 if (fixup & VERT_TEX0_ANY) { 569 if (orflag & VERT_TEX0_ANY)570 fixup_4f( IM->TexCoord[0], IM->Flag, start, VERT_TEX0_1234 );571 else572 fixup_first_4v( IM->TexCoord[0], IM->Flag, 0, start,573 IM->TexCoord[0][start]);575 if (orflag & VERT_TEX0_ANY) 576 fixup_4f( IM->TexCoord[0], IM->Flag, start, VERT_TEX0_1234 ); 577 else 578 fixup_first_4v( IM->TexCoord[0], IM->Flag, 0, start, 579 IM->TexCoord[0][start]); 574 580 } 575 581 576 582 if (fixup & VERT_TEX1_ANY) { 577 if (orflag & VERT_TEX1_ANY)578 fixup_4f( IM->TexCoord[1], IM->Flag, start, VERT_TEX1_1234 );579 else580 fixup_first_4v( IM->TexCoord[1], IM->Flag, 0, start,581 IM->TexCoord[1][start] );583 if (orflag & VERT_TEX1_ANY) 584 fixup_4f( IM->TexCoord[1], IM->Flag, start, VERT_TEX1_1234 ); 585 else 586 fixup_first_4v( IM->TexCoord[1], IM->Flag, 0, start, 587 IM->TexCoord[1][start] ); 582 588 } 583 589 584 590 if (fixup & VERT_EDGE) { 585 if (orflag & VERT_EDGE)586 fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE );587 else588 fixup_first_1ub( IM->EdgeFlag, IM->Flag, 0, start,589 IM->EdgeFlag[start] );591 if (orflag & VERT_EDGE) 592 fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE ); 593 else 594 fixup_first_1ub( IM->EdgeFlag, IM->Flag, 0, start, 595 IM->EdgeFlag[start] ); 590 596 } 591 597 592 598 if (fixup & VERT_INDEX) { 593 if (orflag & VERT_INDEX)594 fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX );595 else596 fixup_first_1ui( IM->Index, IM->Flag, 0, start, IM->Index[start] );599 if (orflag & VERT_INDEX) 600 fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX ); 601 else 602 fixup_first_1ui( IM->Index, IM->Flag, 0, start, IM->Index[start] ); 597 603 } 598 604 599 605 if (fixup & VERT_RGBA) { 600 if (orflag & VERT_RGBA)601 fixup_4ub( IM->Color, IM->Flag, start, VERT_RGBA );602 else603 fixup_first_4ub( IM->Color, IM->Flag, 0, start, IM->Color[start] );606 if (orflag & VERT_RGBA) 607 fixup_4ub( IM->Color, IM->Flag, start, VERT_RGBA ); 608 else 609 fixup_first_4ub( IM->Color, IM->Flag, 0, start, IM->Color[start] ); 604 610 } 605 611 606 612 if (fixup & VERT_NORM) { 607 if (IM->OrFlag & VERT_EVAL_ANY) 608 fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM ); 609 else if (!(IM->Flag[IM->LastData] & VERT_NORM)) 610 find_last_3f( IM->Normal, IM->Flag, VERT_NORM, IM->LastData ); 613 /* Only eval cannot use the Flag member to find valid normals: 614 */ 615 if (IM->OrFlag & VERT_EVAL_ANY) 616 fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM ); 617 else { 618 /* Copy-to-current requires a valid normal in the last slot: 619 */ 620 if ((IM->OrFlag & VERT_NORM) && 621 !(IM->Flag[IM->LastData] & VERT_NORM)) 622 find_last_3f( IM->Normal, IM->Flag, VERT_NORM, IM->LastData ); 623 } 611 624 } 612 625 } … … 629 642 630 643 static void calc_normal_lengths( GLfloat *dest, 631 CONST GLfloat (*data)[3],632 const GLuint *flags,633 GLuint count )644 CONST GLfloat (*data)[3], 645 const GLuint *flags, 646 GLuint count ) 634 647 { 635 648 GLuint i; … … 637 650 for (i = 0 ; i < count ; i++ ) 638 651 if (flags[i] & VERT_NORM) { 639 GLfloat tmp = (GLfloat) LEN_3FV( data[i] );640 dest[i] = 0;641 if (tmp > 0)642 dest[i] = 1.0F / tmp;652 GLfloat tmp = (GLfloat) LEN_3FV( data[i] ); 653 dest[i] = 0; 654 if (tmp > 0) 655 dest[i] = 1.0F / tmp; 643 656 } 644 657 } … … 666 679 667 680 if (!IM->NormalLengths) 668 IM->NormalLengths = (GLfloat *)MALLOC(sizeof(GLfloat) * VB_SIZE);681 IM->NormalLengths = (GLfloat *)MALLOC(sizeof(GLfloat) * VB_SIZE); 669 682 670 683 calc_normal_lengths( IM->NormalLengths + start, 671 (const GLfloat (*)[3])(IM->Normal + start),672 IM->Flag + start,673 IM->Count - start);684 (const GLfloat (*)[3])(IM->Normal + start), 685 IM->Flag + start, 686 IM->Count - start); 674 687 675 688 IM->LastCalcedLength = IM->Count; … … 681 694 682 695 if (MESA_VERBOSE & VERBOSE_IMMEDIATE) { 683 fprintf(stderr, "start: %d count: %d\n", start, count);684 gl_print_vert_flags("fixup_cassette", fixup);696 fprintf(stderr, "start: %d count: %d\n", start, count); 697 gl_print_vert_flags("fixup_cassette", fixup); 685 698 } 686 699 687 700 if (fixup & VERT_TEX0_ANY) 688 fixup_first_4v( IM->TexCoord[0], IM->Flag, VERT_TEX0_ANY, start,689 ctx->Current.Texcoord[0] );701 fixup_first_4v( IM->TexCoord[0], IM->Flag, VERT_TEX0_ANY, start, 702 ctx->Current.Texcoord[0] ); 690 703 691 704 if (fixup & VERT_TEX1_ANY) 692 fixup_first_4v( IM->TexCoord[1], IM->Flag, VERT_TEX1_ANY, start,693 ctx->Current.Texcoord[1] );705 fixup_first_4v( IM->TexCoord[1], IM->Flag, VERT_TEX1_ANY, start, 706 ctx->Current.Texcoord[1] ); 694 707 695 708 if (fixup & VERT_EDGE) 696 fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_EDGE, start,697 ctx->Current.EdgeFlag );709 fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_EDGE, start, 710 ctx->Current.EdgeFlag ); 698 711 699 712 if (fixup & VERT_INDEX) 700 fixup_first_1ui(IM->Index, IM->Flag, VERT_INDEX, start,701 ctx->Current.Index );713 fixup_first_1ui(IM->Index, IM->Flag, VERT_INDEX, start, 714 ctx->Current.Index ); 702 715 703 716 if (fixup & VERT_RGBA) 704 fixup_first_4ub(IM->Color, IM->Flag, VERT_RGBA, start,705 ctx->Current.ByteColor );717 fixup_first_4ub(IM->Color, IM->Flag, VERT_RGBA, start, 718 ctx->Current.ByteColor ); 706 719 707 720 if ((fixup & VERT_NORM) && !(IM->Flag[start] & VERT_NORM)) { 708 COPY_3V(IM->Normal[start], ctx->Current.Normal);709 if (ctx->Transform.Normalize)710 IM->NormalLengths[start] = 1.0F / (GLfloat) LEN_3FV(ctx->Current.Normal);721 COPY_3V(IM->Normal[start], ctx->Current.Normal); 722 if (ctx->Transform.Normalize) 723 IM->NormalLengths[start] = 1.0F / (GLfloat) LEN_3FV(ctx->Current.Normal); 711 724 } 712 725 } … … 754 767 for (in = start ; in <= count ; in = in_nextprim[in]) 755 768 if (flags[in] & interesting) 756 break;769 break; 757 770 758 771 out = VB->CopyStart; … … 778 791 out_nextprim[in] = in_nextprim[in]; 779 792 } 780 793 781 794 782 795 VB->Primitive = out_prim; … … 803 816 if (0) 804 817 fprintf(stderr, "prim: %s count %u last %u incr %u ovf: %u\n", 805 gl_prim_name[prim], count, last, incr, VB->Ovf);818 gl_prim_name[prim], count, last, incr, VB->Ovf); 806 819 } 807 820 … … 927 940 if (MESA_VERBOSE&VERBOSE_IMMEDIATE) 928 941 fprintf(stderr, 929 "executing cassette, rows %u tc0->size == %u tc1->size == %u\n",930 VB->Count,931 VB->TexCoordPtr[0]->size,932 VB->TexCoordPtr[1]->size);942 "executing cassette, rows %u tc0->size == %u tc1->size == %u\n", 943 VB->Count, 944 VB->TexCoordPtr[0]->size, 945 VB->TexCoordPtr[1]->size); 933 946 934 947 if (MESA_VERBOSE&VERBOSE_IMMEDIATE) … … 951 964 if (VB->pipeline->replay_copied_vertices) { 952 965 if (!VB->CullDone) 953 gl_fast_copy_vb( VB );966 gl_fast_copy_vb( VB ); 954 967 955 968 gl_copy_prev_vertices( VB, VB->prev_buffer, IM ); … … 972 985 GLuint req = ~0; 973 986 static const char *tplate[5] = { "%s ", 974 "%s: %f ",975 "%s: %f %f ",976 "%s: %f %f %f ",977 "%s: %f %f %f %f " };987 "%s: %f ", 988 "%s: %f %f ", 989 "%s: %f %f %f ", 990 "%s: %f %f %f %f " }; 978 991 979 992 fprintf(stderr, "Cassette id %d, %u rows.\n", IM->id, IM->Count - IM->Start); … … 986 999 987 1000 fprintf(stderr, "Final begin/end state %s/%s, errors %s/%s\n", 988 (state & VERT_BEGIN_0) ? "in" : "out",989 (state & VERT_BEGIN_1) ? "in" : "out",990 (state & VERT_ERROR_0) ? "y" : "n",991 (state & VERT_ERROR_1) ? "y" : "n");1001 (state & VERT_BEGIN_0) ? "in" : "out", 1002 (state & VERT_BEGIN_1) ? "in" : "out", 1003 (state & VERT_ERROR_0) ? "y" : "n", 1004 (state & VERT_ERROR_1) ? "y" : "n"); 992 1005 993 1006 fprintf(stderr, "Obj size: %u, TexCoord0 size: %u, TexCoord1 size: %u\n", 994 IM->v.Obj.size,995 IM->v.TexCoord[0].size,996 IM->v.TexCoord[1].size);1007 IM->v.Obj.size, 1008 IM->v.TexCoord[0].size, 1009 IM->v.TexCoord[1].size); 997 1010 } 998 1011 … … 1000 1013 fprintf(stderr, "%u: ", i); 1001 1014 if (req & VERT_OBJ_ANY) { 1002 if (flags[i] & VERT_EVAL_C1)1003 fprintf(stderr, "EvalCoord %f ", IM->Obj[i][0]);1004 else if (flags[i] & VERT_EVAL_P1)1005 fprintf(stderr, "EvalPoint %.0f ", IM->Obj[i][0]);1006 else if (flags[i] & VERT_EVAL_C2)1007 fprintf(stderr, "EvalCoord %f %f ", IM->Obj[i][0], IM->Obj[i][1]);1008 else if (flags[i] & VERT_EVAL_P2)1009 fprintf(stderr, "EvalPoint %.0f %.0f ", IM->Obj[i][0], IM->Obj[i][1]);1010 else if (i < IM->Count && (flags[i]&VERT_OBJ_234)) {1011 fprintf(stderr, "(%x) ", flags[i] & VERT_OBJ_234);1012 fprintf(stderr, tplate[vertex_sizes[(flags[i]&VERT_OBJ_234)<<1]],1013 "Obj",1014 IM->Obj[i][0], IM->Obj[i][1], IM->Obj[i][2], IM->Obj[i][3]);1015 }1015 if (flags[i] & VERT_EVAL_C1) 1016 fprintf(stderr, "EvalCoord %f ", IM->Obj[i][0]); 1017 else if (flags[i] & VERT_EVAL_P1) 1018 fprintf(stderr, "EvalPoint %.0f ", IM->Obj[i][0]); 1019 else if (flags[i] & VERT_EVAL_C2) 1020 fprintf(stderr, "EvalCoord %f %f ", IM->Obj[i][0], IM->Obj[i][1]); 1021 else if (flags[i] & VERT_EVAL_P2) 1022 fprintf(stderr, "EvalPoint %.0f %.0f ", IM->Obj[i][0], IM->Obj[i][1]); 1023 else if (i < IM->Count && (flags[i]&VERT_OBJ_234)) { 1024 fprintf(stderr, "(%x) ", flags[i] & VERT_OBJ_234); 1025 fprintf(stderr, tplate[vertex_sizes[(flags[i]&VERT_OBJ_234)<<1]], 1026 "Obj", 1027 IM->Obj[i][0], IM->Obj[i][1], IM->Obj[i][2], IM->Obj[i][3]); 1028 } 1016 1029 } 1017 1030 1018 1031 if (req & flags[i] & VERT_ELT) 1019 fprintf(stderr, " Elt %u\t", IM->Elt[i]);1032 fprintf(stderr, " Elt %u\t", IM->Elt[i]); 1020 1033 1021 1034 if (req & flags[i] & VERT_NORM) 1022 fprintf(stderr, " Norm %f %f %f ",1023 IM->Normal[i][0], IM->Normal[i][1], IM->Normal[i][2]);1035 fprintf(stderr, " Norm %f %f %f ", 1036 IM->Normal[i][0], IM->Normal[i][1], IM->Normal[i][2]); 1024 1037 1025 1038 if (req & flags[i] & VERT_TEX0_ANY) 1026 fprintf(stderr, tplate[vertex_sizes[(flags[i]>>VERT_TEX0_SHIFT)&7]],1027 "TC0",1028 IM->TexCoord[0][i][0], IM->TexCoord[0][i][1],1029 IM->TexCoord[0][i][2], IM->TexCoord[0][i][2]);1039 fprintf(stderr, tplate[vertex_sizes[(flags[i]>>VERT_TEX0_SHIFT)&7]], 1040 "TC0", 1041 IM->TexCoord[0][i][0], IM->TexCoord[0][i][1], 1042 IM->TexCoord[0][i][2], IM->TexCoord[0][i][2]); 1030 1043 1031 1044 1032 1045 if (req & flags[i] & VERT_TEX1_ANY) 1033 fprintf(stderr, tplate[vertex_sizes[(flags[i]>>(VERT_TEX0_SHIFT+4))&7]],1034 "TC1",1035 IM->TexCoord[1][i][0], IM->TexCoord[1][i][1],1036 IM->TexCoord[1][i][2], IM->TexCoord[1][i][2]);1046 fprintf(stderr, tplate[vertex_sizes[(flags[i]>>(VERT_TEX0_SHIFT+4))&7]], 1047 "TC1", 1048 IM->TexCoord[1][i][0], IM->TexCoord[1][i][1], 1049 IM->TexCoord[1][i][2], IM->TexCoord[1][i][2]); 1037 1050 1038 1051 if (req & flags[i] & VERT_RGBA) 1039 fprintf(stderr, " Rgba %d %d %d %d ",1040 IM->Color[i][0], IM->Color[i][1],1041 IM->Color[i][2], IM->Color[i][3]);1052 fprintf(stderr, " Rgba %d %d %d %d ", 1053 IM->Color[i][0], IM->Color[i][1], 1054 IM->Color[i][2], IM->Color[i][3]); 1042 1055 1043 1056 if (req & flags[i] & VERT_INDEX) 1044 fprintf(stderr, " Index %u ", IM->Index[i]);1057 fprintf(stderr, " Index %u ", IM->Index[i]); 1045 1058 1046 1059 if (req & flags[i] & VERT_EDGE) 1047 fprintf(stderr, " Edgeflag %d ", IM->EdgeFlag[i]);1060 fprintf(stderr, " Edgeflag %d ", IM->EdgeFlag[i]); 1048 1061 1049 1062 if (req & flags[i] & VERT_MATERIAL) 1050 fprintf(stderr, " Material ");1051 1063 fprintf(stderr, " Material "); 1064 1052 1065 1053 1066 /* The order of these two is not easily knowable, but this is … … 1055 1068 */ 1056 1069 if (req & flags[i] & VERT_END) 1057 fprintf(stderr, " END ");1070 fprintf(stderr, " END "); 1058 1071 1059 1072 if (req & flags[i] & VERT_BEGIN) 1060 fprintf(stderr, " BEGIN(%s) ", gl_prim_name[IM->Primitive[i]]);1073 fprintf(stderr, " BEGIN(%s) ", gl_prim_name[IM->Primitive[i]]); 1061 1074 1062 1075 fprintf(stderr, "\n");
Note:
See TracChangeset
for help on using the changeset viewer.
