[−][src]Struct web_glitz::rendering::GraphicsPipelineTarget
Implementations
impl GraphicsPipelineTarget
[src]
pub fn pipeline_task<P, V, R, Tf, F, T>(
&self,
pipeline: &P,
f: F
) -> PipelineTask<T> where
P: GraphicsPipelineState<V, R, Tf>,
F: Fn(ActiveGraphicsPipeline<'_, V, R, Tf>) -> T,
T: GpuTask<PipelineTaskContext>,
[src]
&self,
pipeline: &P,
f: F
) -> PipelineTask<T> where
P: GraphicsPipelineState<V, R, Tf>,
F: Fn(ActiveGraphicsPipeline<'_, V, R, Tf>) -> T,
T: GpuTask<PipelineTaskContext>,
Creates a pipeline task using the given graphics_pipeline
.
The second parameter f
must be a function that returns the task that is to be executed
while the graphics_pipeline
is bound as the active graphics pipeline. This function
will receive a reference to this ActiveGraphicsPipeline which may be used to encode
draw commands (see [ActiveGraphicsPipeline::draw_command]). The task returned by the
function typically consists of 1 ore more draw commands that were created in this way. The
current framebuffer serves as the output target for the graphics_pipeline
(your draw
commands may modify the current framebuffer).
Example
let render_pass = render_target.create_render_pass(|framebuffer| { framebuffer.pipeline_task(&graphics_pipeline, |active_pipeline| { active_pipeline.task_builder() .bind_vertex_buffers(&vertex_buffer) .bind_resources(&resources) .draw(16, 1) .finish() }) });
In this example, context
is a [RenderingContext]; render_target
is a [RenderTarget], see
also [DefaultRenderTarget] and [RenderTarget]; graphics_pipeline
is a GraphicsPipeline,
see GraphicsPipeline for details; vertex_buffer
is a [Buffer] holding a [Vertex] type,
see [Buffer], [Vertex] for details; resources
is a resource [BindGroup], see [BindGroup]
for details.
Panics
Panics if the graphics_pipeline
belongs to a different context than the framebuffer for
which this pipeline task is being created.
Panics if the task returned by f
contains commands that were constructed for a different
pipeline task context.
Auto Trait Implementations
impl !RefUnwindSafe for GraphicsPipelineTarget
impl Send for GraphicsPipelineTarget
impl !Sync for GraphicsPipelineTarget
impl Unpin for GraphicsPipelineTarget
impl UnwindSafe for GraphicsPipelineTarget
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,
pub 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<D, T> IntoBuffer<T> for D where
D: Borrow<T> + 'static,
T: Copy + 'static,
[src]
D: Borrow<T> + 'static,
T: Copy + 'static,
pub fn into_buffer<Rc>(Self, &Rc, BufferId, UsageHint) -> Buffer<T> where
Rc: RenderingContext + Clone + 'static,
[src]
Rc: RenderingContext + Clone + 'static,
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.
pub 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>,