From 45ea4ca7728c1490cd3a2a342cf90fd9c47b0077 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Thu, 1 Dec 2022 13:13:26 +0800 Subject: [PATCH] Updage CHANGELOG --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb07c09bcde..280e526d66a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,18 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non `Instance::create_surface()` now returns `Result` instead of `Surface`. This allows an error to be returned instead of panicking if the given window is a HTML canvas and obtaining a WebGPU or WebGL 2 context fails. (No other platforms currently report any errors through this path.) By @kpreid in [#3052](https://github.com/gfx-rs/wgpu/pull/3052/) +#### Texture Format Reinterpretation + +The `view_formats` field is used to specify formats that are compatible with the texture format to allow the creation of views with different formats, currently, only changing srgb-ness is allowed. + +```diff +let texture = device.create_texture(&wgpu::TextureDescriptor { + // ... + format: TextureFormat::Rgba8UnormSrgb, ++ view_formats: &[TextureFormat::Rgba8Unorm], +}); +``` + ### Changes #### General @@ -77,6 +89,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non - New downlevel feature `UNRESTRICTED_INDEX_BUFFER` to indicate support for using `INDEX` together with other non-copy/map usages (unsupported on WebGL). By @Wumpf in [#3157](https://github.com/gfx-rs/wgpu/pull/3157) - Combine `Surface::get_supported_formats`, `Surface::get_supported_present_modes`, and `Surface::get_supported_alpha_modes` into `Surface::get_capabilities` and `SurfaceCapabilities`. By @cwfitzgerald in [#3157](https://github.com/gfx-rs/wgpu/pull/3157) - Make `Surface::get_default_config` return an Option to prevent panics. By @cwfitzgerald in [#3157](https://github.com/gfx-rs/wgpu/pull/3157) +- Add `view_formats` in TextureDescriptor to match the WebGPU spec. By @jinleili in [#3237](https://github.com/gfx-rs/wgpu/pull/3237) #### WebGPU