Fenrir
8 years ago
4 changed files with 186 additions and 246 deletions
@ -1,26 +1,27 @@
@@ -1,26 +1,27 @@
|
||||
/* automatically generated by rust-bindgen */ |
||||
|
||||
#[inline] |
||||
pub fn GPUCMD_HEADER(incremental: u32, mask: u32, reg: u32) -> u32{ |
||||
(((incremental)<<31)|(((mask)&0xF)<<16)|((reg)&0x3FF)) |
||||
#![allow(dead_code,
|
||||
non_camel_case_types, |
||||
non_upper_case_globals, |
||||
non_snake_case)] |
||||
extern "C" { |
||||
pub static mut gpuCmdBuf: *mut u32_; |
||||
pub static mut gpuCmdBufSize: u32_; |
||||
pub static mut gpuCmdBufOffset: u32_; |
||||
} |
||||
|
||||
extern "C" { |
||||
pub static mut gpuCmdBuf: *mut u32; |
||||
pub static mut gpuCmdBufSize: u32; |
||||
pub static mut gpuCmdBufOffset: u32; |
||||
|
||||
pub fn GPUCMD_SetBuffer(adr: *mut u32, size: u32, offset: u32); |
||||
pub fn GPUCMD_SetBufferOffset(offset: u32); |
||||
pub fn GPUCMD_GetBuffer(adr: *mut *mut u32, size: *mut u32, |
||||
offset: *mut u32); |
||||
pub fn GPUCMD_AddRawCommands(cmd: *mut u32, size: u32); |
||||
pub fn GPUCMD_SetBuffer(adr: *mut u32_, size: u32_, offset: u32_); |
||||
pub fn GPUCMD_SetBufferOffset(offset: u32_); |
||||
pub fn GPUCMD_GetBuffer(adr: *mut *mut u32_, size: *mut u32_, |
||||
offset: *mut u32_); |
||||
pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_); |
||||
pub fn GPUCMD_Run(); |
||||
pub fn GPUCMD_FlushAndRun(); |
||||
pub fn GPUCMD_Add(header: u32, param: *mut u32, paramlength: u32); |
||||
pub fn GPUCMD_Add(header: u32_, param: *const u32_, paramlength: u32_); |
||||
pub fn GPUCMD_Finalize(); |
||||
pub fn f32tof16(f: f32) -> u32; |
||||
pub fn f32tof20(f: f32) -> u32; |
||||
pub fn f32tof24(f: f32) -> u32; |
||||
pub fn f32tof31(f: f32) -> u32;
|
||||
pub fn f32tof16(f: f32) -> u32_; |
||||
pub fn f32tof20(f: f32) -> u32_; |
||||
pub fn f32tof24(f: f32) -> u32_; |
||||
pub fn f32tof31(f: f32) -> u32_; |
||||
} |
||||
use ::types::*; |
||||
|
@ -1,94 +1,55 @@
@@ -1,94 +1,55 @@
|
||||
use ::Result; |
||||
|
||||
#[inline] |
||||
pub fn GX_BUFFER_DIM(w: u32, h: u32) { |
||||
(((h)<<16)|((w)&0xFFFF)); |
||||
} |
||||
|
||||
#[repr(C)] |
||||
pub enum GX_TRANSFER_FORMAT |
||||
{ |
||||
/* automatically generated by rust-bindgen */ |
||||
|
||||
#![allow(dead_code,
|
||||
non_camel_case_types, |
||||
non_upper_case_globals, |
||||
non_snake_case)] |
||||
#[derive(Copy, Clone)] |
||||
#[repr(u32)] |
||||
#[derive(Debug)] |
||||
pub 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, |
||||
} |
||||
|
||||
#[repr(C)] |
||||
pub enum GX_TRANSFER_SCALE |
||||
{ |
||||
#[derive(Copy, Clone)] |
||||
#[repr(u32)] |
||||
#[derive(Debug)] |
||||
pub enum GX_TRANSFER_SCALE { |
||||
GX_TRANSFER_SCALE_NO = 0, |
||||
GX_TRANSFER_SCALE_X = 1, |
||||
GX_TRANSFER_SCALE_Y = 2, |
||||
GX_TRANSFER_SCALE_XY = 2, |
||||
} |
||||
|
||||
#[repr(C)] |
||||
#[derive(Copy, Clone)] |
||||
#[repr(u32)] |
||||
#[derive(Debug)] |
||||
pub 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, |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_FLIP_VERT(x: i32) { |
||||
((x)<<0); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_OUT_TILED(x: i32) { |
||||
((x)<<1); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_RAW_COPY(x: i32) { |
||||
((x)<<3); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_IN_FORMAT(x: i32) { |
||||
((x)<<8); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_OUT_FORMAT(x: i32) { |
||||
((x)<<12); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_SCALING(x: i32) { |
||||
((x)<<24); |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_CMDLIST_BIT0() { |
||||
(1u32<<(0)); |
||||
GX_FILL_TRIGGER = 1, |
||||
GX_FILL_FINISHED = 2, |
||||
GX_FILL_16BIT_DEPTH = 0, |
||||
GX_FILL_24BIT_DEPTH = 256, |
||||
GX_FILL_32BIT_DEPTH = 512, |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_CMNDLIST_FLUSH() { |
||||
(1u32<<(1)); |
||||
extern "C" { |
||||
pub static mut gxCmdBuf: *mut u32_; |
||||
} |
||||
|
||||
extern "C" { |
||||
pub static mut gxCmdBuf: *mut u32; |
||||
|
||||
pub fn GX_RequestDma(src: *mut u32, dst: *mut u32, length: u32) |
||||
pub fn GX_RequestDma(src: *mut u32_, dst: *mut u32_, length: u32_) |
||||
-> Result; |
||||
pub fn GX_ProcessCommandList(buf0a: *mut u32, buf0s: u32, flags: u8) |
||||
pub fn GX_ProcessCommandList(buf0a: *mut u32_, buf0s: u32_, flags: u8_) |
||||
-> Result; |
||||
pub fn GX_MemoryFill(buf0a: *mut u32, buf0v: u32, buf0e: *mut u32, |
||||
control0: u16, buf1a: *mut u32, buf1v: u32, |
||||
buf1e: *mut u32, control1: u16) -> Result; |
||||
pub fn GX_DisplayTransfer(inadr: *mut u32, indim: u32, |
||||
outadr: *mut u32, outdim: u32, flags: u32) |
||||
pub fn GX_MemoryFill(buf0a: *mut u32_, buf0v: u32_, buf0e: *mut u32_, |
||||
control0: u16_, buf1a: *mut u32_, buf1v: u32_, |
||||
buf1e: *mut u32_, control1: u16_) -> Result; |
||||
pub fn GX_DisplayTransfer(inadr: *mut u32_, indim: u32_, |
||||
outadr: *mut u32_, outdim: u32_, flags: u32_) |
||||
-> Result; |
||||
pub fn GX_TextureCopy(inadr: *mut u32, indim: u32, outadr: *mut u32, |
||||
outdim: u32, size: u32, flags: u32) -> Result; |
||||
pub fn GX_FlushCacheRegions(buf0a: *mut u32, buf0s: u32, |
||||
buf1a: *mut u32, buf1s: u32, |
||||
buf2a: *mut u32, buf2s: u32) -> Result; |
||||
pub fn GX_TextureCopy(inadr: *mut u32_, indim: u32_, outadr: *mut u32_, |
||||
outdim: u32_, size: u32_, flags: u32_) -> Result; |
||||
pub fn GX_FlushCacheRegions(buf0a: *mut u32_, buf0s: u32_, |
||||
buf1a: *mut u32_, buf1s: u32_, |
||||
buf2a: *mut u32_, buf2s: u32_) -> Result; |
||||
} |
||||
|
||||
use ::types::*; |
||||
|
@ -1,88 +1,68 @@
@@ -1,88 +1,68 @@
|
||||
use ::types::*; |
||||
use gpu::shbin::*; |
||||
|
||||
/* automatically generated by rust-bindgen */ |
||||
|
||||
#![allow(dead_code,
|
||||
non_camel_case_types, |
||||
non_upper_case_globals, |
||||
non_snake_case)] |
||||
#[repr(C)] |
||||
#[derive(Copy)] |
||||
pub struct Struct_Unnamed1 { |
||||
pub id: u32, |
||||
pub data: [u32; 3usize], |
||||
} |
||||
impl ::core::clone::Clone for Struct_Unnamed1 { |
||||
fn clone(&self) -> Self { *self } |
||||
#[derive(Copy, Clone)] |
||||
#[derive(Debug)] |
||||
pub struct float24Uniform_s { |
||||
pub id: u32_, |
||||
pub data: [u32_; 3usize], |
||||
} |
||||
impl ::core::default::Default for Struct_Unnamed1 { |
||||
impl ::core::default::Default for float24Uniform_s { |
||||
fn default() -> Self { unsafe { ::core::mem::zeroed() } } |
||||
} |
||||
pub type float24Uniform_s = Struct_Unnamed1; |
||||
#[repr(C)] |
||||
#[derive(Copy)] |
||||
pub struct Struct_Unnamed2 { |
||||
#[derive(Copy, Clone)] |
||||
#[derive(Debug)] |
||||
pub struct shaderInstance_s { |
||||
pub dvle: *mut DVLE_s, |
||||
pub boolUniforms: u16, |
||||
pub boolUniformMask: u16, |
||||
pub intUniforms: [u32; 4usize], |
||||
pub boolUniforms: u16_, |
||||
pub boolUniformMask: u16_, |
||||
pub intUniforms: [u32_; 4usize], |
||||
pub float24Uniforms: *mut float24Uniform_s, |
||||
pub intUniformMask: u8, |
||||
pub numFloat24Uniforms: u8, |
||||
pub intUniformMask: u8_, |
||||
pub numFloat24Uniforms: u8_, |
||||
} |
||||
impl ::core::clone::Clone for Struct_Unnamed2 { |
||||
fn clone(&self) -> Self { *self } |
||||
} |
||||
impl ::core::default::Default for Struct_Unnamed2 { |
||||
impl ::core::default::Default for shaderInstance_s { |
||||
fn default() -> Self { unsafe { ::core::mem::zeroed() } } |
||||
} |
||||
pub type shaderInstance_s = Struct_Unnamed2; |
||||
#[repr(C)] |
||||
#[derive(Copy)] |
||||
pub struct Struct_Unnamed3 { |
||||
#[derive(Copy, Clone)] |
||||
#[derive(Debug)] |
||||
pub struct shaderProgram_s { |
||||
pub vertexShader: *mut shaderInstance_s, |
||||
pub geometryShader: *mut shaderInstance_s, |
||||
pub geoShaderInputPermutation: [u32; 2usize], |
||||
pub geoShaderInputStride: u8, |
||||
pub geoShaderMode: u8, |
||||
} |
||||
impl ::core::clone::Clone for Struct_Unnamed3 { |
||||
fn clone(&self) -> Self { *self } |
||||
pub geoShaderInputPermutation: [u32_; 2usize], |
||||
pub geoShaderInputStride: u8_, |
||||
} |
||||
impl ::core::default::Default for Struct_Unnamed3 { |
||||
impl ::core::default::Default for shaderProgram_s { |
||||
fn default() -> Self { unsafe { ::core::mem::zeroed() } } |
||||
} |
||||
pub type shaderProgram_s = Struct_Unnamed3; |
||||
#[derive(Clone, Copy)] |
||||
#[repr(u32)] |
||||
pub enum Enum_Unnamed4 { |
||||
GSH_NORMAL = 0, |
||||
GSH_PARTICLE = 1, |
||||
GSH_SUBDIVISION_LOOP = 2, |
||||
GSH_SUBDIVISION_CATMULL_CLARK = 3, |
||||
} |
||||
pub type geoShaderMode = Enum_Unnamed4; |
||||
extern "C" { |
||||
pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) |
||||
-> Result; |
||||
pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; |
||||
pub fn shaderInstanceSetBool(si: *mut shaderInstance_s, |
||||
id: i32, value: u8) |
||||
-> Result; |
||||
pub fn shaderInstanceGetBool(si: *mut shaderInstance_s, |
||||
id: i32, value: *mut u8) |
||||
-> Result; |
||||
pub fn shaderInstanceSetBool(si: *mut shaderInstance_s, id: ::libc::c_int, |
||||
value: u8) -> Result; |
||||
pub fn shaderInstanceGetBool(si: *mut shaderInstance_s, id: ::libc::c_int, |
||||
value: *mut u8) -> Result; |
||||
pub fn shaderInstanceGetUniformLocation(si: *mut shaderInstance_s, |
||||
name: |
||||
*const u8) |
||||
name: *const ::libc::c_char) |
||||
-> s8; |
||||
pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; |
||||
pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; |
||||
pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) |
||||
-> Result; |
||||
pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, |
||||
stride: u8) -> Result; |
||||
stride: u8_) -> Result; |
||||
pub fn shaderProgramSetGshInputPermutation(sp: *mut shaderProgram_s, |
||||
permutation: u64) -> Result; |
||||
pub fn shaderProgramSetGshMode(sp: *mut shaderProgram_s, |
||||
mode: geoShaderMode) -> Result; |
||||
permutation: u64_) -> Result; |
||||
pub fn shaderProgramConfigure(sp: *mut shaderProgram_s, sendVshCode: u8, |
||||
sendGshCode: u8) -> Result; |
||||
pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; |
||||
} |
||||
use ::types::*; |
||||
use super::shbin::*; |
||||
|
Loading…
Reference in new issue