libctru
v2.4.1
|
GX commands. More...
Go to the source code of this file.
Data Structures | |
union | gxCmdEntry_s |
GX command entry. More... | |
struct | gxCmdQueue_s |
GX command queue structure. More... | |
Macros | |
#define | GX_BUFFER_DIM(w, h) (((h)<<16)|((w)&0xFFFF)) |
Creates a buffer dimension parameter from width and height values. More... | |
#define | GX_TRANSFER_FLIP_VERT(x) ((x)<<0) |
Creates a transfer vertical flip flag. | |
#define | GX_TRANSFER_OUT_TILED(x) ((x)<<1) |
Creates a transfer tiled output flag. | |
#define | GX_TRANSFER_RAW_COPY(x) ((x)<<3) |
Creates a transfer raw copy flag. | |
#define | GX_TRANSFER_IN_FORMAT(x) ((x)<<8) |
Creates a transfer input format flag. | |
#define | GX_TRANSFER_OUT_FORMAT(x) ((x)<<12) |
Creates a transfer output format flag. | |
#define | GX_TRANSFER_SCALING(x) ((x)<<24) |
Creates a transfer scaling flag. | |
#define | GX_CMDLIST_UPDATE_GAS_ACC BIT(0) |
Updates gas additive blend results. | |
#define | GX_CMDLIST_FLUSH BIT(1) |
Flushes the command list. | |
Enumerations | |
enum | GX_TRANSFER_FORMAT { GX_TRANSFER_FMT_RGBA8 = 0 , GX_TRANSFER_FMT_RGB8 = 1 , GX_TRANSFER_FMT_RGB565 = 2 , GX_TRANSFER_FMT_RGB5A1 = 3 , GX_TRANSFER_FMT_RGBA4 = 4 } |
Supported transfer pixel formats. More... | |
enum | GX_TRANSFER_SCALE { GX_TRANSFER_SCALE_NO = 0 , GX_TRANSFER_SCALE_X = 1 , GX_TRANSFER_SCALE_XY = 2 } |
Anti-aliasing modes. More... | |
enum | GX_FILL_CONTROL { GX_FILL_TRIGGER = 0x001 , GX_FILL_FINISHED = 0x002 , GX_FILL_16BIT_DEPTH = 0x000 , GX_FILL_24BIT_DEPTH = 0x100 , GX_FILL_32BIT_DEPTH = 0x200 } |
GX transfer control flags. More... | |
Functions | |
void | gxCmdQueueClear (gxCmdQueue_s *queue) |
Clears a GX command queue. More... | |
void | gxCmdQueueAdd (gxCmdQueue_s *queue, const gxCmdEntry_s *entry) |
Adds a command to a GX command queue. More... | |
void | gxCmdQueueRun (gxCmdQueue_s *queue) |
Runs a GX command queue, causing it to begin processing incoming commands as they arrive. More... | |
void | gxCmdQueueStop (gxCmdQueue_s *queue) |
Stops a GX command queue from processing incoming commands. More... | |
bool | gxCmdQueueWait (gxCmdQueue_s *queue, s64 timeout) |
Waits for a GX command queue to finish executing pending commands. More... | |
static void | gxCmdQueueSetCallback (gxCmdQueue_s *queue, void(*callback)(gxCmdQueue_s *), void *user) |
Sets the completion callback for a GX command queue. More... | |
void | GX_BindQueue (gxCmdQueue_s *queue) |
Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX. More... | |
Result | GX_RequestDma (u32 *src, u32 *dst, u32 length) |
Requests a DMA. More... | |
Result | GX_ProcessCommandList (u32 *buf0a, u32 buf0s, u8 flags) |
Processes a GPU command list. More... | |
Result | GX_MemoryFill (u32 *buf0a, u32 buf0v, u32 *buf0e, u16 control0, u32 *buf1a, u32 buf1v, u32 *buf1e, u16 control1) |
Fills the memory of two buffers with the given values. More... | |
Result | GX_DisplayTransfer (u32 *inadr, u32 indim, u32 *outadr, u32 outdim, u32 flags) |
Initiates a display transfer. More... | |
Result | GX_TextureCopy (u32 *inadr, u32 indim, u32 *outadr, u32 outdim, u32 size, u32 flags) |
Initiates a texture copy. More... | |
Result | GX_FlushCacheRegions (u32 *buf0a, u32 buf0s, u32 *buf1a, u32 buf1s, u32 *buf2a, u32 buf2s) |
Flushes the cache regions of three buffers. More... | |
GX commands.
#define GX_BUFFER_DIM | ( | w, | |
h | |||
) | (((h)<<16)|((w)&0xFFFF)) |
Creates a buffer dimension parameter from width and height values.
w | buffer width for GX_DisplayTransfer, linesize for GX_TextureCopy |
h | buffer height for GX_DisplayTransfer, gap for GX_TextureCopy |
enum GX_FILL_CONTROL |
GX transfer control flags.
enum GX_TRANSFER_FORMAT |
Supported transfer pixel formats.
enum GX_TRANSFER_SCALE |
void GX_BindQueue | ( | gxCmdQueue_s * | queue | ) |
Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.
queue | The GX command queue. (Pass NULL to remove the bound command queue) |
Initiates a display transfer.
inadr | Address of the input. |
indim | Dimensions of the input. |
outadr | Address of the output. |
outdim | Dimensions of the output. |
flags | Flags to transfer with. |
Result GX_FlushCacheRegions | ( | u32 * | buf0a, |
u32 | buf0s, | ||
u32 * | buf1a, | ||
u32 | buf1s, | ||
u32 * | buf2a, | ||
u32 | buf2s | ||
) |
Flushes the cache regions of three buffers.
(This command cannot be queued in a GX command queue)
buf0a | Address of the first buffer. |
buf0s | Size of the first buffer. |
buf1a | Address of the second buffer. |
buf1s | Size of the second buffer. |
buf2a | Address of the third buffer. |
buf2s | Size of the third buffer. |
Result GX_MemoryFill | ( | u32 * | buf0a, |
u32 | buf0v, | ||
u32 * | buf0e, | ||
u16 | control0, | ||
u32 * | buf1a, | ||
u32 | buf1v, | ||
u32 * | buf1e, | ||
u16 | control1 | ||
) |
Fills the memory of two buffers with the given values.
buf0a | Start address of the first buffer. |
buf0v | Dimensions of the first buffer. |
buf0e | End address of the first buffer. |
control0 | Value to fill the first buffer with. |
buf1a | Start address of the second buffer. |
buf1v | Dimensions of the second buffer. |
buf1e | End address of the second buffer. |
control1 | Value to fill the second buffer with. |
Processes a GPU command list.
buf0a | Command list address. |
buf0s | Command list size. |
flags | Flags to process with. |
Requests a DMA.
src | Source to DMA from. |
dst | Destination to DMA to. |
length | Length of data to transfer. |
Initiates a texture copy.
inadr | Address of the input. |
indim | Dimensions of the input. |
outadr | Address of the output. |
outdim | Dimensions of the output. |
size | Size of the data to transfer. |
flags | Flags to transfer with. |
void gxCmdQueueAdd | ( | gxCmdQueue_s * | queue, |
const gxCmdEntry_s * | entry | ||
) |
Adds a command to a GX command queue.
queue | The GX command queue. |
entry | The GX command to add. |
void gxCmdQueueClear | ( | gxCmdQueue_s * | queue | ) |
Clears a GX command queue.
queue | The GX command queue. |
void gxCmdQueueRun | ( | gxCmdQueue_s * | queue | ) |
Runs a GX command queue, causing it to begin processing incoming commands as they arrive.
queue | The GX command queue. |
|
inlinestatic |
Sets the completion callback for a GX command queue.
queue | The GX command queue. |
callback | The completion callback. |
user | User data. |
void gxCmdQueueStop | ( | gxCmdQueue_s * | queue | ) |
Stops a GX command queue from processing incoming commands.
queue | The GX command queue. |
bool gxCmdQueueWait | ( | gxCmdQueue_s * | queue, |
s64 | timeout | ||
) |
Waits for a GX command queue to finish executing pending commands.
queue | The GX command queue. |
timeout | Optional timeout (in nanoseconds) to wait (specify -1 for no timeout). |