template<size_t N = 4096,
Safe safety = Safe::Yes>
class psyqo::OrderingTable< N, safety >
The ordering table. Used to sort fragments before sending them to the GPU.
This class is used to sort fragments before sending them to the GPU. The GPU will then process the fragments in the order specified by the ordering table. Since the PS1 GPU doesn't have any depth buffer, the ordering table is used to roughly sort the fragments by their Z value. Each fragment is assigned a "bucket" based on its Z value. The fragments inside a bucket are NOT sorted. The GPU class chain function can be used to schedule an ordering table to be sent to the GPU.
- Template Parameters
-
| N | The number of buckets in the ordering table. The larger the number, the more precise the sorting will be, but the more memory will be used. |
template<size_t N = 4096,
Safe safety = Safe::Yes>
template<Fragment Frag>
Inserts a fragment into the ordering table.
This function inserts a fragment into the ordering table. The fragment will be inserted into the bucket corresponding to its Z value. Any value outside of the range [0, N - 1] will be clamped to the nearest valid value when safety is set to Safe::Yes, which is the default.
Keep fragments short: the GPU DMA sends a whole fragment without waiting for the GPU, so a fragment over 17 words that starts while the GPU is still drawing gets corrupted on hardware, which PCSX-Redux does not reproduce. Insert one primitive per fragment rather than packing several into one. See tests/gpu-dma-node.
- Parameters
-
| frag | The fragment to insert. |
| z | The Z value of the fragment. |