Wgpu

Latest version: v0.21.1

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 15

0.19.1

This release includes `wgpu` and `wgpu-hal`. The rest of the crates are unchanged since 0.19.0.

Bug Fixes

DX12

- Properly register all swapchain buffers to prevent error on surface present. By dtzxporter in [5091](https://github.com/gfx-rs/wgpu/pull/5091)
- Check for extra null states when creating resources. By nical in [5096](https://github.com/gfx-rs/wgpu/pull/5096)
- Fix depth-only and stencil-only views causing crashes. By teoxoy in [5100](https://github.com/gfx-rs/wgpu/pull/5100)

OpenGL

- In Surface::configure and Surface::present on Windows, fix the current GL context not being unset when releasing the lock that guards access to making the context current. This was causing other threads to panic when trying to make the context current. By Imberflur in [5087](https://github.com/gfx-rs/wgpu/pull/5087).

WebGPU

- Improve error message when compiling WebGPU backend on wasm without the `web_sys_unstable_apis` set. By rukai in [5104](https://github.com/gfx-rs/wgpu/pull/5104)

Documentation

- Document Wayland specific behavior related to `SurfaceTexture::present`. By i509VCB in [5093](https://github.com/gfx-rs/wgpu/pull/5093).

0.19.0

This release includes:
- `wgpu`
- `wgpu-core`
- `wgpu-hal`
- `wgpu-types`
- `wgpu-info`
- `naga` (skipped from 0.14 to 0.19)
- `naga-cli` (skipped from 0.14 to 0.19)
- `d3d12` (skipped from 0.7 to 0.19)

Improved Multithreading through internal use of Reference Counting

Large refactoring of wgpu’s internals aiming at reducing lock contention, and providing better performance when using wgpu on multiple threads.

[Check the blog post!](https://gfx-rs.github.io/2023/11/24/arcanization.html)

By gents83 in [3626](https://github.com/gfx-rs/wgpu/pull/3626) and thanks also to jimblandy, nical, Wumpf, Elabajaba & cwfitzgerald

All Public Dependencies are Re-Exported

All of wgpu's public dependencies are now re-exported at the top level so that users don't need to take their own dependencies.
This includes:
- wgpu-core
- wgpu-hal
- naga
- raw_window_handle
- web_sys

Feature Flag Changes

WebGPU & WebGL in the same Binary

Enabling `webgl` no longer removes the `webgpu` backend.

Instead, there's a new (default enabled) `webgpu` feature that allows to explicitly opt-out of `webgpu` if so desired.
If both `webgl` & `webgpu` are enabled, `wgpu::Instance` decides upon creation whether to target wgpu-core/WebGL or WebGPU.
This means that adapter selection is not handled as with regular adapters, but still allows to decide at runtime whether
`webgpu` or the `webgl` backend should be used using a single wasm binary.
By wumpf in [5044](https://github.com/gfx-rs/wgpu/pull/5044)

`naga-ir` Dedicated Feature

The `naga-ir` feature has been added to allow you to add naga module shaders without guessing about what other features needed to be enabled to get access to it.
By cwfitzgerald in [5063](https://github.com/gfx-rs/wgpu/pull/5063).

`expose-ids` Feature available unconditionally

This feature allowed you to call `global_id` on any wgpu opaque handle to get a unique hashable identity for the given resource. This is now available without the feature flag.
By cwfitzgerald in [4841](https://github.com/gfx-rs/wgpu/pull/4841).

`dx12` and `metal` Backend Crate Features

wgpu now exposes backend feature for the Direct3D 12 (`dx12`) and Metal (`metal`) backend. These are enabled by default, but don't do anything when not targeting the corresponding OS.
By daxpedda in [4815](https://github.com/gfx-rs/wgpu/pull/4815).

Direct3D 11 Backend Removal

This backend had no functionality, and with the recent support for GL on Desktop, which allows wgpu to run on older devices, there was no need to keep this backend.
By valaphee in [4828](https://github.com/gfx-rs/wgpu/pull/4828).

`WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER` Environment Variable

This adds a way to allow a Vulkan driver which is non-compliant per `VK_KHR_driver_properties` to be enumerated. This is intended for testing new Vulkan drivers which are not Vulkan compliant yet.
By i509VCB in [4754](https://github.com/gfx-rs/wgpu/pull/4754).

`DeviceExt::create_texture_with_data` allows Mip-Major Data

Previously, `DeviceExt::create_texture_with_data` only allowed data to be provided in layer major order. There is now a `order` parameter which allows you to specify if the data is in layer major or mip major order.
diff
let tex = ctx.device.create_texture_with_data(
&queue,
&descriptor,
+ wgpu::util::TextureDataOrder::LayerMajor,
src_data,
);


By cwfitzgerald in [4780](https://github.com/gfx-rs/wgpu/pull/4780).

Safe & unified Surface Creation

It is now possible to safely create a `wgpu::Surface` with `wgpu::Instance::create_surface()` by letting `wgpu::Surface` hold a lifetime to `window`.
Passing an owned value `window` to `Surface` will return a `wgpu::Surface<'static>`.

All possible safe variants (owned windows and web canvases) are grouped using `wgpu::SurfaceTarget`.
Conversion to `wgpu::SurfaceTarget` is automatic for any type implementing `raw-window-handle`'s `HasWindowHandle` & `HasDisplayHandle` traits, i.e. most window types.
For web canvas types this has to be done explicitly:
rust
let surface: wgpu::Surface<'static> = instance.create_surface(wgpu::SurfaceTarget::Canvas(my_canvas))?;


All unsafe variants are now grouped under `wgpu::Instance::create_surface_unsafe` which takes the
`wgpu::SurfaceTargetUnsafe` enum and always returns `wgpu::Surface<'static>`.

In order to create a `wgpu::Surface<'static>` without passing ownership of the window use
`wgpu::SurfaceTargetUnsafe::from_window`:
rust
let surface = unsafe {
instance.create_surface_unsafe(wgpu::SurfaceTargetUnsafe::from_window(&my_window))?
};

The easiest way to make this code safe is to use shared ownership:
rust
let window: Arc<winit::Window>;
// ...
let surface = instance.create_surface(window.clone())?;


All platform specific surface creation using points have moved into `SurfaceTargetUnsafe` as well.
For example:

Safety by daxpedda in [4597](https://github.com/gfx-rs/wgpu/pull/4597)
Unification by wumpf in [4984](https://github.com/gfx-rs/wgpu/pull/4984)

Add partial Support for WGSL Abstract Types

Abstract types make numeric literals easier to use, by
automatically converting literals and other constant expressions
from abstract numeric types to concrete types when safe and
necessary. For example, to build a vector of floating-point
numbers, Naga previously made you write:
rust

0.18.2

This release includes `naga` version 0.14.2. The crates `wgpu-core`, `wgpu-hal` are still at `0.18.1` and the crates `wgpu` and `wgpu-types` are still at `0.18.0`.

Bug Fixes

Naga
- When evaluating const-expressions and generating SPIR-V, properly handle `Compose` expressions whose operands are `Splat` expressions. Such expressions are created and marked as constant by the constant evaluator. By jimblandy in [4695](https://github.com/gfx-rs/wgpu/pull/4695).

0.18.1

0.18.0

For naga changelogs at or before v0.14.0. See [naga's changelog](naga/CHANGELOG.md).

Desktop OpenGL 3.3+ Support on Windows

We now support OpenGL on Windows! This brings support for a vast majority of the hardware that used to be covered by our DX11 backend. As of this writing we support OpenGL 3.3+, though there are efforts to reduce that further.

This allows us to cover the last 12 years of Intel GPUs (starting with Ivy Bridge; aka 3xxx), and the last 16 years of AMD (starting with Terascale; aka HD 2000) / NVidia GPUs (starting with Tesla; aka GeForce 8xxx).

By Zoxc in [4248](https://github.com/gfx-rs/wgpu/pull/4248)

Timestamp Queries Supported on Metal and OpenGL

Timestamp queries are now supported on both Metal and Desktop OpenGL. On Apple chips on Metal, they only support timestamp queries in command buffers or in the renderpass descriptor,
they do not support them inside a pass.

Metal: By Wumpf in [4008](https://github.com/gfx-rs/wgpu/pull/4008)
OpenGL: By Zoxc in [4267](https://github.com/gfx-rs/wgpu/pull/4267)

Render/Compute Pass Query Writes

Addition of the `TimestampWrites` type to compute and render pass descriptors to allow profiling on tilers which do not support timestamps inside passes.

Added [an example](https://github.com/gfx-rs/wgpu/tree/trunk/examples/timestamp-queries) to demonstrate the various kinds of timestamps.

Additionally, metal now supports timestamp queries!

By FL33TW00D & wumpf in [3636](https://github.com/gfx-rs/wgpu/pull/3636).

Occlusion Queries

We now support binary occlusion queries! This allows you to determine if any of the draw calls within the query drew any pixels.

Use the new `occlusion_query_set` field on `RenderPassDescriptor` to give a query set that occlusion queries will write to.

diff
let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
// ...
+ occlusion_query_set: Some(&my_occlusion_query_set),
});


Within the renderpass do the following to write the occlusion query results to the query set at the given index:

rust
rpass.begin_occlusion_query(index);
rpass.draw(...);
rpass.draw(...);
rpass.end_occlusion_query();


These are binary occlusion queries, so the result will be either 0 or an unspecified non-zero value.

By Valaphee in [3402](https://github.com/gfx-rs/wgpu/pull/3402)

Shader Improvements

rust
// WGSL constant expressions are now supported!
const BLAH: u32 = 1u + 1u;

// `rgb10a2uint` and `bgra8unorm` can now be used as a storage image format.
var image: texture_storage_2d<rgb10a2uint, write>;
var image: texture_storage_2d<bgra8unorm, write>;

// You can now use dual source blending!
struct FragmentOutput{
location(0) source1: vec4<f32>,
location(0) second_blend_source source2: vec4<f32>,
}

// `modf`/`frexp` now return structures
let result = modf(1.5);

0.17.3

Added:

* Support for occlusion queries.
* Support for render bundles.
* Support for IMGUI, via `wgpu.utils.imgui`.
* Wx is now a fully supported GUI backend.
* A `BaseEnum` class was added to `wgpu.utils`, so it can be used in downstream libs like pygfx.
* The `WGPUCanvas.add_event_handler()` method now has an `order` arg.

Changed:

* The flags and enums are implemented using a new enum class, enabling better static code analysis (i.e. autocompletion in IDE's).
* Native (desktop) features must now be specified in the same way as normal (WebGPU) features: lowercase and with hyphens between the words.
* Bindings can omit offset and size (the full size will be used). This makes our API follow WebGPU better.
* Support omitting fields from `BindGroupLayoutEntry`, `BufferBindingLayout`, `SamplerBindingLayout`, `StorageTextureBindingLayout`, `VertexState`. See https://github.com/pygfx/wgpu-py/pull/534 for details.
* In cases where a `view_dimension` is given, it must be provided as a string (e.g. '2d'). Ints are no longer allowed, because e.g. 2 does *not* mean '2d', which can be a source of confusion.

(Due to problems with the CD process, we had to bump the version a few times.)

Page 4 of 15

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.