Commit 2a57c8b
Comprehensive review: fix data races, face validation, line endings, index sentinels, shape perf
- Fix multi-threaded mtllib_t/mtllib_i data race: use per-thread tracking
and resolve deterministically (earliest line wins) after join
- Fix opt_index_t sentinel: use INT_MIN for "not present" to distinguish
from OBJ relative index -1 ("last element")
- Fix OPT_CMD_F merge: skip opt_fixIndex for missing vt/vn components
(use -1 "not present" instead of misinterpreting as relative index)
- Fix usemtl unknown material sentinel: use -1 instead of -2 to match
legacy API semantics
- Fix face triangulation: validate face_count >= 3 before accessing
buffers (skip degenerate faces matching legacy parser behavior)
- Fix scalar_find_line_infos: handle bare \r line endings (old Mac style)
in addition to \n and \r\n
- Fix MSVC SIMD: add #include <intrin.h> for _BitScanForward
- Fix OptLoadConfig::verbose doc: mark as reserved/no-op
- Fix shape construction: use prefix-sum for O(1) index slicing instead
of O(#faces × #groups) recomputation
- Fix LoadObjOpt(file) material fallback: remove inconsistent post-parse
material loading that populated materials without recomputing material_ids
- Add 3 new tests: face_missing_vt_vn, bare_cr_line_endings, degenerate_face
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>1 parent c498e9a commit 2a57c8b
2 files changed
Lines changed: 205 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3578 | 3578 | | |
3579 | 3579 | | |
3580 | 3580 | | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
3581 | 3683 | | |
3582 | 3684 | | |
3583 | 3685 | | |
| |||
3737 | 3839 | | |
3738 | 3840 | | |
3739 | 3841 | | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
3740 | 3845 | | |
3741 | 3846 | | |
3742 | 3847 | | |
| |||
0 commit comments