pub struct KernelLibrary { /* private fields */ }Expand description
Library of all built-in compute kernels, providing easy access to sources and parameter setup.
Implementations§
Source§impl KernelLibrary
impl KernelLibrary
Sourcepub fn source(&self, id: KernelId) -> Option<&'static str>
pub fn source(&self, id: KernelId) -> Option<&'static str>
Get the raw GLSL source for a kernel.
Sourcepub fn shader_source(&self, id: KernelId) -> Option<ShaderSource>
pub fn shader_source(&self, id: KernelId) -> Option<ShaderSource>
Build a ShaderSource for a kernel, with version header and optional defines.
Sourcepub fn compile(
&self,
gl: &Context,
id: KernelId,
) -> Result<ComputeProgram, String>
pub fn compile( &self, gl: &Context, id: KernelId, ) -> Result<ComputeProgram, String>
Compile a kernel into a ComputeProgram.
Sourcepub fn compile_with_defines(
&self,
gl: &Context,
id: KernelId,
defines: &[(&str, &str)],
) -> Result<ComputeProgram, String>
pub fn compile_with_defines( &self, gl: &Context, id: KernelId, defines: &[(&str, &str)], ) -> Result<ComputeProgram, String>
Compile a kernel with extra defines.
Sourcepub fn available_kernels(&self) -> Vec<KernelId>
pub fn available_kernels(&self) -> Vec<KernelId>
List all available kernel IDs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KernelLibrary
impl RefUnwindSafe for KernelLibrary
impl Send for KernelLibrary
impl Sync for KernelLibrary
impl Unpin for KernelLibrary
impl UnsafeUnpin for KernelLibrary
impl UnwindSafe for KernelLibrary
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn 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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.Source§fn as_any(&self) -> &(dyn Any + 'static)
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.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.