[−][src]Struct glium::program::ComputeShader
A combination of compute shaders linked together.
Implementations
impl ComputeShader
[src]
pub fn is_supported<C: ?Sized>(ctxt: &C) -> bool where
C: CapabilitiesSource,
[src]
C: CapabilitiesSource,
Returns true if the backend supports compute shaders.
pub fn from_source<F: ?Sized>(
facade: &F,
src: &str
) -> Result<ComputeShader, ProgramCreationError> where
F: Facade,
[src]
facade: &F,
src: &str
) -> Result<ComputeShader, ProgramCreationError> where
F: Facade,
Builds a new compute shader from some source code.
pub fn from_binary<F: ?Sized>(
facade: &F,
data: Binary
) -> Result<ComputeShader, ProgramCreationError> where
F: Facade,
[src]
facade: &F,
data: Binary
) -> Result<ComputeShader, ProgramCreationError> where
F: Facade,
Builds a new compute shader from some binary.
pub fn execute<U>(&self, uniforms: U, x: u32, y: u32, z: u32) where
U: Uniforms,
[src]
U: Uniforms,
Executes the compute shader.
x * y * z
work groups will be started. The current work group can be retrieved with
gl_WorkGroupID
. Inside each work group, additional local work groups can be started
depending on the attributes of the compute shader itself.
pub fn execute_indirect<U>(
&self,
uniforms: U,
buffer: BufferSlice<'_, ComputeCommand>
) where
U: Uniforms,
[src]
&self,
uniforms: U,
buffer: BufferSlice<'_, ComputeCommand>
) where
U: Uniforms,
Executes the compute shader.
This is similar to execute
, except that the parameters are stored in a buffer.
pub fn get_binary(&self) -> Result<Binary, GetBinaryError>
[src]
Returns the program's compiled binary.
You can store the result in a file, then reload it later. This avoids having to compile the source code every time.
pub fn get_uniform(&self, name: &str) -> Option<&Uniform>
[src]
Returns informations about a uniform variable, if it exists.
pub fn uniforms(&self) -> Iter<'_, String, Uniform>
[src]
Returns an iterator to the list of uniforms.
Example
for (name, uniform) in program.uniforms() { println!("Name: {} - Type: {:?}", name, uniform.ty); }
pub fn get_uniform_blocks(
&self
) -> &HashMap<String, UniformBlock, BuildHasherDefault<FnvHasher>>
[src]
&self
) -> &HashMap<String, UniformBlock, BuildHasherDefault<FnvHasher>>
Returns a list of uniform blocks.
Example
for (name, uniform) in program.get_uniform_blocks() { println!("Name: {}", name); }
pub fn get_shader_storage_blocks(
&self
) -> &HashMap<String, UniformBlock, BuildHasherDefault<FnvHasher>>
[src]
&self
) -> &HashMap<String, UniformBlock, BuildHasherDefault<FnvHasher>>
Returns the list of shader storage blocks.
Example
for (name, uniform) in program.get_shader_storage_blocks() { println!("Name: {}", name); }
Trait Implementations
impl Debug for ComputeShader
[src]
impl GlObject for ComputeShader
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ComputeShader
impl !Send for ComputeShader
impl !Sync for ComputeShader
impl Unpin for ComputeShader
impl !UnwindSafe for ComputeShader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,