|
SBgl 0.1.0
A graphics framework in C99
|
Sorting utilities for the SBgl batching system. More...


Go to the source code of this file.
Functions | |
| void | sbgl_radix_sort (sbgl_SortKey *keys, uint32_t *values, uint32_t count, sbgl_SortKey *temp_keys, uint32_t *temp_values) |
| Performs a stable radix sort on an array of 64-bit keys and associated 32-bit values. | |
Sorting utilities for the SBgl batching system.
Definition in file sbgl_sort.h.
| void sbgl_radix_sort | ( | sbgl_SortKey * | keys, |
| uint32_t * | values, | ||
| uint32_t | count, | ||
| sbgl_SortKey * | temp_keys, | ||
| uint32_t * | temp_values ) |
Performs a stable radix sort on an array of 64-bit keys and associated 32-bit values.
This implementation uses a Least Significant Digit (LSD) approach with 8 passes of 8-bit buckets to achieve O(N) complexity for 64-bit keys with low memory overhead.
| keys | Pointer to the array of sorting keys. Modified in place. |
| values | Pointer to the array of associated indices or values. Modified in place. |
| count | The number of elements to sort. |
| temp_keys | Workspace buffer for keys. Must be at least 'count' in size. |
| temp_values | Workspace buffer for values. Must be at least 'count' in size. |
Definition at line 8 of file sbgl_sort.c.