Skip to main content

Module render_device

Module render_device 

Source
Expand description

Implement a custom GPU backend for Noesis by writing a Rust Noesis::RenderDevice.

Reach for this module when you want Noesis to render through your own graphics API instead of a bundled backend: implement the RenderDevice trait, then hand it to register to wire it up across the C ABI.

The pieces, in dependency order:

  • types: #[repr(C)] mirrors of the public Noesis types in Include/NsRender/RenderDevice.h. These are the ABI surface and their layouts are checked against the C++ headers at compile time.
  • device: the RenderDevice trait your device impl satisfies, plus its handle / desc / binding plain-data types.
  • [ffi]: Rust mirrors of the C ABI types in cpp/noesis_shim.h, plus the extern "C" declarations for the factory and helpers.
  • [vtable]: the extern "C" trampolines and the register entry point that owns the boxed impl and the C++ RustRenderDevice handle.

Re-exports§

pub use device::RenderDevice;
pub use device::RenderTargetBinding;
pub use device::RenderTargetDesc;
pub use device::RenderTargetHandle;
pub use device::TextureBinding;
pub use device::TextureDesc;
pub use device::TextureHandle;
pub use device::TextureRect;

Modules§

device
The RenderDevice trait that Rust-side device implementations satisfy, plus the handle / desc / binding plain-data types that flow through it.
types
Mirrors of the public Noesis types in Include/NsRender/RenderDevice.h.

Structs§

Registered
Owns a Rust RenderDevice impl together with its C++ RustRenderDevice instance. Dropping releases the _create reference; the boxed impl is freed by the drop_userdata callback from ~RustRenderDevice once Noesis drops its last reference, so every callback (including any issued after this guard drops) sees a live trait object.

Functions§

register
Construct a C++ RustRenderDevice backed by the given Rust impl. Returns a Registered guard that owns both halves; drop it to tear everything down.