Skip to main content

create_rgba_texture

Function create_rgba_texture 

Source
pub fn create_rgba_texture(
    device: &Device,
    width: u32,
    height: u32,
    label: Option<&str>,
) -> Texture
Expand description

Create an RGBA texture with the specified dimensions.

The texture is created with:

  • COPY_DST usage (for writing data)
  • TEXTURE_BINDING usage (for sampling in shaders)

ยงArguments

  • device - The wgpu device
  • width - Texture width in pixels
  • height - Texture height in pixels
  • label - Optional debug label