diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-04 10:59:34 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-04 10:59:34 +1000 |
commit | bd1687896395fb8d59a3903303ef3e57f0e57348 (patch) | |
tree | c7232969408f850745b2afb3ef000d47ec1b179a | |
parent | a837297eab7447db797198b84fde5f29f1c992ce (diff) |
rust bindings compile again
-rw-r--r-- | bindgen/rust/examples/shaders.rs | 4 | ||||
-rw-r--r-- | bindgen/rust/src/ral.rs | 7 | ||||
-rw-r--r-- | bindgen/rust/src/shader.rs | 7 |
3 files changed, 5 insertions, 13 deletions
diff --git a/bindgen/rust/examples/shaders.rs b/bindgen/rust/examples/shaders.rs index 09f13b4..ad0b35f 100644 --- a/bindgen/rust/examples/shaders.rs +++ b/bindgen/rust/examples/shaders.rs @@ -2,7 +2,7 @@ use celeritas::ral::{ ShaderBinding, ShaderBindingKind, ShaderData, ShaderDataLayout, ShaderVisibility, }; use celeritas_sys::{ - GPU_EncodeBindShaderDataRaw, GPU_GetDefaultEncoder, Mat4, ShaderVisibility_VISIBILITY_COMPUTE, + GPU_EncodeBindShaderData, GPU_GetDefaultEncoder, Mat4, ShaderVisibility_VISIBILITY_COMPUTE, ShaderVisibility_VISIBILITY_FRAGMENT, ShaderVisibility_VISIBILITY_VERTEX, }; @@ -42,7 +42,7 @@ impl ShaderData for MVP { }; unsafe { - GPU_EncodeBindShaderDataRaw(GPU_GetDefaultEncoder(), 0, layout.into_ffi_type()); + GPU_EncodeBindShaderData(GPU_GetDefaultEncoder(), 0, layout.into_ffi_type()); } } } diff --git a/bindgen/rust/src/ral.rs b/bindgen/rust/src/ral.rs index 5f1ca00..4943f9e 100644 --- a/bindgen/rust/src/ral.rs +++ b/bindgen/rust/src/ral.rs @@ -1,6 +1,6 @@ //! Wrapper around the RAL code in celeritas-core -use std::{ffi::c_void, ptr::addr_of_mut}; +use std::ffi::c_void; use celeritas_sys::{ BufferHandle, GPU_CmdEncoder, GPU_CmdEncoder_BeginRender, GPU_CmdEncoder_EndRender, @@ -52,10 +52,7 @@ impl FrameRenderEncoder { todo!() } pub fn bind<S: ShaderData>(&mut self, data: &S) { - let sd = celeritas_sys::ShaderData { - get_layout: todo!(), - data: addr_of_mut!(data) as *mut c_void, - }; + // TODO: fill ShaderDataLayout with correct data unsafe { GPU_EncodeBindShaderData(self.0, 0, todo!()) } } } diff --git a/bindgen/rust/src/shader.rs b/bindgen/rust/src/shader.rs index 46db1f3..e80e00b 100644 --- a/bindgen/rust/src/shader.rs +++ b/bindgen/rust/src/shader.rs @@ -1,7 +1,5 @@ use std::{ffi::c_void, path::Path}; -use celeritas_sys::ShaderData; - use crate::ral::{Pipeline, ShaderBinding}; pub struct Shader { @@ -19,10 +17,7 @@ impl Shader { todo!() } pub fn add_layout(&mut self) -> &mut Self { - let sd = ShaderData { - get_layout: Some(rust_function), - data: std::ptr::null_mut(), - }; + // TODO self } } |