From ab2b4b960b06e40bfb7afe2ae30b925c2196b917 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:44:06 +1000 Subject: fmt --- bindgen/rust/Cargo.toml | 2 +- bindgen/rust/celeritas-sys/src/lib.rs | 2 +- bindgen/rust/src/lib.rs | 2 +- bindgen/rust/src/prelude.rs | 6 +++--- bindgen/rust/src/ral.rs | 23 +++++++++++++---------- 5 files changed, 19 insertions(+), 16 deletions(-) (limited to 'bindgen') diff --git a/bindgen/rust/Cargo.toml b/bindgen/rust/Cargo.toml index 8f9da64..4ca1432 100644 --- a/bindgen/rust/Cargo.toml +++ b/bindgen/rust/Cargo.toml @@ -10,4 +10,4 @@ serde_json = "1.0.120" egui = "0.27.1" egui_glfw = { git = "https://github.com/omnisci3nce/egui_glfw.git", rev = "67b432695433feb59761f3ae984b966ca3da31db" } -gl = "0.14.0" \ No newline at end of file +gl = "0.14.0" diff --git a/bindgen/rust/celeritas-sys/src/lib.rs b/bindgen/rust/celeritas-sys/src/lib.rs index 3a96f59..676e7c2 100644 --- a/bindgen/rust/celeritas-sys/src/lib.rs +++ b/bindgen/rust/celeritas-sys/src/lib.rs @@ -4,4 +4,4 @@ use serde::{Deserialize, Serialize}; -include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +include!(concat!(env!("OUT_DIR"), "/bindings.rs")); \ No newline at end of file diff --git a/bindgen/rust/src/lib.rs b/bindgen/rust/src/lib.rs index cfb999c..f65b031 100644 --- a/bindgen/rust/src/lib.rs +++ b/bindgen/rust/src/lib.rs @@ -63,4 +63,4 @@ pub enum Light { Point(ffi::PointLight), Directional(ffi::DirectionalLight), // Spot(ffi::Spotlight) -} \ No newline at end of file +} diff --git a/bindgen/rust/src/prelude.rs b/bindgen/rust/src/prelude.rs index c81fbe0..b78f364 100644 --- a/bindgen/rust/src/prelude.rs +++ b/bindgen/rust/src/prelude.rs @@ -6,10 +6,10 @@ pub use celeritas_sys::Vec4; // --- handles pub use celeritas_sys::BufferHandle; -pub use celeritas_sys::TextureHandle; -pub use celeritas_sys::MeshHandle; pub use celeritas_sys::MaterialHandle; +pub use celeritas_sys::MeshHandle; pub use celeritas_sys::ModelHandle; pub use celeritas_sys::PipelineHandle; +pub use celeritas_sys::PipelineLayoutHandle; pub use celeritas_sys::RenderpassHandle; -pub use celeritas_sys::PipelineLayoutHandle; \ No newline at end of file +pub use celeritas_sys::TextureHandle; diff --git a/bindgen/rust/src/ral.rs b/bindgen/rust/src/ral.rs index 5568954..775335a 100644 --- a/bindgen/rust/src/ral.rs +++ b/bindgen/rust/src/ral.rs @@ -1,7 +1,8 @@ //! Wrapper around the RAL code in celeritas-core use celeritas_sys::{ - BufferHandle, GPU_CmdEncoder, GPU_CmdEncoder_BeginRender, GPU_CmdEncoder_EndRender, GPU_GetDefaultEncoder + BufferHandle, GPU_CmdEncoder, GPU_CmdEncoder_BeginRender, GPU_CmdEncoder_EndRender, + GPU_GetDefaultEncoder, }; pub struct FrameRenderEncoder(*mut GPU_CmdEncoder); @@ -30,13 +31,13 @@ impl Drop for FrameRenderEncoder { impl FrameRenderEncoder { pub fn set_vertex_buffer(&self, buf: BufferHandle) { - // TODO: Get buffer ptr from handle - // TODO: assert that buffer type is vertex + // TODO: Get buffer ptr from handle + // TODO: assert that buffer type is vertex todo!() } pub fn set_index_buffer(&self, buf: BufferHandle) { - // TODO: Get buffer ptr from handle - // TODO: assert that buffer type is index + // TODO: Get buffer ptr from handle + // TODO: assert that buffer type is index todo!() } } @@ -52,10 +53,12 @@ pub enum PrimitiveTopology { impl From for PrimitiveTopology { fn from(value: celeritas_sys::PrimitiveTopology) -> Self { match value { - celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_POINT => PrimitiveTopology::Point, - celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_LINE => PrimitiveTopology::Line, - celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_TRIANGLE => PrimitiveTopology::Triangle, - _ => unreachable!("enum conversion should be infallible") + celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_POINT => PrimitiveTopology::Point, + celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_LINE => PrimitiveTopology::Line, + celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_TRIANGLE => { + PrimitiveTopology::Triangle + } + _ => unreachable!("enum conversion should be infallible"), } } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2