Nugget
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
psyqo::OrderingTable< N, safety > Class Template Reference

The ordering table. Used to sort fragments before sending them to the GPU. More...

#include <psyqo/ordering-table.hh>

Inheritance diagram for psyqo::OrderingTable< N, safety >:
Inheritance graph
[legend]
Collaboration diagram for psyqo::OrderingTable< N, safety >:
Collaboration graph
[legend]

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.
 

Friends

class GPU
 

Detailed Description

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
NThe 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.

Constructor & Destructor Documentation

◆ OrderingTable()

template<size_t N = 4096, Safe safety = Safe::Yes>
psyqo::OrderingTable< N, safety >::OrderingTable ( )
inline

Member Function Documentation

◆ clear()

template<size_t N = 4096, Safe safety = Safe::Yes>
void psyqo::OrderingTable< N, safety >::clear ( )
inline

Clears the ordering table.

This function clears the ordering table. The table is automatically cleared by the GPU class after it has been sent to the GPU, so this function is only useful if you want to clear the ordering table without sending it to the GPU, which should be a rare use case.

◆ insert()

template<size_t N = 4096, Safe safety = Safe::Yes>
template<Fragment Frag>
void psyqo::OrderingTable< N, safety >::insert ( Frag &  frag,
int32_t  z 
)
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.

Parameters
fragThe fragment to insert.
zThe Z value of the fragment.

Friends And Related Symbol Documentation

◆ GPU

template<size_t N = 4096, Safe safety = Safe::Yes>
friend class GPU
friend

The documentation for this class was generated from the following file: