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 inInclude/NsRender/RenderDevice.h. These are the ABI surface and their layouts are checked against the C++ headers at compile time.device: theRenderDevicetrait your device impl satisfies, plus its handle / desc / binding plain-data types.- [
ffi]: Rust mirrors of the C ABI types incpp/noesis_shim.h, plus theextern "C"declarations for the factory and helpers. - [
vtable]: theextern "C"trampolines and theregisterentry point that owns the boxed impl and the C++RustRenderDevicehandle.
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
RenderDevicetrait 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
RenderDeviceimpl together with its C++RustRenderDeviceinstance. Dropping releases the_createreference; the boxed impl is freed by thedrop_userdatacallback from~RustRenderDeviceonce 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++
RustRenderDevicebacked by the given Rust impl. Returns aRegisteredguard that owns both halves; drop it to tear everything down.