diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-03 16:59:24 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-03 16:59:24 +1000 |
commit | 3d00c80b6b5b54da5c1ccdad9f05534a48bca39f (patch) | |
tree | bd41bcd3983463cf977cb304db252c40de477b54 /bindgen/rust/src/shader.rs | |
parent | 1b2d2f2b4ae67fb0fd10f52891eae3a6a2b24c16 (diff) |
more work o nrust bindings
Diffstat (limited to 'bindgen/rust/src/shader.rs')
-rw-r--r-- | bindgen/rust/src/shader.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bindgen/rust/src/shader.rs b/bindgen/rust/src/shader.rs new file mode 100644 index 0000000..46db1f3 --- /dev/null +++ b/bindgen/rust/src/shader.rs @@ -0,0 +1,28 @@ +use std::{ffi::c_void, path::Path}; + +use celeritas_sys::ShaderData; + +use crate::ral::{Pipeline, ShaderBinding}; + +pub struct Shader { + pipeline: Pipeline, + binding_layouts: Vec<ShaderBinding>, +} + +#[no_mangle] +pub unsafe extern "C" fn rust_function(data: *mut c_void) -> celeritas_sys::ShaderDataLayout { + todo!() +} + +impl Shader { + pub fn new(name: String, vs_path: &Path, fs_path: &Path) -> Self { + todo!() + } + pub fn add_layout(&mut self) -> &mut Self { + let sd = ShaderData { + get_layout: Some(rust_function), + data: std::ptr::null_mut(), + }; + self + } +} |