Browse Source

Only generate citro3d-specific types/funcs, etc.

pull/10/head
Ian Chamberlain 2 years ago
parent
commit
a7690e7cdd
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 1
      citro3d-sys/Cargo.toml
  2. 19
      citro3d-sys/bindgen.sh
  3. 1295
      citro3d-sys/src/bindings.rs
  4. 2
      citro3d-sys/src/gx.rs
  5. 1
      citro3d-sys/src/texenv.rs
  6. 4
      citro3d-sys/src/uniforms.rs

1
citro3d-sys/Cargo.toml

@ -6,3 +6,4 @@ edition = "2021" @@ -6,3 +6,4 @@ edition = "2021"
[dependencies]
libc = "0.2.116"
ctru-sys = { git = "https://github.com/rust3ds/ctru-rs.git" }

19
citro3d-sys/bindgen.sh

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
set -euxo pipefail
bindgen "$DEVKITPRO/libctru/include/citro3d.h" \
bindgen "$DEVKITPRO/libctru/include/tex3ds.h" \
--rust-target nightly \
--use-core \
--distrust-clang-mangling \
@ -10,26 +10,15 @@ bindgen "$DEVKITPRO/libctru/include/citro3d.h" \ @@ -10,26 +10,15 @@ bindgen "$DEVKITPRO/libctru/include/citro3d.h" \
--ctypes-prefix "::libc" \
--no-prepend-enum-name \
--fit-macro-constant-types \
--raw-line "use ctru_sys::*;" \
--must-use-type "Result" \
--generate "functions,types,vars" \
--blocklist-type "u(8|16|32|64)" \
--opaque-type "GPU_.*" \
--opaque-type "GFX_.*" \
--opaque-type "float24Uniform_s" \
--allowlist-type "C3D_.*" \
--allowlist-type "DVLB_.*" \
--allowlist-type "shader.*" \
--allowlist-type "float24Uniform_s" \
--allowlist-function "C3D_.*" \
--allowlist-function "shader.*" \
--allowlist-function "DVLB_.*" \
--allowlist-function "linear.*" \
--allowlist-var "C3D_.*" \
--allowlist-type "GPU_.*" \
--allowlist-type "GX_.*" \
--allowlist-function 'AttrInfo_(Init|AddLoader|AddFixed)' \
--allowlist-function 'BufInfo_(Init|Add)' \
--allowlist-function 'Mtx_.*' \
--allowlist-file ".*/c3d/.*[.]h" \
--allowlist-file ".*/tex3ds[.]h" \
-- \
--target=arm-none-eabi \
--sysroot=$DEVKITARM/arm-none-eabi \

1295
citro3d-sys/src/bindings.rs

File diff suppressed because it is too large Load Diff

2
citro3d-sys/src/gx.rs

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
//! Helper functions based on `<3ds/gpu/gx.h>`.
use crate::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE};
use ctru_sys::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE};
#[inline]
pub fn GX_TRANSFER_FLIP_VERT(flip: bool) -> u32 {

1
citro3d-sys/src/texenv.rs

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
use core::ops::{BitOr, Shl};
use ctru_sys::{GPU_COMBINEFUNC, GPU_PREVIOUS, GPU_REPLACE, GPU_TEVSCALE_1, GPU_TEVSRC};
use libc::c_int;
use super::*;

4
citro3d-sys/src/uniforms.rs

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
//! Definitions from`<c3d/uniforms.h>`
use super::{C3D_FVUnif, C3D_FVUnifDirty, C3D_FVec, C3D_Mtx, GPU_SHADER_TYPE};
use ctru_sys::GPU_SHADER_TYPE;
use super::{C3D_FVUnif, C3D_FVUnifDirty, C3D_FVec, C3D_Mtx};
#[inline]
pub unsafe fn C3D_FVUnifWritePtr(

Loading…
Cancel
Save