Function draw_composite_blend

Source
pub fn draw_composite_blend(
    device: &Device,
    encoder: &mut CommandEncoder,
    pipelines: &CompositeBlendPipelines,
    fg_bind_group: &BindGroup,
    bg_view: &TextureView,
    comp: &PlannedIsolatedComposite,
    composite_buf: &Buffer,
    main_view: &TextureView,
    depth_stencil: Option<&RenderPassDepthStencilAttachment<'_>>,
)
Expand description

Draw fg over captured bg into the main pass (view must use Load).

Opacity is clamped to [0, 1]. The function creates transient uniform and background bind groups, preserves existing main-frame color, and draws the composite’s half-open vertex range. All views and the pipeline must share a compatible format and device.

§Examples

use ailloli_ui_render_wgpu::{composite_blend::{draw_composite_blend,
    CompositeBlendPipelines}, isolated_plan::PlannedIsolatedComposite};
fn draw(device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder,
    pipelines: &CompositeBlendPipelines, fg: &wgpu::BindGroup,
    bg: &wgpu::TextureView, comp: &PlannedIsolatedComposite,
    vertices: &wgpu::Buffer, main: &wgpu::TextureView) {
    draw_composite_blend(device, encoder, pipelines, fg, bg, comp, vertices, main, None);
}