Skip to main content

create_depth_texture

Function create_depth_texture 

Source
pub fn create_depth_texture(
    device: &RenderDevice,
    width: u32,
    height: u32,
    label: &str,
) -> (Texture, TextureView)
Expand description

创建深度纹理和视图

在窗口大小变化时需要重新创建。

§参数

  • device: 渲染设备
  • width: 纹理宽度
  • height: 纹理高度
  • label: 纹理标签

§返回

返回 (Texture, TextureView) 元组

§示例

use anvilkit_render::renderer::buffer::create_depth_texture;
use anvilkit_render::renderer::RenderDevice;

let (texture, view) = create_depth_texture(device, 800, 600, "Depth");