Skip to main content

create_depth_target

Function create_depth_target 

Source
pub fn create_depth_target(
    device: &Device,
    width: u32,
    height: u32,
    sample_count: u32,
) -> Texture
Expand description

Allocate a transient depth-stencil texture in the format default_depth_stencil_format picks for device.

It is created with RENDER_ATTACHMENT and TRANSIENT_ATTACHMENT: it is cleared and discarded inside the frame’s single pass, so nothing is ever read back from it. sample_count must be the color attachment’s, which this one is paired with in the pass.