Skip to content

v31.0.0

Latest

Choose a tag to compare

@cwfitzgerald cwfitzgerald released this 04 Dec 21:31
Immutable release. Only release title and notes can be modified.
v31.0.0

Major changes

The parking_lot feature of wgpu is removed

wgpu now always uses parking_lot for its locks when the std feature is enabled, through the new wgpu-sync crate. The parking_lot feature no longer exists. If you name the feature, remove it:

- wgpu = { version = "30", default-features = false, features = ["std", "parking_lot", "vulkan"] }
+ wgpu = { version = "31", default-features = false, features = ["std", "vulkan"] }

By @bushrat011899 in #9780.

Metal surfaces advertise CompositeAlphaMode::PreMultiplied instead of PostMultiplied

Metal surfaces now advertise CompositeAlphaMode::PreMultiplied instead of PostMultiplied. This matches the premultiplied alpha compositing that Core Animation performs for a non-opaque CAMetalLayer.

If you hard-coded PostMultiplied to get a transparent macOS window, you now get an UnsupportedAlphaMode validation error. Use PreMultiplied instead.

 surface.configure(&device, &wgpu::SurfaceConfiguration {
-    alpha_mode: wgpu::CompositeAlphaMode::PostMultiplied,
+    alpha_mode: wgpu::CompositeAlphaMode::PreMultiplied,
     // ...
 });

By @nicoburns in #9922.

DeviceDescriptor has new field default_queue

DeviceDescriptor has new field default_queue of type QueueDescriptor, which allows setting label for default device queue:

 wgpu::DeviceDescriptor {
   label: None
   required_features: adapter.features(),
   required_limits: adapter.limits(),
+  default_queue: wgpu::QueueDescriptor { label: None },
   // ...
 }

By @sagudev in #10109.

TEXTURE_COMPONENT_SWIZZLE feature and swizzle field in TextureViewDescriptor

A new swizzle field is in TextureViewDescriptor used for mapping red/green/blue/alpha channels of the texture view when accessed by shaders. This requires TEXTURE_COMPONENT_SWIZZLE feature if swizzle is not identity.

let texture_view_desc = wgpu::TextureViewDescriptor {
    label: None,
    format: Some(wgpu::TextureFormat::Rgba8Unorm),
    dimension: Some(wgpu::TextureViewDimension::D2),
    usage: None,
    aspect: wgpu::TextureAspect::All,
    base_mip_level: 0,
    mip_level_count: None,
    base_array_layer: 0,
    array_layer_count: None,
+   swizzle: wgpu::TextureComponentSwizzle::default(),
}

By @beicause in #9553.

BufferViews block unmapping of Buffer on native

On native, a BufferView could read freed memory if its buffer was destroyed, or unmapped because the device was lost, while the view was alive. BufferView and BufferViewMut now block the unmap of the native buffer until all views are dropped. Keep views alive for as short a time as possible.

Buffer::destroy and Device::destroy now panic if a BufferView or BufferViewMut is alive. Buffer::unmap already did this.

To prevent deadlocks, do not keep views alive across Device::poll, Queue::submit, or Surface::configure. These calls can destroy the buffer, and thus unmap it, if the device is lost.

By @sagudev in #10307.

get_mapped_range and get_mapped_range_mut must match the MapMode

get_mapped_range now returns an error if the buffer is mapped with MapMode::Write. This includes buffers created with mapped_at_creation: true. Use get_mapped_range_mut for these buffers. get_mapped_range_mut now returns an error if the buffer is mapped with MapMode::Read.

By @sagudev in #10307.

Queue::submit returns Option<SubmissionIndex>

Queue::submit now returns Option<SubmissionIndex>. It returns None if the submission failed. A None result means the submission never reached the driver, so fences/events/semaphores attached to HAL queues will never be signalled. On the WebGPU backend it always returns None, because that backend cannot wait for a specific submission.

  let index = queue.submit([encoder.finish()]);
- device.poll(wgpu::PollType::Wait { submission_index: Some(index), timeout: None })?;
+ device.poll(wgpu::PollType::Wait { submission_index: index, timeout: None })?;

By @teoxoy in #10218.

TextureDescriptor has new field texture_binding_view_dimension, new downlevel flag ARBITRARY_BINDING_VIEW_DIMENSIONS

TextureDescriptor has a new field texture_binding_view_dimension, implementing WebGPU's textureBindingViewDimension. On devices without the new DownlevelFlags::ARBITRARY_BINDING_VIEW_DIMENSIONS (GLES/WebGL), texture bindings must use a view of this dimension, None infers it from the texture's dimension and layer count, and CubeArray requires DownlevelFlags::CUBE_ARRAY_TEXTURES and a layer count that is a multiple of 6. Devices with the downlevel flag ignore it. Texture::texture_binding_view_dimension() returns the resolved value. This allows specifying a binding view dimension that was otherwise only inferred from a heuristic for GLSL that could get it wrong.

Example for a cube map:

 wgpu::TextureDescriptor {
     size: wgpu::Extent3d { width: 256, height: 256, depth_or_array_layers: 6 },
     dimension: wgpu::TextureDimension::D2,
     // ...
+    texture_binding_view_dimension: Some(wgpu::TextureViewDimension::Cube),
 }

Breaking for custom backends: Implementations of TextureInterface must implement texture_binding_view_dimension.

By @alextechcc in #8014.

DXGI swapchain for Vulkan on Windows

The Vulkan backend can now present via a DXGI swapchain on Windows. DXGI swapchains generally perform more consistently, give more control over frame pacing, and may use optimizations that are not available to native vulkan swapchains. For now this is a default-off feature, though in the future it may be enabled by default.

Turn it on at instance creation, or if your program is using wgpu environment variables set WGPU_VULKAN_SWAPCHAIN_KIND to native, dxgi-hwnd, or dxgi-visual:

  let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
      backends: wgpu::Backends::VULKAN,
+     backend_options: wgpu::BackendOptions {
+         vulkan: wgpu::VulkanBackendOptions {
+             swapchain_kind: wgpu::VulkanSwapchainKind::DxgiFromHwnd,
+             ..Default::default()
+         },
+         ..Default::default()
+     },
      ..Default::default()
  });

Nsight and Radeon GPU Profiler should work normally, and all graphics debuggers should still broadly function, but RenderDoc will only capture the D3D12 work, unless you explicitly use Device::start_graphics_debugger_capture on the wgpu device to capture the vulkan work. RenderDoc does not support DirectComposition, so it does not work with DxgiFromVisual. The interop D3D12 device honors the same Agility SDK configuration as the DX12 backend, via VulkanBackendOptions::agility_sdk.

By @cwfitzgerald in #8388.

Added/New Features

General

  • Support the wasm64-unknown-unknown target for the web backend. Building for wasm64 requires a nightly toolchain with -Z build-std=std,panic_abort. By @nickbabcock in #9836.

  • wgpu-core now exposes validate_device_descriptor and validate_texture_descriptor functions that perform the same descriptor validation the corresponding resource creation APIs would, without actually creating a resource. This may be useful in conjunction with hal raw APIs. By @andyleiserson in #9967 and #9979.

  • Many types now offer pub const fn default() in addition to implementing the Default trait, allowing constants to make use of default values. By @kpreid in #9929.

  • wgpu-core builds without std, so wgpu can use the core backends in no_std environments. By @bushrat011899 in #9859.

  • Added TextureDescriptor::theoretical_memory_footprint to estimate memory footprint of a texture. By @sagudev in #10032.

  • wgpu::WriteOnly<[_]> now implements Send. By @kpreid in #10163.

  • Added Texture::mark_externally_initialized() to stop a texture from being lazily cleared if it was written to externally (e.g. via as_hal). By @R-Cramer4 in #10075.

  • Added the following members to Limits:

    • Limits::max_storage_buffers_in_vertex_stage
    • Limits::max_storage_buffers_in_fragment_stage
    • Limits::max_storage_textures_in_vertex_stage
    • Limits::max_storage_textures_in_fragment_stage

    These match the limits that were added to WebGPU. Otherwise, they are not meaningfully distinct from Limits::max_storage_{buffers,textures}_per_shader_stage, because compatibility mode is not yet implemented (see #8124).

    By @ErichDonGubler in #8764.

  • Zero-size vertex and index buffer bindings are now accepted by set_vertex_buffer and set_index_buffer. By @andyleiserson in #9848.

  • Added the snorm10-10-10-2 vertex format on Metal and Vulkan. Not yet supported on DX12. By @andyleiserson in #10226.

  • Support NetBSD. By @0323pin in #10316.

  • Add support for shader debugPrintf in Metal and Vulkan, behind a wgsl extension. By @39ali in #9389.

  • Added the following methods to RenderBundleEncoder for recording debug markers and groups:

    • insert_debug_marker(&mut self, label: &str)
    • push_debug_group(&mut self, label: &str)
    • pop_debug_group(&mut self)

    wgpu-core now validates debug group balance at finish() and replays debug annotations when executing render bundles. InstanceFlags::DISCARD_HAL_LABELS suppresses native debug annotations without disabling validation.

    Breaking for custom backends: Implementations of RenderBundleEncoderInterface must implement these three new methods.

    By @jinleili in #10308.

  • Added Utf16SourceLocation which is analogue to SourceLocation but using UTF-16 code units. Added Utf16SourceLocation::to_utf8 and SourceLocation::to_utf16 to convert between them. By @sagudev in #10294.

  • Add as_core and from_core methods on various wgpu resources. By @sagudev in #10211.

  • Add StagingBelt::discard_free_chunks to release free chunks that were not used since the last recall. StagingBelt is now available without std. By @HigherOrderLogic in #10383 and #10699.

  • Added Features::UNRESTRICTED_BYTES_PER_ROW: bytes_per_row in copy_buffer_to_texture and copy_texture_to_buffer need only be a multiple of the texel block copy size, not of 256. Supported on Vulkan, Metal, GL, and DX12 with UnrestrictedBufferTextureCopyPitchSupported. By @michael-dm in #10619.

  • Add experimental ray tracing pipelines: Device::create_ray_tracing_pipeline, CommandEncoder::begin_ray_tracing_pass, and RayTracingPass::trace_rays. Requires Features::EXPERIMENTAL_RAY_TRACING_PIPELINES. By @Vecvec in #10144.

  • The format string of debugPrintf is now checked for correctness. By @evilpie in #9641.

  • Added wgt::Features::CORE_FEATURES_AND_LIMITS, which is reported only when the adapter supports WebGPU default limits and its downlevel capabilities are WebGPU-compliant. By @sagudev in #10293.

  • Added TextureDescriptor::default_view_dimension to get the view dimension a texture's views default to. By @alextechcc in #8014.

  • Add TlasInstance::from_blas_untransformed and TlasInstance::from_blas_transformed for easier construction and readability in simple cases. By @Vecvec in #10476.

  • Added Queue getter on Device. By @sagudev in #10895.

  • Expose is_surface_supported on Device. By @sagudev in #10896.

  • Add Queue::present_with_damage, which takes the regions that changed since the last present as a hint for the compositor. Implemented for Vulkan (VK_KHR_incremental_present) and EGL (EGL_KHR_swap_buffers_with_damage / EGL_EXT_swap_buffers_with_damage); ignored elsewhere. Adds wgpu::Rect, moved from wgpu_core::command::Rect. By @sauliusvl in #10152.

  • Add SurfaceColorSpace::PassThrough on Vulkan and Metal, mapped to VK_COLOR_SPACE_PASS_THROUGH_EXT and a nil CAMetalLayer.colorspace, respectively, so applications can manage surface color interpretation themselves. By @yikerman in #10546.

  • Add flags for changing behaviour of TlasInstances. By @Vecvec in #11080.

  • Add RayTracingPass::trace_rays_indirect, which reads the number of rays from a buffer. Requires Features::EXPERIMENTAL_RAY_TRACING_PIPELINES_INDIRECT, which is supported on Vulkan. By @JMS55 in #11077.

naga

  • immediate_address_space WGSL language extension is implemented. By @beicause in #9711.
  • Add @builtin(hit_barycentrics), a vec2<f32> readable in @any_hit and @closest_hit ray tracing pipeline shaders, holding two of the barycentric coordinates of the hit point on the triangle (the third is 1.0 - x - y). Currently only supported with the SPIR-V backend. By @JMS55 in #10193.
  • Implement constant evaluation of the extractBits, insertBits, faceForward, reflect, and refract built-in functions. Evaluates expression at compile time to report issues early like offset and count selecting bits beyond the width of the data. By @MinerSheep in #10258.
  • Support WGSL bitcast between vec2<f16> and 32-bit scalars, between vec4<f16> and vec2 of 32-bit scalars, between f16 and i16/u16 (with wgpu_int16), and the corresponding SPIR-V OpBitcasts. By @DouglasDwyer in #10613.
  • Add the wgpu_ray_tracing_invocation_reorder WGSL enable-extension and the matching Capabilities::RAY_TRACING_INVOCATION_REORDER, exposing hit objects and shader invocation reordering. It provides the hit_object type, which records the result of a ray traversal without running any hit or miss shader, various hitObject* built-in functions, and reorderThread, which reorders invocations of a @ray_generation shader to improve coherence. Currently only supported with the SPIR-V backend. Enable it with Features::EXPERIMENTAL_RAY_TRACING_INVOCATION_REORDER, which also requires Features::EXPERIMENTAL_RAY_TRACING_PIPELINES and is supported on Vulkan with VK_EXT_ray_tracing_invocation_reorder. reorderThread may be a no-op. Check whether Adapter::ray_tracing_invocation_reorder_mode reports RayTracingInvocationReorderMode::Reorder to see if invocations will be reordered. By @JMS55 in #10311 and #10871.
  • Support SPIR-V's OpGroupNonUniformBallotFindLSB/MSB and GLSL's subgroupBallotFindLSB/MSB with the new Statement::SubgroupBallotFindBit. HLSL, MSL, and WGSL output use a polyfill. The GLSL frontend now also accepts gl_SubgroupSize and gl_SubgroupInvocationID. By @nazar-pc in #9966.
  • Parse NonSemantic.DebugPrintf instructions in SPIR-V shaders. By @evilpie in #10561.
  • texture_and_sampler_let WGSL language extension is implemented. By @apollo-2006 in #11108.

DX12

  • Support Features::SHADER_EARLY_DEPTH_TEST on DX12. Naga's HLSL backend now emits [earlydepthstencil] for @early_depth_test(force), SV_DepthGreaterEqual/SV_DepthLessEqual for @early_depth_test(greater_equal/less_equal) on pipelines that are not multisampled, and discards the depth output for @early_depth_test(unchanged). Callers of Naga's HLSL backend can set the new naga::back::hlsl::PipelineOptions::multisampled. By @DouglasDwyer in #10624.

Vulkan

  • Add OpenHarmony surface support via VK_OHOS_surface. Previously the Vulkan backend could not create a surface on OpenHarmony, leaving GLES as the only usable backend. By @ozongzi in #9908.

Metal

  • Support Features::SHADER_EARLY_DEPTH_TEST on Metal. Naga's MSL backend now emits [[early_fragment_tests]] for @early_depth_test(force), depth(greater)/depth(less) for @early_depth_test(greater_equal/less_equal), and discards the depth output for @early_depth_test(unchanged) and @early_depth_test(force). By @DouglasDwyer in #10625.
  • Metal now runs fixed-count multi-draws of 512 or more draws through GPU-generated indirect command buffers, instead of one indirect draw per command on the CPU. This is off with InstanceFlags::STRICT_WEBGPU_COMPLIANCE. The memory they hold is reported as HalCounters::indirect_command_buffer_memory, and pooled ones unused for two seconds are released. By @matthargett in #9640.
  • Added support for NV12 and P010 texture formats. Due to no native support, they're implemented using separate textures for each plane. By @jerzywilczek in #9624.
  • Add Features::COMPUTE_PIPELINE_SUBGROUP_SIZE and ComputePipeline::get_subgroup_size, which returns the pipeline's subgroup size when the feature is enabled. Supported on Metal, where the value is threadExecutionWidth. By @Vollkornaffe in #9876.

GLES

  • Add ANGLE as an opt-in OpenGL backend on Windows via cfg(windows_angle), while keeping the angle feature for ANGLE on macOS/iOS. By @csmoe in #9422.

WebGL

  • Add Device::create_texture_from_webgl_handle, Device::as_webgl_texture, and Device::as_webgl_context for zero-copy interop between wgpu's WebGL (GLES) backend and raw web_sys::WebGlTexture handles. By @AdrianEddy in #9834.
  • Queue::copy_external_image_to_texture now accepts ExternalImageSource::OffscreenCanvas without DownlevelFlags::UNRESTRICTED_EXTERNAL_TEXTURE_COPIES. By @AdrianEddy in #9834.
  • Uploading an ExternalImageSource::VideoFrame on the GLES backend no longer requires building with --cfg web_sys_unstable_apis (the corresponding web-sys APIs are stable now). By @AdrianEddy in #9834.

WebGPU

  • Add Device::import_external_texture to bind a GPUExternalTexture sampled from an HTMLVideoElement or WebCodecs VideoFrame, without a copy. By @AdrianEddy in #9936.
  • The subgroups feature (and any other features added in the future) will now be reported by the WebGPU backend, if reported by the underlying WebGPU implementation. By @andyleiserson in #10265.

Hal

  • Add BufferBinding::buffer, a public read accessor for the bound buffer, which was previously inaccessible to out-of-tree wgpu_hal::Api implementations. By @danlehmann in #9820.
  • Add wgpu_hal::vulkan::Surface::set_next_present_chain, which attaches a caller-provided pNext chain to the VkPresentInfoKHR of the surface's next presentation. With Adapter::open_with_callback to enable the device extension, this supports presentation extensions wgpu has no dedicated support for, such as VK_NV_present_metering for metering the display timing of frame-generation frames. By @stuartparmenter in #9847.
  • Allow specifying a queue family ownership transfer when transitioning a texture. hal::TextureBarrier gained an optional queue_family_ownership_transfer field (honored only by the Vulkan backend) so that images imported from external memory can be acquired from and released back to the queue family of an external or foreign owner, described by the new hal::QueueFamily enum. Resolves #2948. By @alexander-bruun in #9668.
  • Add wgpu_hal::vulkan::Surface::set_next_swapchain_create_chain and wgpu_hal::vulkan::Queue::set_next_submit_chain. The first attaches a caller-provided pNext chain to the VkSwapchainCreateInfoKHR of the surface's next configuration. The second attaches one to the VkSubmitInfo of the queue's next submission. Together with set_next_present_chain and the existing raw-handle accessors, this makes VK_NV_low_latency2 usable on a wgpu swapchain. That extension is the Vulkan interface for NVIDIA Reflex. By @stuartparmenter in #10095.
  • Add wgpu_hal::vulkan::AccelerationStructure::raw_handle, which returns the underlying VkAccelerationStructureKHR. Use it with Adapter::open_with_callback to record acceleration structure commands from extensions wgpu doesn't support, such as VK_NV_cluster_acceleration_structure. Mark the result with CommandEncoder::mark_acceleration_structures_built. By @stuartparmenter in #10187.
  • Add wgpu_hal::dx12::Adapter::device_from_raw to create a device from an existing ID3D12Device and ID3D12CommandQueue. By @rdeioris in #10662.
  • Added CommandEncoder::encode_deferred_multi_draws (default no-op). Backends may defer part of the work for indirect multi-draws recorded in a render pass; after ending such a pass, callers must invoke this method while recording a command buffer that the queue executes before the pass's. wgpu-core does this in its internal pre-pass. By @matthargett in #9640.
  • Add wgpu_hal::metal::Buffer::raw_handle, returning the underlying MTLBuffer, mirroring Texture::raw_handle. By @jf--- in #10924.
  • Add GLES DMA-BUF texture import with specific errors reported through gles::ImportTextureError. By @terjdev in #10522.

Changes

General

  • WGPU_DX12_COMPILER and Dx12Compiler::from_str now treat a value that is not fxc, dxc, dynamicdxc, staticdxc, or auto as a path to the DXC DLL. By @teoxoy in #9619.
  • Allow set_immediates before set_pipeline by deferring actual setting of immediates to draw/dispatch call time. By @beicause in #9597.
  • Validate pipeline layout immediate_size and fix its calculation when there are multiple immediate variables. Now it must be >= required size of the shader entry point. By @beicause in #9711.
  • TextureFormat::is_srgb() has been renamed to TextureFormat::has_srgb_suffix() to clarify its function. By @kpreid in #9758.
  • Remove the never-constructed CreateBlasError::InvalidAabbStride variant. create_blas takes no stride, so it could never be produced; AABB stride is validated at build time as BuildAccelerationStructureError::InvalidAabbStride. By @mstampfli in #9935.
  • BlendFactor::ref_second_blend_source is renamed to BlendFactor::uses_second_blend_source. By @andyleiserson in #9939.
  • Added DownlevelFlags::LINEAR_INTERPOLATION, indicating that the adapter supports @interpolate(linear). It is absent on GLES/WebGL2, since GLSL ES has no noperspective qualifier. By @emilk in #9972.
  • Breaking for custom backends: The dispatch traits have new required methods for buffer, texture, and query set properties, for ray tracing pipelines and passes, and for Device::queue, Device::is_surface_supported, ComputePipeline::get_subgroup_size, and Adapter::ray_tracing_invocation_reorder_mode. QueueInterface::submit returns Option<u64>. Vertex and index buffer binding sizes are Option<BufferAddress>. SurfaceInterface::get_current_texture takes a texture descriptor, and Texture::from_custom no longer takes one. By @sagudev in #10100 and #10108, and others.
  • DeviceDescriptor::map_label now takes an Fn instead of an FnOnce. By @sagudev in #10109.
  • TextureUses::DEPTH_STENCIL_READ and TextureUses::DEPTH_STENCIL_WRITE are replaced by DEPTH_READ, DEPTH_WRITE, STENCIL_READ, and STENCIL_WRITE. TextureUses is now a u32. This affects callers of CommandEncoder::transition_resources and Device::create_texture_from_hal. DepthStencilState::is_read_only is removed; use is_depth_read_only and is_stencil_read_only. By @beicause in #9763.
  • Device::create_texture_from_hal has a new cleared argument. Pass true only if the contents of the texture are valid. If you pass false, wgpu clears the texture before its first read. By @R-Cramer4 in #10076.
  • Instance::from_core is now safe and takes an Arc<wgpu_core::instance::Instance>. Instance::generate_report is removed. By @sagudev in #10176 and #9950.
  • Buffer::unmap will not raise any validation errors anymore per specification. By @sagudev in #10242.
  • wgpu::Error::Validation::description from Device::create_shader_module no longer include the shader source text and detailed compiler messages, per the WebGPU specification. These details remain accessible via ShaderModule::get_compilation_info. By @beicause and @sagudev in #10173.
  • BufferUsages is now composed of BufferUsagesWebGPU and BufferUsagesWGPU, similarly to Features. In most cases this is not expected to be a breaking change, but changes might be required for converting BufferUsages to/from u32. By @sagudev in #10195.
  • Surface::configure now destroys a previously acquired SurfaceTexture that is still alive, instead of failing. Pending buffer map callbacks are now called when configuration fails. By @sagudev in #10296 and #10686.
  • ShaderStages is now composed of ShaderStagesWebGPU and ShaderStagesWGPU, similarly to Features. In most cases this is not expected to be a breaking change, but changes might be required for converting ShaderStages to/from u32. By @sagudev in #10313.
  • request_adapter will return error on InstanceFlags::STRICT_WEBGPU_COMPLIANCE if the adapter has already been consumed by a previous request_device. By @sagudev in #10444.
  • DownlevelFlags::compliant() no longer includes SURFACE_VIEW_FORMATS. By @shiena in #10425.
  • The variants of wgpu_core::validation::StageError related to entry point selection have been reorganized. By @jimblandy in #10544.
  • clear_texture now rejects a request to clear only some aspects of a texture. Previously such a request would clear all aspects of the texture. By @andyleiserson in #10684.
  • Device::poll now always returns PollError::CantWait if called with PollType::Wait on the WebGPU backend. By @teoxoy in #10218.
  • TlasInstance::new has new intersection_index and flags arguments. Pass 0 and AccelerationStructureInstanceFlags::empty() for the previous behavior. By @Vecvec in #10144 and #11080.
  • DownlevelFlags::SHADER_F16_IN_F32 has been removed. It previously blocked broken quantizeToF16, pack2x16float, and unpack2x16float on older llvmpipe / lavapipe. Using wgpu with an up-to-date Mesa version is always recommended. By @szymros in #10820.
  • Texture copy extents are now correctly validated for subsampled chroma planes. Copying is now supported between a plane of a multi-planar texture and other textures or buffers, in either direction. By @andyleiserson in #10776.
  • Resources passed to RenderBundleEncoder and util::RenderEncoder no longer need to outlive the encoder. External RenderEncoder implementations must update all six resource-taking methods to accept independent argument lifetimes instead of the trait's 'a lifetime. By @mvanhorn in #10839.
  • When a device is lost because of a backend error, wgpu-core now logs an error with the location in wgpu-core that reported it, the adapter name, its PCI vendor and device IDs, and the driver name and version. The Vulkan backend also logs the VkResult of an error it did not expect. The message passed to the device-lost callback is unchanged. By @matthargett in #11172.
  • request_device enables Features::CORE_FEATURES_AND_LIMITS if the adapter supports it. With InstanceFlags::STRICT_WEBGPU_COMPLIANCE, the requested limits are raised to at least the WebGPU defaults. By @sagudev in #11049.

naga

  • naga::valid::ValidationError is now always returned boxed, to avoid clippy::large_result_err warning. By @beicause in #9612.
  • Added naga::valid::Capabilities::LINEAR_INTERPOLATION, which is now required in order to use @interpolate(linear). By @emilk in #9972.
  • The GLSL backend's MissingFeatures error now names the GLSL version that lacks the features, e.g. GLSL 300 es doesn't support the required feature(s): NOPERSPECTIVE_QUALIFIER. By @emilk in #9972.
  • Bit reinterpretation is now represented in the Naga IR by the new naga::ir::Expression::Bitcast, which names its result type. naga::ir::Expression::As now only converts, and its kind and convert fields are replaced by target: Scalar. By @DouglasDwyer in #10613.
  • The SPIR-V backend replaces NaN components of cube texture sample coordinates with zero, so the selected face is the same on all drivers. By @teoxoy in #10905.
  • WGSL shaders must declare enable wgpu_f64; to use the f64 type or the lf literal suffix. By @stefnotch in #10982.

Vulkan

  • Sub-allocate wgpu_hal::MemoryFlags::TRANSIENT buffers and acceleration structure build scratch from a separate Vulkan memory pool, so short-lived allocations no longer pin memory blocks shared with long-lived resources. By @stuartparmenter in #10232.
  • wgpu_hal::vulkan::TextureMemory::Allocation now holds a wgpu_hal::vulkan::MemoryAllocation instead of a gpu_allocator::vulkan::Allocation. By @stuartparmenter in #10232.
  • Allocate acceleration structures created with AccelerationStructureFlags::ALLOW_COMPACTION from the transient Vulkan memory pool, since they are usually replaced by their compacted copies. By @stuartparmenter in #10233.
  • Removed the VULKAN_GOOGLE_DISPLAY_TIMING, VULKAN_EXTERNAL_MEMORY_WIN32, VULKAN_EXTERNAL_MEMORY_FD, and VULKAN_EXTERNAL_MEMORY_DMA_BUF features. wgpu enables the corresponding Vulkan extensions whenever the adapter supports them. To check for support, use Adapter::as_hal::<wgpu::hal::api::Vulkan>() and call physical_device_capabilities().supports_extension() with the extension name. By @andyleiserson in #10635.
  • Renamed wgpu_hal::vulkan::Device::texture_from_d3d11_shared_handle to texture_from_shared_handle. It has a new handle_type argument: pass vk::ExternalMemoryHandleTypeFlags::D3D11_TEXTURE for the previous behavior, or D3D12_RESOURCE for an ID3D12Resource shared handle. By @cwfitzgerald in #8388.
  • wgpu_hal::vulkan::Instance::from_raw has new swapchain_kind and agility_sdk arguments. Pass VulkanSwapchainKind::Native and None for the previous behavior. By @cwfitzgerald in #8388.

Metal

  • Removed the size argument to wgpu_hal::metal::Device::buffer_from_raw. The passed size value was previously used only to resolve vertex buffer bindings without an explicit size, possibly incorrectly. Binding sizes are now resolved in wgpu-core. By @andyleiserson in #9848.
  • The value of the max_binding_array_sampler_elements_per_shader_stage on Apple7, Apple8, and Mac2 hardware is reduced from 1024 to 996, to match the latest Metal documentation. By @andyleiserson in #10649.
  • When cfg(debug_assertions) is active and the Metal capture device is detected (e.g. if running the application under Xcode), print a warning that feature detection may be degraded. Without cfg(debug_assertions), remove the feature detection workaround in question entirely. By @andyleiserson in #9757. Also see #10028.

Hal

  • Removed wgpu_hal::gles::Instance::egl_config. By @csmoe in #9422.
  • wgpu_hal::dx12::Device::texture_from_raw and buffer_from_raw have a new drop_callback argument. Pass None for the previous behavior. By @Aandreba in #10303.
  • TextureDescriptor has a new field texture_binding_view_dimension. It must be Some on devices without DownlevelFlags::ARBITRARY_BINDING_VIEW_DIMENSIONS (the GLES backend allocates the texture's GL target from it), and is ignored otherwise. By @alextechcc in #8014.
  • hal::Queue::present gained a damage_rects: &[wgt::Rect<u32>] parameter. The rects must be non-empty and within the surface. Pass an empty slice for the previous behavior. By @sauliusvl in #10152.

Bug Fixes

General

  • Zero-initialize padding (if any) at the end of a buffer allocation. This was application-visible in rare cases on Vulkan when a shader read beyond the valid range of a vertex buffer. By @andyleiserson in #9791.
  • Fix required immediate slots calculation and remove naga::valid::FunctionInfo::immediate_slots_used. By @beicause in #9725.
  • Fix various deadlocks due to inconsistent ordering of lock acquisitions. wgpu is now tested with lock rank checking (--cfg wgpu_validate_locks) in CI, which should prevent many deadlocks in the future. By @AdrianEddy in #9960, @mstampfli in #10118, and @andyleiserson in #9728 and #9479.
  • Fix initialization tracking for some cases of array textures, 3d textures, and depth/stencil textures with divergent usage in a render pass. By @andyleiserson in #10002 and #10060.
  • Fix a spurious assertion failure in Device::maintain when multiple threads race polling the same device. By @AdrianEddy in #9958.
  • In Queue::submit, validate all command buffers before making any updates to the init trackers. This is not expected to affect performance or behavior when handling successful submission. By @andyleiserson in #10003.
  • Fixed some cases of passing object labels to platform APIs despite InstanceFlags::DISCARD_HAL_LABELS being set. By @andyleiserson in #10121 and #10123.
  • Fix separate depth/stencil read-only state and SYNC-HAZARD-WRITE-AFTER-WRITE Vulkan validation error. By @beicause in #9763.
  • Clean up resources properly when Device::new fails, to avoid a leak or panic. By @andyleiserson in #10160.
  • Fix Buffer::unmap failing with NotMapped when it races a Buffer::map running on another thread. By @AdrianEddy in #9959.
  • Fix pending buffer mappings incorrectly succeeding when the device is lost before they are processed. By @jinleili in #10301.
  • Fix initialization tracking for external_texture binding points, for both ExternalTextures and TextureViews bound to them. By @ErichDonGubler in #10276 and #10366.
  • Fixed multiplanar textures not being zero initialized. By @inner-daemons in #9700.
  • Make TextureBlitter respect the sample_type when performing downsampling. Previously, FilterMode::Nearest was always used when copying a larger texture to a smaller one. By @DouglasDwyer in #10657.
  • Fixed some cases where Adapter::get_texture_format_features and TextureFormat::guaranteed_format_features did not match the validation applied by create_texture. By @andyleiserson in #10910.
  • STORAGE_BINDING usage is no longer allowed for multi-planar textures. It was previously accepted, but was untested, and likely broken. By @andyleiserson in #10910.
  • Make wgpu-core build with --no-default-features by fixing the logic in wgpu_core::lock. By @jimblandy in #10972.
  • Fix Surface::configure and dropping a Surface or Queue racing with queue operations on other threads, which could crash on Vulkan. By @AdrianEddy in #10675.
  • Fix the start state of a texture subresource that a pass uses for the first time in a command buffer that already uses other subresources of the same texture. If the pass used the subresource in two ways, the subresource began the submission in the wrong state. By @cwfitzgerald in #10212.
  • Fix a panic on Metal and DX12, and a Vulkan validation error, when set_immediates writes past the immediate size of the current pipeline layout, including layouts with no immediates. Fix a DX12 panic when a pipeline layout has immediates that are never set. By @cwfitzgerald in #10903.
  • Fix a panic in indirect draw validation on the noop backend. By @cwfitzgerald in #10959.
  • Fix <pass_or_bundle>.set_bind_group(_, None, _) causing a later draw or dispatch to incorrectly validate shader requirements. By @ErichDonGubler in #11198.
  • Fix a bug when a pipeline layout was replaced in the same pass with a layout that had a gap. By @andyleiserson in #11203.
  • Fix multi_draw_indirect and multi_draw_indexed_indirect with a count of 0 doing one draw, or panicking when the offset was at the end of the buffer. By @zsh20070718 in #11235.

naga

  • Fix Naga's Metal backend crashing when a storage texture was used as a function argument. By @ErichDonGubler in #9867.
  • Fix panics when shader var<immediate> size is larger than 256 bytes. By @beicause in #9725.
  • Replace embedded NUL characters with ? when writing debug strings to SPIR-V. By @andyleiserson in #9904.
  • Fix dynamic indexing of vectors in var<immediate> in the SPIR-V backend. Non-uniform indices could read the wrong element, such as always element 0 on RADV. By @jimblandy in #9902.
  • Fix a panic in the SPIR-V frontend when a subgroup collective operation (e.g. OpGroupNonUniformUMin) or OpGroupNonUniformBallot used an argument whose value needed to be spilled to a temporary variable, such as when the argument was computed inside a loop. By @nazar-pc in #9957.
  • Fix invalid HLSL generated for textureSampleLevel with non-2D textures. By @mvanhorn in #9951.
  • Reject WGSL unary operators applied to types that the operator does not support, such as negating a matrix. By @BenjaminBrienen in #10036.
  • Reject return types on compute shader entrypoints. By @ErichDonGubler in #10026.
  • Reject @location(…)s in compute shaders. By @ErichDonGubler in #10026.
  • Correctly emit primitive_index for the SPIR-V backend, handling mesh and raytracing shaders. Before, you could not use primitive_index with these shader types. An enable primitive_index statement is still required in wgsl shaders, in addition to enable wgpu_mesh_shader/enable wgpu_ray_tracing_pipeline. By @JMS55 in #10153.
  • Lower @builtin(instance_index) in @any_hit and @closest_hit entry points to SPIR-V's InstanceId rather than InstanceIndex, which Vulkan only permits in the vertex stage. By @JMS55 in #10154.
  • Prevent invalid IR from being generated when using a ray query in a loop. By @Vecvec in #9945.
  • Report WGSL type mismatches in return statements, function call arguments and composite constructors as WGSL errors naming both types, instead of IR validation errors that could only name the operands by handle index (such as "The `return` expression Some([1]) does not match the declared return type Some([1])"). By @emilk in #9973.
  • Fix Module::doc_comments's struct_members keys being off by the number of undocumented members preceding a documented one, so doc comments on struct members were attached to the wrong member. By @atirna in #10273.
  • Raise a type error, rather than panic, for some cases of an invalid select argument type in WGSL constant evaluation. By @ErichDonGubler in #10350.
  • Reject unsigned integer arguments to WGSL sign() during Naga validation instead of allowing them to reach and panic in the SPIR-V backend. By @notferdon in #10451.
  • Fix sign returning unexpected values for floating-point arguments in the HLSL backend. By @ErichDonGubler in #10434.
  • Reject WGSL loads of structs and arrays that contain atomics, which previously caused a panic in the HLSL backend. By @drakeo338 in #10458.
  • Panic when a SPIR-V's instruction's word count is greater than u16::MAX, instead of emitting a malformed instruction. By @ErichDonGubler in #10537.
  • Accept a ViewIndex input declared as a signed integer in the SPIR-V frontend, as glslang and Slang emit it, by reading it as a u32. By @VoxelBoy in #10568.
  • Declare LocalInvocationIndex only once in SPIR-V mesh shader entry points that don't take local_invocation_index as an argument. Previously these shaders were invalid SPIR-V. By @apollo-2006 in #10497.
  • Fix the MSL backend generating wrong code for a loop's continuing block when it refers to a value computed by the loop body, such as loop { let cmp = a < 8; ... continuing { break if cmp; } }. The value was re-evaluated in place, reading whatever the body had left behind, and for values produced by statements (such as a function call result) the backend panicked instead. By @teoxoy in #10459.
  • Fix invalid MSL generated for textureSampleGrad with 3D and cube textures, which emitted metal::gradient2d for every texture dimension. By @ErichDonGubler in #10573.
  • Fix invalid GLSL for textureLoad with a u32 level or sample index under the Restrict and ReadZeroSkipWrite bounds check policies. By @ilyas-mallah in #10704.
  • Fix var<immediate> members being read from the wrong offsets on DX12 when a nested struct is not 16-byte aligned. By @DouglasDwyer in #10581.
  • Disallow usage of ray_query as a binding. By @szymros in #10832.
  • Fix @builtin(position).w in fragment shaders on DX12. The HLSL backend now provides 1/w of the clip-space position, as WGSL specifies and the other backends already do, instead of w. By @abdymazhit in #10733.
  • Generate correct SPIR-V for nested structs containing two-row matrices. By @jimblandy in #10846.
  • Fix GLSL output for WGSL vector select with integer or boolean values on WebGL 2 and older OpenGL. By @arcusbuilds in #10457.
  • Fix rayQueryGenerateIntersection in the SPIR-V backend dropping nearer hits once a hit had been committed, which kept the first generated hit instead of the nearest. By @DouglasDwyer in #10698.
  • Fix ambiguous metal::select calls in the Metal backend's division/remainder zero guards for 64-bit integers: the guards now emit L/uL suffixed literals (e.g. metal::select(rhs, 1uL, rhs == 0uL)) so MSL generated for i64/u64 / and % compiles. By @Statesman-forge in #10278.
  • In the MSL backend, subgroupBallot now keeps lanes 32-63, which were lost on GPUs with 64-wide SIMD groups (AMD GPUs on macOS). By @ErkoRisthein in #10797.
  • Fix a panic in the HLSL backend when an unsized binding_array<T> global has no binding_array_size in its bind target; it is now written as an unbounded [] array. By @arcusbuilds in #10343.
  • Report a WGSL error instead of panicking when the condition of a const_assert is a composite value, such as const_assert(vec2i());. By @MilosLord in #10897.
  • Fix WGSL continuing blocks falsely rejecting declarations that shadow variables from the loop body (e.g., loop { let x = a; continuing { let x = b; } }) as redefinitions. By @ekarad1um in #10980.
  • Reject f64 arguments to the trigonometric, exponential and logarithmic built-in functions (sin, atan2, radians, exp, log, pow and others) during Naga validation (invalid SPIR-V and GLSL). By @cdeil in #11039.
  • Reject WGSL array value constructors with more than 2047 elements, as required by the WGSL specification. By @sagudev in #10891.
  • Fix the HLSL backend adding the draw's first instance or first vertex twice to @builtin(instance_index) and @builtin(vertex_index) values copied into a let, and not at all when a struct holding them is passed to a function. By @MikeGrier in #11090.
  • In the MSL backend, fix generated code for bitcast of a packed vec3 struct field. By @IsseW in #10961.
  • Fixed invalid HLSL due to duplicate function definitions when performing image queries on multiple storage textures differing only in access mode. By @andyleiserson in #11040.
  • Fix rayQueryGenerateIntersection in the WGSL frontend not emitting its hit_t argument before the statement that uses it, which made modules fail validation if hit_t was an expression such as a struct member access. By @DouglasDwyer in #10694.

Validation

  • Validate that the arguments are within the indirect buffer when encoding an indirect draw to a render bundle. Moves some indirect draw errors from RenderPassErrorInner to RenderCommandError. By @andyleiserson in #9871.
  • Reject texture views with TextureAspect::All on multi-planar textures. By @inner-daemons in #9703.
  • When creating render pipelines, validate that a corresponding shader output is present for each color attachment with non-zero write mask, and that shader output includes alpha when the blend operation uses source alpha. By @andyleiserson in #9939.
  • Reject bind group layout entries with TASK or MESH visibility unless Features::EXPERIMENTAL_MESH_SHADER is enabled. By @teoxoy in #10042.
  • Reject bind group layout entries with RAY_GENERATION, ANY_HIT, CLOSEST_HIT, or MISS visibility unless Features::EXPERIMENTAL_RAY_TRACING_PIPELINES is enabled. By @teoxoy in #10042.
  • Numeric types must now match exactly on inter-stage interfaces. Previously, the receiving type was only required to be a subtype of the originating type. By @andyleiserson in #9999.
  • Relaxed requirement that the pipeline scalar type for a color output be at least as wide as the shader output type. Now, only the scalar kind must match. By @andyleiserson in #9999.
  • Report an accurate validation error when a passthrough shader module has no entry points. By @ksh368-bit in #10079.
  • Disallow array types in var<immediate>. By @beicause in #10081.
  • Mesh shader draws in a multiview render pass now require the highest view in the multiview mask to be less than Limits::max_mesh_multiview_view_count. Previously one view past the limit was accepted. By @apollo-2006 in #10496.
  • wgpu_core now validates pipeline stage interfaces after pipeline constant values have been applied, per spec. For example, workgroup sizes set by overrides are now checked against device limits. By @jimblandy in #10430.
  • Validate Limits::max_compute_workgroup_storage_size. By @ErichDonGubler in #9732.

DX12

  • Load CreateDXGIFactory1 from dxgi.dll at runtime for the display HDR query, instead of linking to it. By @teoxoy in #9832.
  • Make sure padding bytes are 0 in the destination buffer after a copy_texture_to_buffer when UnrestrictedBufferTextureCopyPitchSupported is not available. By @teoxoy in #10005.
  • Sanitize shader labels before passing them to DXC as the source name. Fixes compilation when label contains a :. By @lucasmerlin in #10134.
  • Add the missing UAV barrier for acceleration structure scratch buffers. By @Vecvec in #10798.
  • Fix a use-after-free when several threads create pipelines from the same shader with FXC. The shader cache now holds copies of the bytecode, not FXC's blobs, whose reference count is not thread-safe. By @xorza in #10805.
  • Fix a 1 second stall in Surface::get_current_texture after a surface texture was dropped without being presented. By @DouglasDwyer in #10511.
  • Present with DXGI_PRESENT_RESTART the first time after a swapchain is created or resized, discarding queued frames of the old size that DWM would otherwise show stretched while the window is being resized. By @DouglasDwyer in #10548.
  • Fix 64-bit integer literal truncation and comparisons against zero in DX12 shaders compiled with DXC. By @pbkx in #10585.
  • Free the intermediate buffers of unaligned buffer/texture copies through the memory allocator. They were dropped without it, so their heap space stayed in use until the device was destroyed. By @fxOne in #11069.

Vulkan

  • Return an error instead of panicking when Vulkan surface creation fails, such as when creating a second surface for the same Android view. By @antonWetzel in #9806.
  • Use the imported queue family's supported shader stages when building buffer, texture, and acceleration structure barriers for raw Vulkan devices. By @ruihe774 in #9594.
  • Use the queue family index from queue_create_infos after the Vulkan device creation callback changes it. By @andyleiserson in #9965.
  • Fix false out-of-memory errors when creating textures with transient attachment usage on some Vulkan drivers, such as MoltenVK. By @andyleiserson in #9838.
  • Fix HalCounters::textures drifting negative: create_texture never incremented it while destroy_texture always decremented it. By @dustyleary in #10022.
  • Fix crash on older Vulkan drivers when poolSizeCount == 0. By @lucasmerlin in #10124.
  • Request VK_KHR_spirv_1_4 and raise the generated SPIR-V version to 1.4 when EXPERIMENTAL_RAY_TRACING_PIPELINES or EXPERIMENTAL_MESH_SHADER is enabled on a pre-Vulkan-1.2 device. Both SPV_KHR_ray_tracing and SPV_EXT_mesh_shader require SPIR-V 1.4, but shaders were generated as 1.3 there: ray tracing pipelines requested neither the extension nor the version, and mesh shaders requested the extension without raising the version. Naga now rejects ray tracing pipeline shaders targeting below SPIR-V 1.4, as it already did for mesh shaders. By @JMS55 in #10193.
  • Fix feature detection for Robust Image Access when VK_EXT_robustness2 is present but reports no support for Robust Image Access 2, fixing a shader compilation crash on some Mali drivers. By @raphlinus in #10291.
  • Fixed a panic on the Vulkan backend when dropping a surface whose acquired texture was still alive (e.g. after present failed due to a lost device). By @MarcelStruckWO in #10230.
  • Fix VUID-VkImageViewCreateInfo-image-04441 validation errors when creating a view of a texture whose only usages are COPY_SRC and/or COPY_DST. By @MannXo in #10245.
  • Recover from VK_ERROR_FRAGMENTED_POOL and VK_ERROR_OUT_OF_POOL_MEMORY when allocating descriptor sets by resetting or retiring the offending pool and retrying on the next available (or a freshly created) pool instead of panicking. By @beicause in #10264.
  • Don't use timeline semaphores on VeriSilicon's proprietary driver, as on NXP's i.MX 8 SoCs, which crashes in vkQueueSubmit with them. wgpu falls back to binary fences there. By @tronical in #10535.
  • Enable the depthBiasClamp device feature when it is supported. Pipelines with a non-zero DepthBiasState::clamp previously failed Vulkan validation. By @VoxelBoy in #10566.
  • On Windows, only wait for the swapchain acquire fence in Fifo and FifoRelaxed present modes. It added acquire latency in Immediate and Mailbox. By @HashimTheArab in #10714.
  • Polyfill workgroup zero init in mesh and task shaders on AMD's proprietary driver, which fails with VK_ERROR_INITIALIZATION_FAILED when they use OpVariable initializers. By @apollo-2006 in #10692.
  • Fix a crash in vkQueueSubmit on Imagination's proprietary driver and on the Android 16 emulator by passing a timeline value for every semaphore whenever a submission uses timeline semaphore values. By @laurenz-canva in #10677.
  • Fix a fence data race between submitting and polling on devices without timeline semaphores. By @JasperDeSutter in #10960.
  • Don't use timeline semaphores on Arm's proprietary Mali driver, which keeps memory for every value a timeline semaphore is signaled with until the semaphore is destroyed. Because wgpu signals one timeline semaphore per submission, long-running applications eventually lose the device (after ~4.2 million submissions on a Mali-G610 with driver g18p0). wgpu falls back to binary fences on Arm drivers older than r46 and Rockchip drivers older than g24. By @tadeohepperle in #10840.
  • Fix pass timestamp queries on Vulkan sometimes reporting a duration of almost zero for a render or compute pass, when the GPU was busy with other work. By @kikijiki in #10837.
  • Don't use timeline semaphores on Imagination's proprietary driver, as on TI's AM62P, where Device::poll with PollType::Wait and no timeout sometimes failed with PollError::Timeout. wgpu falls back to binary fences there. By @tronical in #10992.

Metal

  • Report SurfaceColorSpace::ExtendedDisplayP3 only on macOS 11.0+ and iOS 14.0+, where it is available. By @stuartparmenter in #9833.
  • Fix bind group resources for the task, mesh, fragment, and compute shader stages being bound from the wrong offsets whenever a bind group contained resources visible to the task or mesh stages, which could bind the wrong buffer, texture, or sampler to a shader slot. By @teoxoy in #10043.
  • Fix max_task_workgroup_count being misreported on pre-Apple7 devices. By @inner-daemons in #10065.
  • Fix a crash when creating a declared alternate sRGB view of a render-attachment-only surface with Metal API Validation enabled. By @jinleili in #10280.
  • Report an error instead of panicking when Metal declines to create a texture view, which can occur for some views of textures with TRANSIENT_ATTACHMENT usage. By @matthargett in #10145.
  • Fix a crash in Surface::configure on iOS below 16. wantsExtendedDynamicRangeContent is iOS 16+ and is now only called there. By @VladasZ in #10257.
  • Cap max_storage_buffer_binding_size to u32::MAX - 4 again. By @nuri-yoo in #10306.
  • Report DownlevelFlags::INDIRECT_EXECUTION and a 256-byte min_uniform_buffer_offset_alignment on the iOS Simulator (target_abi = "sim"). The Simulator advertises only the Apple2 GPU family but executes indirect draw/dispatch on the host GPU, so compute renderers such as vello previously failed with "Downlevel flags DownlevelFlags(INDIRECT_EXECUTION) are required but not supported". Note that Metal API Validation still rejects indirect commands there. By @edTheGuy00 in #10189.
  • Compile Metal passthrough shaders with the detected Metal Shading Language version. Before, they used the system default version and could fail to compile. By @acshi in #10574.
  • To avoid rendering failures in new windows (see #9430), do not return SurfaceStatus::Occluded from Surface::get_current_texture when it is called for a window that hasn't been visible yet. By @tronical in #10302.
  • Advertise TEXTURE_INT64_ATOMIC and R64Uint storage atomics on Apple8+Mac2 devices with MSL 3.1, restoring support for 64-bit texture atomic min/max on M2 Macs. By @urothis in #10604.
  • Fix the Metal fence value sometimes going backwards and wait sometimes reporting a lost device. By @uael in #10570.
  • Skip the render ICB probe on Macs with Tier 1 argument buffers, such as Haswell and Broadwell Intel GPUs. Compiling its kernel crashed the Metal shader compiler, which stalled device creation for about 10 seconds. By @ErkoRisthein in #10927.
  • Fix AccelerationStructureGeometryFlags::NO_DUPLICATE_ANY_HIT_INVOCATION being ignored when building BLASes on Metal. By @JMS55 in #11168.

GLES

  • Fixed signed integer % (and %=) returning the wrong result for negative operands in the GLSL (OpenGL/GLES) backend, e.g. -1 % 768 yielding 255 instead of -1. GLSL's % is undefined when either operand is negative, so signed remainder is now lowered as a - b * (a / b), matching the SPIR-V, HLSL, and Metal backends. By @mstampfli in #9687.
  • Fix negative argument for atomicSub yielding incorrect GLSL. By @ErichDonGubler in #9924.
  • Avoid duplicate EGL_SURFACE_TYPE attributes when selecting an EGL framebuffer configuration, which caused Mesa to return no matching configurations. By @BlueJayLouche and @scroix in #10048.
  • @interpolate(linear) is now rejected by Device::create_shader_module on adapters that lack DownlevelFlags::LINEAR_INTERPOLATION (GLES/WebGL2), with a shader label and a source span. Previously such a shader validated fine and then failed at pipeline creation with The selected version doesn't support Features(NOPERSPECTIVE_QUALIFIER). By @emilk in #9972.
  • Fixed copy_texture_to_texture() copying only the first depth slice when the copy extent had a depth greater than 1, so copies between 3D textures silently lost every slice after the first. Copies with a nonzero source z also read the wrong slice. By @AlexEgger2Build in #10004.
  • Fix black EGL surfaces on some platforms by selecting the default framebuffer's color buffer before presentation. By @valadaptive in #10268.
  • Enable TEXTURE_CUBE_MAP_SEAMLESS on desktop OpenGL so cube maps sample seamlessly across face edges, matching OpenGL ES 3.0+, WebGL 2, Vulkan, Metal, and Direct3D 12. By @kuntal-devrat in #10628.
  • Set a sampler's maximum anisotropy with glSamplerParameterf instead of glSamplerParameteri. Chromium's validating command decoder, which Android WebView still uses, rejects the integer call with GL_INVALID_ENUM, so anisotropic filtering was silently disabled under WebGL2 there. By @Jaltaire in #10874.
  • Fix invalid GLSL ES output for fragment shaders that use @invariant @builtin(position) on native OpenGL ES. By @jonatino in #10229.
  • Fix OpenGL initialization failures on Windows under Parallels by explicitly requesting the highest supported core version (4.6 down to 3.3) and retrying initial context creation once on failure. By @jimm98y in #10554.
  • Prevent WGL applications on Windows from becoming unresponsive during input language changes. By @acarl005 in #10505.
  • Fix incomplete framebuffer errors on the Android Emulator after a multisampled render pass. By @shtse8 in #10866.

WebGPU

  • Recognize GPUInternalError when converting a WebGPU error, mapping it to Error::Internal instead of panicking with "Unexpected error". By @evilpies in #9919.
  • Fix pop_error_scope panics when it returns null. By @beicause in #10039.
  • Fix Device::on_uncaptured_error never firing in browsers that do not implement GPUDevice.onuncapturederror, such as Safari, by listening for the uncapturederror event instead of assigning to that attribute. By @zemse in #10270.
  • Pass RenderPassColorAttachment::depth_slice to the browser, so a render pass into a 3D texture no longer fails validation with "depthSlice is required for a 3D attachment". By @jheising in #10693.

Performance

General

  • Queue::submit validation and tracking of built TLASes now scale with the number of unique BLASes instead of the number of instances. By @AntonWagnerCau in #9835.
  • Added explicit Send and Sync implementations to key wgpu types so that the compiler can do less work checking those bounds. If you previously added a #![recursion_limit = ...] attribute to your crate due to overflow errors involving wgpu types, you may now be able to remove it. By @kpreid in #10177.
  • Queue::write_buffer, Queue::write_texture and buffer unmaps no longer record a separate barrier before each copy. The transitions for a whole batch of queue writes are now coalesced into a single barrier recorded ahead of the batch's copies, so a frame that updates N buffers costs one barrier instead of N. By @JMS55 in #10319.

naga

  • Reduce HLSL compute shader compilation time for large workgroup arrays by initializing their elements with loops distributed across workgroup invocations. By @DonutShinobu in #10314.

Metal

GLES

  • Queue::submit no longer resets GL state for command buffers that record no commands (e.g. the internal transit and pre-pass encoders), removing two full reset sequences (about 20 GL calls) per frame for a typical single-pass WebGL2 renderer. By @chinqan in #10913.

WebGPU

  • Cache adapter and device limits, features, and adapter info on the browser WebGPU backend, so repeated calls no longer re-read those JavaScript objects. By @apetrock in #10513.

Documentation

General

  • Fix the BlasAabbGeometry docs to refer to the stride field instead of a nonexistent size.stride, and document the packed AABB buffer layout (each primitive a minimum then a maximum corner, two consecutive vec3<f32>). By @mstampfli in #9934.
  • The wiki and API specification pages are now documentation modules under wgpu::documentation. By @cwfitzgerald in #9779.
  • Fix stale poll() docs that described a boolean return value instead of PollStatus/PollError. By @helgev-in-arcana in #10151.

Dependency Updates

General

  • Raise the minimum version of the wasm-bindgen family to the earliest releases that support wasm64. By @nickbabcock in #9836.

GLES

deno_webgpu

  • GPUTextureDescriptor accepts textureBindingViewDimension. By @alextechcc in #8014.