pub struct Drawer {
pub pipeline_registry: PipelineRegistry,
}
Expand description
Drawer manages graphics pipelines and processes draw commands.
The Drawer acts as the central coordinator for all graphics rendering operations, maintaining a registry of pipelines and dispatching draw commands to the appropriate pipeline implementations.
Fields§
§pipeline_registry: PipelineRegistry
Registry containing all registered graphics pipelines
Implementations§
Source§impl Drawer
impl Drawer
Sourcepub fn begin_pass(
&mut self,
gpu: &Device,
queue: &Queue,
config: &SurfaceConfiguration,
render_pass: &mut RenderPass<'_>,
)
pub fn begin_pass( &mut self, gpu: &Device, queue: &Queue, config: &SurfaceConfiguration, render_pass: &mut RenderPass<'_>, )
Initialize all pipelines at the beginning of each render pass.
This method calls the begin_pass
method on all registered pipelines,
allowing them to set up per-pass state such as uniform buffers.
Sourcepub fn end_pass(
&mut self,
gpu: &Device,
queue: &Queue,
config: &SurfaceConfiguration,
render_pass: &mut RenderPass<'_>,
)
pub fn end_pass( &mut self, gpu: &Device, queue: &Queue, config: &SurfaceConfiguration, render_pass: &mut RenderPass<'_>, )
Finalize all pipelines at the end of each render pass.
This method calls the end_pass
method on all registered pipelines,
allowing them to perform cleanup or final operations.
Sourcepub fn submit(
&mut self,
gpu: &Device,
queue: &Queue,
config: &SurfaceConfiguration,
render_pass: &mut RenderPass<'_>,
cmd: &dyn DrawCommand,
size: PxSize,
start_pos: PxPosition,
scene_texture_view: &TextureView,
)
pub fn submit( &mut self, gpu: &Device, queue: &Queue, config: &SurfaceConfiguration, render_pass: &mut RenderPass<'_>, cmd: &dyn DrawCommand, size: PxSize, start_pos: PxPosition, scene_texture_view: &TextureView, )
Submit a draw command to the appropriate pipeline for rendering.
This method dispatches the command to the correct pipeline based on its type, providing all necessary context including GPU resources, render pass, and positioning information.
§Arguments
cmd
- The draw command to executesize
- Size of the component being drawnstart_pos
- Position where drawing should beginscene_texture_view
- Optional background texture for samplingcompute_texture_view
- Compute pipeline output texture
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Drawer
impl !RefUnwindSafe for Drawer
impl !Send for Drawer
impl !Sync for Drawer
impl Unpin for Drawer
impl !UnwindSafe for Drawer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.