This is the first release that featured `wgpu-info` as a binary crate for getting information about what devices wgpu sees in your system. It can dump the information in both human readable format and json.
Major Changes
This release was fairly minor as breaking changes go.
`wgpu` types now `!Send` `!Sync` on wasm
Up until this point, wgpu has made the assumption that threads do not exist on wasm. With the rise of libraries like [`wasm_thread`](https://crates.io/crates/wasm_thread) making it easier and easier to do wasm multithreading this assumption is no longer sound. As all wgpu objects contain references into the JS heap, they cannot leave the thread they started on.
As we understand that this change might be very inconvenient for users who don't care about wasm threading, there is a crate feature which re-enables the old behavior: `fragile-send-sync-non-atomic-wasm`. So long as you don't compile your code with `-Ctarget-feature=+atomics`, `Send` and `Sync` will be implemented again on wgpu types on wasm. As the name implies, especially for libraries, this is very fragile, as you don't know if a user will want to compile with atomics (and therefore threads) or not.
By daxpedda in [3691](https://github.com/gfx-rs/wgpu/pull/3691)
Power Preference is now optional
The `power_preference` field of `RequestAdapterOptions` is now optional. If it is `PowerPreference::None`, we will choose the first available adapter, preferring GPU adapters over CPU adapters.
By Aaron1011 in [3903](https://github.com/gfx-rs/wgpu/pull/3903)
`initialize_adapter_from_env` argument changes
Removed the backend_bits parameter from `initialize_adapter_from_env` and `initialize_adapter_from_env_or_default`. If you want to limit the backends used by this function, only enable the wanted backends in the instance.
Added a compatible surface parameter, to ensure the given device is able to be presented onto the given surface.
diff
- wgpu::util::initialize_adapter_from_env(instance, backend_bits);
+ wgpu::util::initialize_adapter_from_env(instance, Some(&compatible_surface));
By fornwall in [3904](https://github.com/gfx-rs/wgpu/pull/3904) and [#3905](https://github.com/gfx-rs/wgpu/pull/3905)
Misc Breaking Changes
- Change `AdapterInfo::{device,vendor}` to be `u32` instead of `usize`. By ameknite in [3760](https://github.com/gfx-rs/wgpu/pull/3760)
Changes
- Added support for importing external buffers using `buffer_from_raw` (Dx12, Metal, Vulkan) and `create_buffer_from_hal`. By AdrianEddy in [3355](https://github.com/gfx-rs/wgpu/pull/3355)
Vulkan
- Work around [Vulkan-ValidationLayers5671](https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5671) by ignoring reports of violations of [VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912). By jimblandy in [3809](https://github.com/gfx-rs/wgpu/pull/3809).
Added/New Features
General
- Empty scissor rects are allowed now, matching the specification. by PJB3005 in [3863](https://github.com/gfx-rs/wgpu/pull/3863).
- Add back components info to `TextureFormat`s. By teoxoy in [3843](https://github.com/gfx-rs/wgpu/pull/3843).
- Add `get_mapped_range_as_array_buffer` for faster buffer read-backs in wasm builds. By ryankaplan in [4042] (https://github.com/gfx-rs/wgpu/pull/4042).
Documentation
- Better documentation for draw, draw_indexed, set_viewport and set_scissor_rect. By genusistimelord in [3860](https://github.com/gfx-rs/wgpu/pull/3860)
- Fix link to `GPUVertexBufferLayout`. By fornwall in [3906](https://github.com/gfx-rs/wgpu/pull/3906)
- Document feature requirements for `DEPTH32FLOAT_STENCIL8` by ErichDonGubler in [3734](https://github.com/gfx-rs/wgpu/pull/3734).
- Flesh out docs. for `AdapterInfo::{device,vendor}` by ErichDonGubler in [3763](https://github.com/gfx-rs/wgpu/pull/3763).
- Spell out which sizes are in bytes. By jimblandy in [3773](https://github.com/gfx-rs/wgpu/pull/3773).
- Validate that `descriptor.usage` is not empty in `create_buffer` by nical in [3928](https://github.com/gfx-rs/wgpu/pull/3928)
- Update `max_bindings_per_bind_group` limit to reflect spec changes by ErichDonGubler and nical in [3943](https://github.com/gfx-rs/wgpu/pull/3943) [#3942](https://github.com/gfx-rs/wgpu/pull/3942)
- Add better docs for `Limits`, listing the actual limits returned by `downlevel_defaults` and `downlevel_webgl2_defaults` by JustAnotherCodemonkey in [3988](https://github.com/gfx-rs/wgpu/pull/3988)
Bug Fixes
General
- Fix order of arguments to glPolygonOffset by komadori in [3783](https://github.com/gfx-rs/wgpu/pull/3783).
- Fix OpenGL/EGL backend not respecting non-sRGB texture formats in `SurfaceConfiguration`. by liquidev in [3817](https://github.com/gfx-rs/wgpu/pull/3817)
- Make write- and read-only marked buffers match non-readonly layouts. by fornwall in [3893](https://github.com/gfx-rs/wgpu/pull/3893)
- Fix leaking X11 connections. by wez in [3924](https://github.com/gfx-rs/wgpu/pull/3924)
- Fix ASTC feature selection in the webgl backend. by expenses in [3934](https://github.com/gfx-rs/wgpu/pull/3934)
- Fix Multiview to disable validation of TextureViewDimension and ArrayLayerCount. By MalekiRe in [3779](https://github.com/gfx-rs/wgpu/pull/3779#issue-1713269437).
Vulkan
- Fix incorrect aspect in barriers when using emulated Stencil8 textures. By cwfitzgerald in [3833](https://github.com/gfx-rs/wgpu/pull/3833).
- Implement depth-clip-control using depthClamp instead of VK_EXT_depth_clip_enable. By AlbinBernhardssonARM [3892](https://github.com/gfx-rs/wgpu/pull/3892).
- Fix enabling `wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY` not being actually enabled in vulkan backend. By 39ali in[3772](https://github.com/gfx-rs/wgpu/pull/3772).
Metal
- Fix renderpasses being used inside of renderpasses. By cwfitzgerald in [3828](https://github.com/gfx-rs/wgpu/pull/3828)
- Support (simulated) visionOS. By jinleili in [3883](https://github.com/gfx-rs/wgpu/pull/3883)
DX12
- Disable suballocation on Intel Iris(R) Xe. By xiaopengli89 in [3668](https://github.com/gfx-rs/wgpu/pull/3668)
- Change the `max_buffer_size` limit from `u64::MAX` to `i32::MAX`. By nical in [4020](https://github.com/gfx-rs/wgpu/pull/4020)
WebGPU
- Use `get_preferred_canvas_format()` to fill `formats` of `SurfaceCapabilities`. By jinleili in [3744](https://github.com/gfx-rs/wgpu/pull/3744)
Examples
- Publish examples to wgpu.rs on updates to trunk branch instead of gecko. By paul-hansen in [3750](https://github.com/gfx-rs/wgpu/pull/3750)
- Ignore the exception values generated by the winit resize event. By jinleili in [3916](https://github.com/gfx-rs/wgpu/pull/3916)