pub struct WgpuRenderer { /* private fields */ }Expand description
Renderer runtime sharing one explicit spatialrust-gpu wgpu device.
Implementations§
Source§impl WgpuRenderer
impl WgpuRenderer
Sourcepub fn render_headless(
&self,
geometry: &GpuGeometry,
options: &RenderOptions,
) -> RenderResult<HeadlessRender>
pub fn render_headless( &self, geometry: &GpuGeometry, options: &RenderOptions, ) -> RenderResult<HeadlessRender>
Renders uploaded geometry into device-resident color and depth textures.
The method never reads the target back to the host. Its only host/device crossing is the returned, byte-accounted uniform upload.
Sourcepub fn initialized_render_pipeline_count(&self) -> usize
pub fn initialized_render_pipeline_count(&self) -> usize
Number of initialized render-pipeline variants.
Sourcepub fn readback_rgba(
&self,
target: &GpuRenderTarget,
) -> RenderResult<ReadbackImage>
pub fn readback_rgba( &self, target: &GpuRenderTarget, ) -> RenderResult<ReadbackImage>
Explicitly reads one device-resident target into tightly packed RGBA8.
Sourcepub fn pick_point(
&self,
target: &GpuRenderTarget,
x: u32,
y: u32,
) -> RenderResult<PickResult>
pub fn pick_point( &self, target: &GpuRenderTarget, x: u32, y: u32, ) -> RenderResult<PickResult>
Explicitly reads the point ID at one target pixel.
Source§impl WgpuRenderer
impl WgpuRenderer
Sourcepub fn new(runtime: Arc<WgpuRuntime>) -> Self
pub fn new(runtime: Arc<WgpuRuntime>) -> Self
Creates a renderer on a caller-selected wgpu runtime.
Sourcepub const fn device_identity(&self) -> &DeviceIdentity
pub const fn device_identity(&self) -> &DeviceIdentity
Identity of this exact renderer runtime.
Sourcepub fn cached_buffer_count(&self) -> usize
pub fn cached_buffer_count(&self) -> usize
Number of buffers currently retained for reuse.
Sourcepub fn upload(
&self,
primitive: VisualPrimitive<'_>,
) -> RenderResult<(GpuGeometry, TransferReceipt)>
pub fn upload( &self, primitive: VisualPrimitive<'_>, ) -> RenderResult<(GpuGeometry, TransferReceipt)>
Explicitly uploads one borrowed visual primitive.
Structure-of-arrays positions are packed into a vertex buffer as part of this named operation. The returned receipt records every host/device crossing and its exact logical byte count.