citro3d_sys/
gx.rs

1//! Helper functions based on `<3ds/gpu/gx.h>`. Bindgen doesn't work on these
2//! function-like macros so we just reimplement them as `#[inline]` here.
3
4use ctru_sys::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE};
5
6#[inline]
7pub const fn GX_TRANSFER_FLIP_VERT(flip: bool) -> u32 {
8    flip as u32
9}
10
11#[inline]
12pub const fn GX_TRANSFER_OUT_TILED(tiled: bool) -> u32 {
13    (tiled as u32) << 1
14}
15
16#[inline]
17pub const fn GX_TRANSFER_RAW_COPY(raw_copy: bool) -> u32 {
18    (raw_copy as u32) << 3
19}
20
21#[inline]
22pub const fn GX_TRANSFER_IN_FORMAT(format: GX_TRANSFER_FORMAT) -> u32 {
23    (format as u32) << 8
24}
25
26#[inline]
27pub const fn GX_TRANSFER_OUT_FORMAT(format: GX_TRANSFER_FORMAT) -> u32 {
28    (format as u32) << 12
29}
30
31#[inline]
32pub const fn GX_TRANSFER_SCALING(scale: GX_TRANSFER_SCALE) -> u32 {
33    (scale as u32) << 24
34}