Commit 315e048
committed
Change
This PR introduces 3 improvements to the
`cgltf_accessor_unpack_indices` function:
1. Query `cgltf_num_components` and use it to load int vectors
properly - this is useful for loading vec4 uint8_t joint indices.
2. Add support for uint8_t in slow path (for loop) in cases where
data wasn't tightly packed (previously the function wouldn't do
anything).
3. Return 0 on failure instead of failing silently and leaving memory
uninitialized.cgltf_accessor_unpack_indices to work with int vectors1 parent 360db1a commit 315e048
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2638 | 2638 | | |
2639 | 2639 | | |
2640 | 2640 | | |
2641 | | - | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
2642 | 2645 | | |
2643 | 2646 | | |
2644 | 2647 | | |
| |||
2660 | 2663 | | |
2661 | 2664 | | |
2662 | 2665 | | |
2663 | | - | |
| 2666 | + | |
2664 | 2667 | | |
2665 | 2668 | | |
2666 | 2669 | | |
2667 | 2670 | | |
2668 | 2671 | | |
| 2672 | + | |
| 2673 | + | |
2669 | 2674 | | |
2670 | 2675 | | |
2671 | 2676 | | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
2672 | 2683 | | |
2673 | 2684 | | |
2674 | 2685 | | |
| |||
2682 | 2693 | | |
2683 | 2694 | | |
2684 | 2695 | | |
2685 | | - | |
| 2696 | + | |
2686 | 2697 | | |
2687 | 2698 | | |
2688 | 2699 | | |
| |||
0 commit comments