pub struct Program { /* private fields */ }Expand description
Implementations§
Source§impl Program
impl Program
Sourcepub fn new(vertex_shader: Entrypoint) -> Result<Self, Error>
pub fn new(vertex_shader: Entrypoint) -> Result<Self, Error>
Create a new shader program from a vertex shader.
§Errors
Returns an error if:
- the shader program cannot be initialized
- the input shader is not a vertex shader or is otherwise invalid
Sourcepub fn set_geometry_shader(
&mut self,
geometry_shader: Entrypoint,
stride: u8,
) -> Result<(), Error>
pub fn set_geometry_shader( &mut self, geometry_shader: Entrypoint, stride: u8, ) -> Result<(), Error>
Set the geometry shader for a given program.
§Errors
Returns an error if the input shader is not a geometry shader or is otherwise invalid.
Sourcepub fn get_vertex_uniform(&self, name: &str) -> Result<Index>
pub fn get_vertex_uniform(&self, name: &str) -> Result<Index>
Get the index of a uniform in the vertex shader by name.
§Errors
- If the given
namecontains a null byte - If a uniform with the given
namecould not be found
Sourcepub fn get_geometry_uniform(&self, name: &str) -> Result<Index>
pub fn get_geometry_uniform(&self, name: &str) -> Result<Index>
Get the index of a uniform in the geometry shader by name.
§Errors
- If a geometry shader has not been set
- If the given
namecontains a null byte - If a uniform with the given
namecould not be found