|
Nugget
|
The ordering table. Used to sort fragments before sending them to the GPU. More...
#include <psyqo/ordering-table.hh>


Public Member Functions | |
| OrderingTable () | |
| void | clear () |
| Clears the ordering table. | |
| template<Fragment Frag> | |
| void | insert (Frag &frag, int32_t z) |
| Inserts a fragment into the ordering table. | |
Public Attributes | |
| psyqo::Fragments::ChainEntry | m_table [N+1] |
Friends | |
| class | GPU |
Additional Inherited Members | |
Static Public Member Functions inherited from psyqo::OrderingTableBase | |
| static void | clear (psyqo::Fragments::ChainEntry *table, size_t size) |
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.
| 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. |
|
inline |
|
inline |
|
inline |
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.
| frag | The fragment to insert. |
| z | The Z value of the fragment. |
| psyqo::Fragments::ChainEntry psyqo::OrderingTable< N, safety >::m_table[N+1] |