pub struct FrameComposer<'frame> { /* private fields */ }Expand description
One bounded, stably ordered surface frame under construction.
Calling FrameComposer::present performs all fallible geometry and
ownership validation before acquiring the surface. A successful frame uses
one clear, one command encoder, one queue submission, and one present.
Implementations§
Source§impl<'frame> FrameComposer<'frame>
impl<'frame> FrameComposer<'frame>
Sourcepub fn draw_scene(
&mut self,
scene: &'frame Scene,
camera: Camera2d,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_scene( &mut self, scene: &'frame Scene, camera: Camera2d, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds a streaming world-space scene through its own camera.
Sourcepub fn draw_screen_scene(
&mut self,
scene: &'frame ScreenScene,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_screen_scene( &mut self, scene: &'frame ScreenScene, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds a streaming logical-screen scene unaffected by world cameras.
Sourcepub fn draw_prepared_scene(
&mut self,
scene: &'frame PreparedScene,
camera: Camera2d,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_prepared_scene( &mut self, scene: &'frame PreparedScene, camera: Camera2d, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds immutable prepared world-space geometry through its own camera.
Sourcepub fn draw_prepared_screen_scene(
&mut self,
scene: &'frame PreparedScreenScene,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_prepared_screen_scene( &mut self, scene: &'frame PreparedScreenScene, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds immutable prepared logical-screen geometry.
Sourcepub fn draw_dynamic_mesh(
&mut self,
mesh: &'frame DynamicMesh2d,
camera: Camera2d,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_dynamic_mesh( &mut self, mesh: &'frame DynamicMesh2d, camera: Camera2d, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds retained dynamic triangles through their own world camera.
Camera-dependent topology is validated by FrameComposer::present,
which rejects triangles crossing the full target clip volume or having
an ambiguous projected orientation. Item viewport/scissor clipping is
axis-aligned fragment clipping and remains supported.
Sourcepub fn draw_particle_field(
&mut self,
field: &'frame mut ParticleField2d,
camera: Camera2d,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_particle_field( &mut self, field: &'frame mut ParticleField2d, camera: Camera2d, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds a budgeted instanced particle field through its own world camera.
Sourcepub fn draw_scalar_field(
&mut self,
texture: &'frame ScalarFieldTexture,
color_map: &'frame ColorMap,
(minimum, maximum): (f32, f32),
sampling: ScalarFieldSampling,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_scalar_field( &mut self, texture: &'frame ScalarFieldTexture, color_map: &'frame ColorMap, (minimum, maximum): (f32, f32), sampling: ScalarFieldSampling, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds a retained scalar heatmap scaled into the optional viewport.
Sourcepub fn draw_image(
&mut self,
image: &'frame Image2d,
source: Option<ImageTexelRect>,
tint: Color,
sampling: ImageSampling,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_image( &mut self, image: &'frame Image2d, source: Option<ImageTexelRect>, tint: Color, sampling: ImageSampling, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds one image or atlas region scaled into the optional viewport.
With no viewport the image covers the complete logical surface. tint
is normalized straight linear RGBA and multiplies decoded image color.
Sourcepub fn draw_world_image(
&mut self,
image: &'frame Image2d,
source: Option<ImageTexelRect>,
rectangle: Rect,
depth: f32,
camera: Camera2d,
tint: Color,
sampling: ImageSampling,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_world_image( &mut self, image: &'frame Image2d, source: Option<ImageTexelRect>, rectangle: Rect, depth: f32, camera: Camera2d, tint: Color, sampling: ImageSampling, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds one image or atlas region on an axis-aligned world-space rectangle.
The rectangle follows the supplied camera’s zoom, rotation, and pseudo-depth projection. Its UV top edge maps to the rectangle’s maximum world Y edge. The optional frame viewport selects the camera viewport and the item remains constrained by that viewport and clip.
Sourcepub fn draw_image_batch(
&mut self,
image: &'frame Image2d,
batch: &'frame ImageBatch2d,
sampling: ImageSampling,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_image_batch( &mut self, image: &'frame Image2d, batch: &'frame ImageBatch2d, sampling: ImageSampling, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds a retained atlas batch as one instanced draw when non-empty. Empty batches are valid frame items and emit no draw call.
Sourcepub fn draw_glyph_run(
&mut self,
atlas: &'frame GlyphAtlas2d,
run: &'frame GlyphRun2d,
sampling: ImageSampling,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_glyph_run( &mut self, atlas: &'frame GlyphAtlas2d, run: &'frame GlyphRun2d, sampling: ImageSampling, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds one host-shaped retained glyph run as one instanced draw when non-empty.
Positions are local logical pixels. Mixed font fallback is represented by multiple runs submitted at the same order; stable insertion order is preserved between them. An empty run is valid and emits no draw call.
Sourcepub fn draw_render_target(
&mut self,
target: &'frame RenderTarget2d,
blend_mode: BlendMode,
opacity: f32,
options: FramePassOptions,
) -> Result<(), FrameComposerError>
pub fn draw_render_target( &mut self, target: &'frame RenderTarget2d, blend_mode: BlendMode, opacity: f32, options: FramePassOptions, ) -> Result<(), FrameComposerError>
Adds an offscreen target, scaled into the optional logical viewport.
Sourcepub const fn planned_statistics(&self) -> FrameStatistics
pub const fn planned_statistics(&self) -> FrameStatistics
Returns conservative work accepted so far without presenting it.
Sourcepub fn present(self) -> Result<FrameReport, FrameComposerError>
pub fn present(self) -> Result<FrameReport, FrameComposerError>
Validates, orders, encodes, submits, and presents the complete frame.