MCPcopy Create free account
hub / github.com/DioxusLabs/anyrender / create_texture

Function create_texture

crates/wgpu_context/src/util.rs:30–53  ·  view source on GitHub ↗

Create a WGPU Texture, returning a default TextureView

(
    width: u32,
    height: u32,
    format: TextureFormat,
    usage: TextureUsages,
    device: &Device,
)

Source from the content-addressed store, hash-verified

28
29/// Create a WGPU Texture, returning a default TextureView
30pub(crate) fn create_texture(
31 width: u32,
32 height: u32,
33 format: TextureFormat,
34 usage: TextureUsages,
35 device: &Device,
36) -> TextureView {
37 let texture = device.create_texture(&wgpu::TextureDescriptor {
38 label: None,
39 size: wgpu::Extent3d {
40 width,
41 height,
42 depth_or_array_layers: 1,
43 },
44 mip_level_count: 1,
45 sample_count: 1,
46 dimension: wgpu::TextureDimension::D2,
47 usage,
48 format,
49 view_formats: &[],
50 });
51
52 texture.create_view(&wgpu::TextureViewDescriptor::default())
53}

Callers 4

newMethod · 0.85
resizeMethod · 0.85
newMethod · 0.85
resizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected