bevy/crates/bevy_render/src/texture
Kanabenki 756fb069b1
Add ImageSamplerDescriptor as an image loader setting (#9982)
Closes #9946 

# Objective

Add a new type mirroring `wgpu::SamplerDescriptor` for
`ImageLoaderSettings` to control how a loaded image should be sampled.

Fix issues with texture sampler descriptors not being set when loading
gltf texture from URI.

## Solution

Add a new `ImageSamplerDescriptor` and its affiliated types that mirrors
`wgpu::SamplerDescriptor`, use it in the image loader settings.

---

## Changelog

### Added

- Added new types `ImageSamplerDescriptor`, `ImageAddressMode`,
`ImageFilterMode`, `ImageCompareFunction` and `ImageSamplerBorderColor`
that mirrors the corresponding wgpu types.
- `ImageLoaderSettings` now carries an `ImageSamplerDescriptor` field
that will be used to determine how the loaded image is sampled, and will
be serialized as part of the image assets `.meta` files.

### Changed

- `Image::from_buffer` now takes the sampler descriptor to use as an
additional parameter.

### Fixed

- Sampler descriptors are set for gltf textures loaded from URI.
2023-10-25 01:50:20 +00:00
..
basis.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
compressed_image_saver.rs Add ImageSamplerDescriptor as an image loader setting (#9982) 2023-10-25 01:50:20 +00:00
dds.rs Detect cubemap for dds textures (#10222) 2023-10-21 19:10:37 +00:00
exr_texture_loader.rs Removed anyhow (#10003) 2023-10-06 07:20:13 +00:00
fallback_image.rs Replace all usages of texture_descritor.size.* with the helper methods (#10227) 2023-10-23 20:49:02 +00:00
hdr_texture_loader.rs Removed anyhow (#10003) 2023-10-06 07:20:13 +00:00
image_loader.rs Add ImageSamplerDescriptor as an image loader setting (#9982) 2023-10-25 01:50:20 +00:00
image_texture_conversion.rs Replace all usages of texture_descritor.size.* with the helper methods (#10227) 2023-10-23 20:49:02 +00:00
image.rs Add ImageSamplerDescriptor as an image loader setting (#9982) 2023-10-25 01:50:20 +00:00
ktx2.rs ktx2: Fix Rgb8 -> Rgba8Unorm conversion (#9555) 2023-08-24 00:35:52 +00:00
mod.rs Deferred Renderer (#9258) 2023-10-12 22:10:38 +00:00
texture_cache.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00