pub struct FragmentProgram { /* private fields */ }Expand description
An instance of FragmentProgram creates Shader objects (as used by
Paint::shader), through the FragmentShaders it hands out.
Implementations§
Source§impl FragmentProgram
impl FragmentProgram
Sourcepub fn from_wgsl(wgsl: &str) -> Result<Arc<FragmentProgram>, EffectError>
pub fn from_wgsl(wgsl: &str) -> Result<Arc<FragmentProgram>, EffectError>
Creates a fragment program from WGSL in valo’s form, a paint shader’s: Flutter’s
FragmentProgram.fromAsset, for a shader built into the code that uses it, typically
with include_str!.
The constructed object should then be reused via the
fragment_shader method to create shader objects that can be
used by Paint::shader.
§Errors
Where naga rejects the WGSL, where it breaks valo’s contract, or where a uniform is not one Flutter’s API sets: a float, a float vector or a square float matrix, or a fixed-size array of one of those.
Sourcepub fn fragment_shader(self: &Arc<Self>) -> FragmentShader
pub fn fragment_shader(self: &Arc<Self>) -> FragmentShader
Returns a fresh instance of FragmentShader.
Trait Implementations§
Auto Trait Implementations§
impl Forget for FragmentProgram
impl Freeze for FragmentProgramwhere
*const ArcInner<RuntimeEffect> is !null: Freeze,
PhantomData<ArcInner<RuntimeEffect>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<UniformFloatInfo>: Freeze,
PhantomData<u32>: Freeze,
impl Move for FragmentProgram
impl RefUnwindSafe for FragmentProgram
impl Send for FragmentProgram
impl Sync for FragmentProgram
impl Unpin for FragmentProgram
impl UnsafeUnpin for FragmentProgramwhere
*const ArcInner<RuntimeEffect> is !null: UnsafeUnpin,
PhantomData<ArcInner<RuntimeEffect>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<UniformFloatInfo>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
impl UnwindSafe for FragmentProgram
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
Mutably borrows from an owned value. Read more