pub trait GpuRenderer: SceneRenderer {
type Device;
// Required method
fn device(&self) -> Option<Self::Device>;
}Expand description
A renderer that owns a device a producer can make resources on.
The engine’s SceneRenderer is GPU-agnostic and names no device, but a producer that must make
a texture on the window’s GPU has to reach the concrete device the renderer drew with — the
same-device rule seen from the renderer’s side. A renderer that owns one implements this; a
renderer that has none to lend — a discard or capture-only one — simply does not, and is then
absent from this door rather than answering it with a placeholder.
Device is the backend’s own handle — an ID3D11Device, a metal::Device, a
wgpu context — so this trait adds no dependency on any GPU driver: only an implementor names one.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".