github gfx-rs/wgpu v0.17.0

latest releases: v29.0.3, v29.0.2, v29.0.1...
2 years ago

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 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

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

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 watned backends in the instance.

Added a compatible surface parameter, to ensure the given device is able to be presented onto the given surface.

- wgpu::util::initialize_adapter_from_env(instance, backend_bits);
+ wgpu::util::initialize_adapter_from_env(instance, Some(&compatible_surface));

By @fornwall in #3904 and #3905

Misc Breaking Changes

  • Change AdapterInfo::{device,vendor} to be u32 instead of usize. By @ameknite in #3760

Changes

  • Added support for importing external buffers using buffer_from_raw (Dx12, Metal, Vulkan) and create_buffer_from_hal. By @AdrianEddy in #3355

Vulkan

Added/New Features

  • Empty scissor rects are allowed now, matching the specification. by @PJB3005 in #3863.
  • Add back components info to TextureFormats. By @teoxoy in #3843.

Documentation

Bug Fixes

General

  • Fix order of arguments to glPolygonOffset by @komadori in #3783.
  • Fix OpenGL/EGL backend not respecting non-sRGB texture formats in SurfaceConfiguration. by @liquidev in #3817
  • Make write- and read-only marked buffers match non-readonly layouts. by @fornwall in #3893
  • Fix leaking X11 connections. by @wez in #3924
  • Fix ASTC feature selection in the webgl backend. by @expenses in #3934
  • Fix Multiview to disable validation of TextureViewDimension and ArrayLayerCount. By @MalekiRe in #3779.

Vulkan

Metal

DX12

WebGPU

  • Use get_preferred_canvas_format() to fill formats of SurfaceCapabilities. By @jinleili in #3744

Examples

  • Publish examples to wgpu.rs on updates to trunk branch instead of gecko. By @paul-hansen in #3750
  • Ignore the exception values generated by the winit resize event. By @jinleili in #3916

Don't miss a new wgpu release

NewReleases is sending notifications on new releases.