#[non_exhaustive]pub struct RenderPass<'pass> { /* private fields */ }Implementations§
Source§impl<'pass> RenderPass<'pass>
impl<'pass> RenderPass<'pass>
Sourcepub fn select_render_target(&mut self, target: &'pass Target<'_>) -> Result<()>
pub fn select_render_target(&mut self, target: &'pass Target<'_>) -> Result<()>
Select the given render target for the following draw calls.
§Errors
Fails if the given target cannot be used for drawing.
Sourcepub fn buffer_info(&self) -> Option<Info>
pub fn buffer_info(&self) -> Option<Info>
Get the buffer info being used, if it exists.
§Notes
The resulting buffer::Info is copied (and not taken) from the one currently in use.
Sourcepub fn set_buffer_info(&mut self, buffer_info: &Info)
pub fn set_buffer_info(&mut self, buffer_info: &Info)
Set the buffer info to use for for the following draw calls.
Sourcepub fn attr_info(&self) -> Option<Info>
pub fn attr_info(&self) -> Option<Info>
Get the attribute info being used, if it exists.
§Notes
The resulting attrib::Info is copied (and not taken) from the one currently in use.
Sourcepub fn set_attr_info(&mut self, attr_info: &Info)
pub fn set_attr_info(&mut self, attr_info: &Info)
Set the attribute info to use for any following draw calls.
Sourcepub fn draw_arrays(&mut self, primitive: Primitive, vbo_data: Slice<'pass>)
pub fn draw_arrays(&mut self, primitive: Primitive, vbo_data: Slice<'pass>)
Render primitives from the current vertex array buffer.
§Panics
Panics if no shader program was bound (see RenderPass::bind_program).
Sourcepub fn draw_elements<I: Index>(
&mut self,
primitive: Primitive,
vbo_data: Slice<'pass>,
indices: &Indices<'pass, I>,
)
pub fn draw_elements<I: Index>( &mut self, primitive: Primitive, vbo_data: Slice<'pass>, indices: &Indices<'pass, I>, )
Draws the vertices in buf indexed by indices.
§Panics
Panics if no shader program was bound (see RenderPass::bind_program).
Sourcepub fn bind_program(&mut self, program: &'pass Program)
pub fn bind_program(&mut self, program: &'pass Program)
Use the given shader::Program for the following draw calls.
Sourcepub fn bind_light_env(&mut self, env: Option<Pin<&'pass mut LightEnv>>)
pub fn bind_light_env(&mut self, env: Option<Pin<&'pass mut LightEnv>>)
Binds a LightEnv for the following draw calls.
Sourcepub fn bind_vertex_uniform(&mut self, index: Index, uniform: impl Into<Uniform>)
pub fn bind_vertex_uniform(&mut self, index: Index, uniform: impl Into<Uniform>)
Bind a uniform to the given index in the vertex shader for the next draw call.
§Panics
Panics if no shader program was bound (see RenderPass::bind_program).
§Example
let idx = uniform::Index::from(0);
let mtx = Matrix4::identity();
instance.bind_vertex_uniform(idx, &mtx);Sourcepub fn bind_geometry_uniform(
&mut self,
index: Index,
uniform: impl Into<Uniform>,
)
pub fn bind_geometry_uniform( &mut self, index: Index, uniform: impl Into<Uniform>, )
Bind a uniform to the given index in the geometry shader for the next draw call.
§Panics
Panics if no shader program was bound (see RenderPass::bind_program).
§Example
let idx = uniform::Index::from(0);
let mtx = Matrix4::identity();
instance.bind_geometry_uniform(idx, &mtx);