Skip to main content

Frame

Struct Frame 

Source
pub struct Frame {
    pub gpu: Gpu,
    pub targets: FrameTargets,
    /* private fields */
}

Fields§

§gpu: Gpu§targets: FrameTargets

Implementations§

Source§

impl Frame

Source

pub fn new(gpu: Gpu, width: u32, height: u32) -> Result<Self, String>

Source

pub fn set_shadows(&mut self, shadows: &Shadows, fit: &Fit)

Source

pub fn set_probe_corner_floor(&self, floor: f32) -> Result<(), String>

Source

pub fn probe_corner_floor(&self) -> f32

Source

pub fn set_reflection_occlusion(&mut self, threshold: f32) -> Result<(), String>

Source

pub fn set_sky_visibility(&mut self, on: bool)

Source

pub fn set_opaque_on(&self, on: OpaqueFeatures)

Source

pub fn set_opaque_off(&self, off: OpaqueFeatures)

Source

pub fn warm_opaque(&mut self, features: OpaqueFeatures, lit: bool)

Source

pub fn warm(&mut self, first: &[OpaqueKey], later: &[OpaqueKey]) -> Warming

Source

pub fn set_warm_workers(&mut self, workers: usize)

Source

pub fn opaque_pipelines(&self) -> Vec<OpaqueKey>

Source

pub fn opaque_made_on_render_thread(&self) -> usize

Source

pub fn use_pipeline_cache(&mut self, path: &Path) -> CacheLoad

Source

pub fn save_pipeline_cache(&self) -> Result<Option<usize>, String>

Source

pub fn set_reflections_planned(&mut self, planned: bool)

Source

pub fn opaque_keys( &self, scene: &Scene<'_>, shadows: Option<(&Shadows, &Fit)>, ) -> Result<Vec<OpaqueKey>, String>

Source

pub fn opaque_drawn(&self) -> &[OpaqueFeatures]

Source

pub fn scene_features(&self) -> OpaqueFeatures

Source

pub fn opaque_features(&self, batches: &[Batch]) -> Vec<OpaqueFeatures>

Source

pub fn set_lights(&mut self, lights: &[LocalLight]) -> Result<(), String>

Source

pub fn set_light_quality(&mut self, quality: LightQuality) -> Result<(), String>

Source

pub fn set_transmission( &mut self, tints: &[Option<[f32; 3]>], ) -> Result<(), String>

Source

pub fn lights(&self) -> &Lights

Source

pub fn set_probe_emission(&mut self, scale: f32) -> Result<(), String>

Source

pub fn set_jitter(&mut self, jitter: [f32; 2])

Source

pub fn set_reflections(&mut self, history: Option<Reflections>)

Source

pub fn set_local_reflections( &self, artifacts: Option<Vec<ReflectionArtifact>>, hour: f32, ) -> Result<(), String>

Source

pub fn set_local_reflection_hour(&self, hour: f32) -> Result<(), String>

Source

pub fn set_sky(&mut self, source: SkySource, settle: bool) -> u64

Source

pub fn sky(&self) -> &SkyPass

Source

pub fn sky_mut(&mut self) -> &mut SkyPass

Source

pub fn set_ambient(&mut self, ambient: Ambient) -> Result<(), String>

Source

pub fn ambient(&self) -> Ambient

Source

pub fn set_contact(&mut self, desc: Option<ContactDesc>) -> Result<(), String>

Source

pub fn contact(&self) -> Option<&ContactField>

Source

pub fn write_contact(&self, values: &[f32]) -> Result<(), String>

Source

pub fn set_probes(&mut self, probes: ProbeLighting)

Source

pub fn set_probe_hour(&mut self, hour: f32) -> Result<(), String>

Source

pub fn probes(&self) -> &ProbeLighting

Source

pub fn set_maps(&mut self, images: &MapImages<'_>) -> Result<(), String>

Source

pub fn set_detail(&mut self, atlas: &Atlas) -> Result<(), String>

Source

pub fn set_texture_filter( &mut self, filter: TextureFilter, ) -> Result<(), String>

Source

pub fn texture_filter(&self) -> TextureFilter

Source

pub fn maps(&self) -> &MapTextures

Source

pub fn set_content( &self, slot: usize, width: u32, height: u32, format: ContentFormat, ) -> Result<(), String>

Source

pub fn write_content( &self, slot: usize, rect: [u32; 4], bytes: &[u8], ) -> Result<(), String>

Source

pub fn copy_content( &self, encoder: &mut CommandEncoder, slot: usize, source: &Texture, ) -> Result<ContentCopy, String>

Source

pub fn regenerate_content( &self, encoder: &mut CommandEncoder, slot: usize, ) -> Result<(), String>

Source

pub fn regenerate_content_regions( &self, encoder: &mut CommandEncoder, slot: usize, regions: &[MipRegion], ) -> Result<(), String>

Source

pub fn set_caustic(&self, caustic: Option<Caustic>) -> Result<(), String>

Source

pub fn caustic(&self) -> Option<Caustic>

Source

pub fn release_content(&self, slot: usize)

Source

pub fn content(&self) -> Ref<'_, ContentSlots>

Source

pub fn set_surfaces(&self, surfaces: &[InstanceSurface]) -> Result<(), String>

Source

pub fn surfaces(&self) -> Ref<'_, Vec<InstanceSurface>>

Source

pub fn lit_bindings(&self) -> Option<LitBindings<'_>>

Source

pub fn deformer_buffer(&self) -> &DeformerBuffer

Source

pub fn has_tree(&self) -> bool

Source

pub fn set_canopy_mode(&mut self, mode: CanopyMode) -> Result<(), String>

Source

pub fn set_canopy_sharpness(&mut self, sharpness: f32) -> Result<(), String>

Source

pub fn set_canopy_strength(&mut self, strength: f32) -> Result<(), String>

Source

pub fn set_canopy_gobo(&mut self, gobo: Gobo) -> Result<(), String>

Source

pub fn canopy_gobo(&self) -> Gobo

Source

pub fn visible_card_count(&self) -> u32

Source

pub fn set_tree( &mut self, tree: &Tree, origin: [f32; 3], receiver_y: f32, id: u32, ) -> Result<MeshHandle, String>

Source

pub fn upload_mesh(&mut self, data: MeshData<'_>) -> Result<MeshHandle, String>

Source

pub fn upload_skinned_mesh( &mut self, data: MeshData<'_>, skin: SkinData<'_>, ) -> Result<MeshHandle, String>

Source

pub fn upload_swaying_mesh( &mut self, data: MeshData<'_>, sway: &[SwayVertex], ) -> Result<MeshHandle, String>

Source

pub fn release_mesh(&mut self, handle: MeshHandle) -> Result<(), String>

Source

pub fn replace_mesh( &mut self, handle: MeshHandle, data: MeshData<'_>, ) -> Result<(), String>

Source

pub fn mesh_stats(&self) -> MeshStats

Source

pub fn shadow_mesh(&self, handle: MeshHandle) -> Option<(&Buffer, &Buffer, u32)>

Source

pub fn mesh_buffers(&self, handle: MeshHandle) -> Option<MeshBuffers<'_>>

Source

pub fn swaying(&self, handle: MeshHandle) -> bool

Source

pub fn skinned(&self, handle: MeshHandle) -> bool

Source

pub fn set_poses(&self, poses: &[InstancePose<'_>]) -> Result<(), String>

Source

pub fn same_poses(&self, poses: &[InstancePose<'_>]) -> bool

Source

pub fn render(&mut self, scene: &Scene<'_>) -> Result<&FrameTargets, String>

Source

pub fn resize(&mut self, width: u32, height: u32) -> Result<(), String>

Source

pub fn viewport(&self) -> [u32; 2]

Source

pub fn set_viewport(&mut self, width: u32, height: u32) -> Result<(), String>

Source

pub fn encode( &mut self, scene: &Scene<'_>, encoder: &mut CommandEncoder, shadows: Option<(&mut Shadows, &Fit)>, profiler: Option<&mut GpuProfiler>, ) -> Result<(), String>

Source

pub fn encode_with_shadow_hook( &mut self, scene: &Scene<'_>, encoder: &mut CommandEncoder, shadows: Option<(&mut Shadows, &Fit)>, profiler: Option<&mut GpuProfiler>, shadow_hook: impl FnOnce(&Gpu, &mut CommandEncoder, &mut Shadows, &Fit) -> Result<(), String>, ) -> Result<(), String>

Source

pub fn encode_with_casts( &mut self, scene: &Scene<'_>, encoder: &mut CommandEncoder, shadows: Option<(&mut Shadows, &Fit)>, profiler: Option<&mut GpuProfiler>, casts: Option<&mut LayerDraw<'_>>, shadow_hook: impl FnOnce(&Gpu, &mut CommandEncoder, &mut Shadows, &Fit) -> Result<(), String>, ) -> Result<(), String>

Source

pub fn collect_timings(&mut self) -> Vec<Vec<PassTiming>>

Source

pub fn readback_velocity(&self) -> Result<Vec<[u16; 2]>, String>

Trait Implementations§

Auto Trait Implementations§

§

impl !Freeze for Frame

§

impl !RefUnwindSafe for Frame

§

impl Send for Frame

§

impl !Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

§

impl !UnwindSafe for Frame

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,