pub struct Context { /* private fields */ }Expand description
WGPU context for applying various effects
Implementations§
Source§impl Context
impl Context
Sourcepub fn merge_workspace(&self) -> MergeWorkspace
pub fn merge_workspace(&self) -> MergeWorkspace
Builds a new set of MergeWorkspace
These will be resized when first used (in
submit_merge)
Sourcepub fn shade_workspace(&self) -> ShadeWorkspace
pub fn shade_workspace(&self) -> ShadeWorkspace
Builds a new set of ShadeWorkspace
These will be resized when first used (in
either submit_color or
submit_shade)
Sourcepub fn ssao_workspace(&self) -> SsaoWorkspace
pub fn ssao_workspace(&self) -> SsaoWorkspace
Builds a new set of SsaoWorkspace
These will be resized when first used (in
submit_ssao)
Sourcepub fn submit_merge(
&self,
image: &FlexBuffer<GeomBufferTag>,
settings: MergeSettings,
buf: &mut MergeWorkspace,
) -> Result<(), MergeError>
pub fn submit_merge( &self, image: &FlexBuffer<GeomBufferTag>, settings: MergeSettings, buf: &mut MergeWorkspace, ) -> Result<(), MergeError>
Accumulates an image into a merged image buffer
MergeWorkspace::reset should be called before the first call to
submit_merge. For the first merge after a reset, the output buffer is
resized to fit the images; subsequent merges must be of the same size.
Sourcepub fn submit_shade(
&self,
image: &MergeWorkspace,
ssao: Option<&SsaoWorkspace>,
buf: &mut ShadeWorkspace,
) -> Result<(), ShadeError>
pub fn submit_shade( &self, image: &MergeWorkspace, ssao: Option<&SsaoWorkspace>, buf: &mut ShadeWorkspace, ) -> Result<(), ShadeError>
Submits an operation to shade an image
The output buffer is resized to fit the incoming image
Sourcepub fn submit_heightmap(
&self,
image: &MergeWorkspace,
buf: &mut ShadeWorkspace,
) -> Result<(), HeightmapError>
pub fn submit_heightmap( &self, image: &MergeWorkspace, buf: &mut ShadeWorkspace, ) -> Result<(), HeightmapError>
Submits an operation to generate RGB color from a heightmap
The output buffer is resized to fit the incoming image
Sourcepub fn submit_ssao(
&self,
image: &MergeWorkspace,
buf: &mut SsaoWorkspace,
) -> Result<(), SsaoError>
pub fn submit_ssao( &self, image: &MergeWorkspace, buf: &mut SsaoWorkspace, ) -> Result<(), SsaoError>
Submits a pass to compute an SSAO buffer
Sourcepub fn submit_color(
&self,
merge: &MergeWorkspace,
world_to_model: &Matrix4<f32>,
shape: &ShapeColorBuffers,
bufs: &mut ColorWorkspace,
out: &mut ShadeWorkspace,
) -> Result<(), ColorError>
pub fn submit_color( &self, merge: &MergeWorkspace, world_to_model: &Matrix4<f32>, shape: &ShapeColorBuffers, bufs: &mut ColorWorkspace, out: &mut ShadeWorkspace, ) -> Result<(), ColorError>
Submits a color evaluation pass
Image size is set from the MergeWorkspace; the transform matrix is
provided separately (but should be the same one used for image
evaluation).
Sourcepub fn submit_color_with_vars(
&self,
merge: &MergeWorkspace,
world_to_model: &Matrix4<f32>,
shape: &ShapeColorBuffers,
bufs: &mut ColorWorkspace,
vars: &ShapeVars<f32>,
out: &mut ShadeWorkspace,
) -> Result<(), ColorError>
pub fn submit_color_with_vars( &self, merge: &MergeWorkspace, world_to_model: &Matrix4<f32>, shape: &ShapeColorBuffers, bufs: &mut ColorWorkspace, vars: &ShapeVars<f32>, out: &mut ShadeWorkspace, ) -> Result<(), ColorError>
Submits a color evaluation pass with auxiliary variables
Image size is set from the MergeWorkspace; the transform matrix is
provided separately (but should be the same one used for image
evaluation).
Sourcepub fn color_workspace(&self) -> ColorWorkspace
pub fn color_workspace(&self) -> ColorWorkspace
Returns a new workspace for color evaluation
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl !UnwindSafe for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.