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