Skip to main content

Module texture

Module texture 

Source
Expand description

Texture loading and management.

Texture wraps a wgpu::Texture with its view and sampler, ready for binding in shaders. TextureCache provides keyed caching for loaded textures.

Structs§

CubemapTexture
A GPU cubemap texture (6 faces) with view and sampler.
Texture
A GPU texture with view and sampler, ready for binding.
TextureCache
Cache of loaded textures, keyed by u64 texture ID.

Functions§

copy_texture_to_texture
Copy a region from one texture to another.
create_default_sampler
A shared sampler that can be reused across textures. Create once and pass to Texture::from_rgba_with_sampler to avoid per-texture sampler allocation.
mip_level_count
Calculate the number of mip levels for a texture of the given dimensions.
validate_dimensions
Validate texture dimensions against device limits.