pub struct Program<B, Sem, Out, Uni> where
B: Shader, { /* private fields */ }
Expand description
A shader program.
Shader programs are GPU binaries that execute when a draw command is issued.
Parametricity
B
is the backend type.Sem
is theSemantics
type.Out
is the render target type.Uni
is theUniformInterface
type.
Implementations
sourceimpl<B, Sem, Out, Uni> Program<B, Sem, Out, Uni> where
B: Shader,
Sem: Semantics,
impl<B, Sem, Out, Uni> Program<B, Sem, Out, Uni> where
B: Shader,
Sem: Semantics,
sourcepub fn adapt<Q>(
self
) -> Result<BuiltProgram<B, Sem, Out, Q>, AdaptationFailure<B, Sem, Out, Uni>> where
Q: UniformInterface<B>,
pub fn adapt<Q>(
self
) -> Result<BuiltProgram<B, Sem, Out, Q>, AdaptationFailure<B, Sem, Out, Uni>> where
Q: UniformInterface<B>,
Create a new UniformInterface
but keep the Program
around without rebuilding it.
Parametricity
Q
is the newUniformInterface
.
sourcepub fn adapt_env<Q, E>(
self,
env: &mut E
) -> Result<BuiltProgram<B, Sem, Out, Q>, AdaptationFailure<B, Sem, Out, Uni>> where
Q: UniformInterface<B, E>,
pub fn adapt_env<Q, E>(
self,
env: &mut E
) -> Result<BuiltProgram<B, Sem, Out, Q>, AdaptationFailure<B, Sem, Out, Uni>> where
Q: UniformInterface<B, E>,
Create a new UniformInterface
but keep the Program
around without rebuilding it, by
using a mutable environment variable.
Parametricity
Q
is the newUniformInterface
.E
is the mutable environment variable.
sourcepub fn readapt_env<E>(
self,
env: &mut E
) -> Result<BuiltProgram<B, Sem, Out, Uni>, AdaptationFailure<B, Sem, Out, Uni>> where
Uni: UniformInterface<B, E>,
pub fn readapt_env<E>(
self,
env: &mut E
) -> Result<BuiltProgram<B, Sem, Out, Uni>, AdaptationFailure<B, Sem, Out, Uni>> where
Uni: UniformInterface<B, E>,
Re-create the UniformInterface
but keep the Program
around without rebuilding it.
Parametricity
E
is the mutable environment variable.
Auto Trait Implementations
impl<B, Sem, Out, Uni> RefUnwindSafe for Program<B, Sem, Out, Uni> where
Out: RefUnwindSafe,
Sem: RefUnwindSafe,
Uni: RefUnwindSafe,
<B as Shader>::ProgramRepr: RefUnwindSafe,
impl<B, Sem, Out, Uni> !Send for Program<B, Sem, Out, Uni>
impl<B, Sem, Out, Uni> !Sync for Program<B, Sem, Out, Uni>
impl<B, Sem, Out, Uni> Unpin for Program<B, Sem, Out, Uni> where
Uni: Unpin,
<B as Shader>::ProgramRepr: Unpin,
impl<B, Sem, Out, Uni> UnwindSafe for Program<B, Sem, Out, Uni> where
Out: RefUnwindSafe,
Sem: RefUnwindSafe,
Uni: UnwindSafe,
<B as Shader>::ProgramRepr: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more