pub type WgpuBackend = WgpuSurfaceBackend;Aliased Type§
pub struct WgpuBackend {
pub surface: Option<Surface<'static>>,
pub surface_config: Option<SurfaceConfiguration<Vec<TextureFormat>>>,
pub renderer: WgpuSceneRenderer,
/* private fields */
}Fields§
§surface: Option<Surface<'static>>§surface_config: Option<SurfaceConfiguration<Vec<TextureFormat>>>§renderer: WgpuSceneRendererMethods from Deref<Target = WgpuSceneRenderer>§
pub fn set_image_from_bytes( &mut self, handle: u64, data: &[u8], srgb: bool, ) -> Result<()>
pub fn set_image_rgba8( &mut self, handle: u64, w: u32, h: u32, rgba: &[u8], srgb: bool, ) -> Result<()>
pub fn register_native_texture( &mut self, view: &TextureView, width: u32, height: u32, ) -> u64
Sourcepub fn register_native_texture_with_sampler(
&mut self,
view: &TextureView,
sampler_desc: SamplerDescriptor<'_>,
width: u32,
height: u32,
) -> u64
pub fn register_native_texture_with_sampler( &mut self, view: &TextureView, sampler_desc: SamplerDescriptor<'_>, width: u32, height: u32, ) -> u64
Like register_native_texture but with custom sampler descriptor.
Sourcepub fn update_native_texture(&mut self, handle: u64, view: &TextureView)
pub fn update_native_texture(&mut self, handle: u64, view: &TextureView)
Update an existing native texture handle with a new view (reuse handle).
pub fn set_image_nv12( &mut self, handle: u64, w: u32, h: u32, y: &[u8], uv: &[u8], color_info: ColorInfo, ) -> Result<()>
pub fn set_image_planes( &mut self, handle: u64, w: u32, h: u32, pixel_format: PixelFormat, planes: &[&[u8]], color_info: ColorInfo, ) -> Result<()>
pub fn set_image_dmabuf( &mut self, handle: u64, w: u32, h: u32, fds: Vec<OwnedFd>, modifier: u64, strides: Vec<u32>, offsets: Vec<u64>, color_info: ColorInfo, ) -> Result<()>
pub fn set_image_dmabuf_fourcc( &mut self, handle: u64, w: u32, h: u32, fds: Vec<OwnedFd>, fourcc: u32, modifier: u64, strides: Vec<u32>, offsets: Vec<u64>, color_info: ColorInfo, ) -> Result<()>
pub fn image_fourcc(&self, handle: u64) -> Option<u32>
pub fn remove_image(&mut self, handle: u64)
pub fn register_image_from_bytes(&mut self, data: &[u8], srgb: bool) -> u64
Sourcepub fn register_image_rgba8(
&mut self,
w: u32,
h: u32,
rgba: &[u8],
srgb: bool,
) -> u64
pub fn register_image_rgba8( &mut self, w: u32, h: u32, rgba: &[u8], srgb: bool, ) -> u64
Register raw RGBA8 pixels (w * h * 4 bytes) as an image, returning
its handle for SceneNode::Image. Used by CPU-rasterized overlays
(e.g. subtitle bitmap layers) that have no encoded image bytes.
Pass srgb = true for sRGB overlays composited over video.
Sourcepub fn register_coverage_a8(&mut self, w: u32, h: u32, coverage: &[u8]) -> u64
pub fn register_coverage_a8(&mut self, w: u32, h: u32, coverage: &[u8]) -> u64
Register an 8-bit coverage tile (w * h bytes, 0 = empty, 255 =
fully covered) for SceneNode::Coverage, returning its handle.
Coverage tiles are immutable: re-register on geometry change and
remove_coverage handles you no longer emit (stale tiles also age
out under the image eviction policy).
Sourcepub fn remove_coverage(&mut self, handle: u64)
pub fn remove_coverage(&mut self, handle: u64)
Remove a coverage tile registered with register_coverage_a8.
Sourcepub fn coverage_dimensions(&mut self, handle: u64) -> Option<(u32, u32)>
pub fn coverage_dimensions(&mut self, handle: u64) -> Option<(u32, u32)>
Tile dimensions, marking the handle used (keeps it alive under the
eviction policy). Returns None for unknown handles.
Sourcepub fn set_pixels_per_point(&mut self, ppp: f32)
pub fn set_pixels_per_point(&mut self, ppp: f32)
Set pixels per point (DPI scale) for callback ScreenDescriptor / PaintCallbackInfo.
Sourcepub fn set_working_space(&mut self, enabled: bool)
pub fn set_working_space(&mut self, enabled: bool)
Enable or disable linear working-space rendering. When enabled, the scene is rendered into an Rgba16Float intermediate and a final full-screen pass applies the display OETF.
Sourcepub fn resize(&mut self, width: u32, height: u32)
pub fn resize(&mut self, width: u32, height: u32)
Resize the render target dimensions.
Recreates MSAA, depth-stencil, and working-space textures to match the new size..
pub fn begin_frame(&mut self) -> Result<()>
pub fn end_frame(&mut self)
pub fn last_render_error(&self) -> Option<&str>
pub fn render_scene_to_encoder( &mut self, scene: &Scene, encoder: &mut CommandEncoder, target_view: &TextureView, clear_color_override: Option<[f64; 4]>, )
Sourcepub fn render_scene_to_encoder_with_texture(
&mut self,
scene: &Scene,
encoder: &mut CommandEncoder,
target_view: &TextureView,
target_texture: Option<&Texture>,
clear_color_override: Option<[f64; 4]>,
)
pub fn render_scene_to_encoder_with_texture( &mut self, scene: &Scene, encoder: &mut CommandEncoder, target_view: &TextureView, target_texture: Option<&Texture>, clear_color_override: Option<[f64; 4]>, )
Same as render_scene_to_encoder,
plus the render target texture for isolated-blend backdrop snapshots.
Pass None when the texture is unavailable (swapchain views); then
surface-targeted isolated blends are skipped (the isolated source
layer composites nowhere, so the mesh disappears).
Sourcepub fn render_to_view(
&mut self,
scene: &Scene,
encoder: &mut CommandEncoder,
target_view: &TextureView,
width: u32,
height: u32,
clear_color: Option<[f64; 4]>,
)
pub fn render_to_view( &mut self, scene: &Scene, encoder: &mut CommandEncoder, target_view: &TextureView, width: u32, height: u32, clear_color: Option<[f64; 4]>, )
Render a scene into an externally-provided texture view. Use this when embedding Repose in a host that owns the GPU. The host is responsible for submitting the encoder and handling present.