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§
- Cubemap
Texture - A GPU cubemap texture (6 faces) with view and sampler.
- Texture
- A GPU texture with view and sampler, ready for binding.
- Texture
Cache - 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_samplerto 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.