pub struct RenderCore { /* private fields */ }Expand description
Render core holding device, surface, pipelines, and frame resources.
Implementations§
Source§impl RenderCore
impl RenderCore
Sourcepub fn read_offscreen_rgba(&self) -> Result<Vec<u8>, OffscreenReadbackError>
pub fn read_offscreen_rgba(&self) -> Result<Vec<u8>, OffscreenReadbackError>
Reads the last offscreen-rendered frame back as tightly packed RGBA8 pixels in row-major order with a top-left origin.
The returned buffer has width * height * 4 bytes and no row padding.
RGBA8 presentation bytes are sRGB-encoded even when the output texture
uses a non-sRGB format, matching PNG and most image consumers.
Source§impl RenderCore
impl RenderCore
Sourcepub fn resources(&self) -> RenderResources<'_>
pub fn resources(&self) -> RenderResources<'_>
Returns shared GPU resources used for pipeline creation.
Sourcepub fn window(&self) -> &Window
pub fn window(&self) -> &Window
Returns the current window handle.
Panics if this core was created for offscreen rendering; check
RenderCore::has_surface first.
Sourcepub fn window_arc(&self) -> Arc<Window> ⓘ
pub fn window_arc(&self) -> Arc<Window> ⓘ
Returns a cloned window handle for external storage.
Panics if this core was created for offscreen rendering.
Sourcepub fn has_surface(&self) -> bool
pub fn has_surface(&self) -> bool
Returns whether this core renders into a window surface.
Offscreen cores return false.
Sourcepub fn surface_config(&self) -> &SurfaceConfiguration
pub fn surface_config(&self) -> &SurfaceConfiguration
Returns the current surface configuration.
Sourcepub fn pipeline_cache(&self) -> Option<&PipelineCache>
pub fn pipeline_cache(&self) -> Option<&PipelineCache>
Returns the pipeline cache if available.
Sourcepub fn sample_count(&self) -> u32
pub fn sample_count(&self) -> u32
Returns the configured MSAA sample count.
Sourcepub fn register_draw_pipeline<T, P>(&mut self, pipeline: P)where
T: DrawCommand + 'static,
P: DrawablePipeline<T> + 'static,
pub fn register_draw_pipeline<T, P>(&mut self, pipeline: P)where
T: DrawCommand + 'static,
P: DrawablePipeline<T> + 'static,
Registers a new drawable pipeline for a specific command type.
Sourcepub fn register_compute_pipeline<T, P>(&mut self, pipeline: P)where
T: ComputeCommand + 'static,
P: ComputablePipeline<T> + 'static,
pub fn register_compute_pipeline<T, P>(&mut self, pipeline: P)where
T: ComputeCommand + 'static,
P: ComputablePipeline<T> + 'static,
Registers a new compute pipeline for a specific command type.
Auto Trait Implementations§
impl !Freeze for RenderCore
impl !RefUnwindSafe for RenderCore
impl !Send for RenderCore
impl !Sync for RenderCore
impl !UnwindSafe for RenderCore
impl Unpin for RenderCore
impl UnsafeUnpin for RenderCore
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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.