Open
Conversation
9495737 to
a204246
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
28→29Release Notes
gfx-rs/wgpu (wgpu)
v29.0.1Compare Source
This release includes
wgpu-core,wgpu-halandwgpu-typesversion29.0.1. All other crates remain at their previous versions.Bug Fixes
General
max_inter_stage_shader_variables. By @ErichDonGubler in #9264.Metal
CaptureMTLDevice. By @andyleiserson in #9284.GLES / OpenGL
create_texture. By @umajho in #9302.Validation
Displayimplementation ofCreateTextureViewError::TooMany{MipLevels,ArrayLayers}when their base and offset overflow. By @ErichDonGubler in #8808.v29.0.0Compare Source
Major Changes
Surface::get_current_texturenow returnsCurrentSurfaceTextureenumSurface::get_current_textureno longer returnsResult<SurfaceTexture, SurfaceError>.Instead, it returns a single
CurrentSurfaceTextureenum that represents all possible outcomes as variants.SurfaceErrorhas been removed, and thesuboptimalfield onSurfaceTexturehas been replaced by a dedicatedSuboptimalvariant.By @cwfitzgerald, @Wumpf, and @emilk in #9141 and #9257.
InstanceDescriptorinitialization APIs and display handle changesA display handle represents a connection to the platform's display server (e.g. a Wayland or X11 connection on Linux). This is distinct from a window — a display handle is the system-level connection through which windows are created and managed.
InstanceDescriptor's convenience constructors (an implementation ofDefaultand the staticfrom_env_or_defaultmethod) have been removed. In their place are new static methods that force recognition of whether a display handle is used:new_with_display_handlenew_with_display_handle_from_envnew_without_display_handlenew_without_display_handle_from_envIf you are using
winit, this can be populated usingEventLoop::owned_display_handle.Additionally,
DisplayHandleis now optional when creating a surface if a display handle was already passed toInstanceDescriptor. This means that once you've provided the display handle at instance creation time, you no longer need to pass it again for each surface you create.By @MarijnS95 in #8782
Bind group layouts now optional in
PipelineLayoutDescriptorThis allows gaps in bind group layouts and adds full support for unbinding, bring us in compliance with the WebGPU spec. As a result of this
PipelineLayoutDescriptor'sbind_group_layoutsfield now has type of&[Option<&BindGroupLayout>]. To migrate wrap bind group layout references inSome:let pl_desc = wgpu::PipelineLayoutDescriptor { label: None, bind_group_layouts: &[ - &bind_group_layout + Some(&bind_group_layout) ], immediate_size: 0, });By @teoxoy in #9034.
MSRV update
wgpunow has a new MSRV policy. This release has an MSRV of 1.87. This is lower than v27's 1.88 and v28's 1.92. Going forward, we will only bump wgpu's MSRV if it has tangible benefits for the code, and we will never bump to an MSRV higher thanstable - 3. So if stable is at 1.97 and 1.94 brought benefit to our code, we could bump it no higher than 1.94. As before, MSRV bumps will always be breaking changes.By @cwfitzgerald in #8999.
WriteOnlyTo ensure memory safety when accessing mapped GPU memory,
MapMode::Writebuffer mappings (BufferViewMutand alsoQueueWriteBufferView) can no longer be dereferenced to Rust&mut [u8]. Instead, they must be used through the new pointer typewgpu::WriteOnly<[u8]>, which does not allow reading at all.WriteOnly<[u8]>is designed to offer similar functionality to&mut [u8]and have almost no performance overhead, but you will probably need to make some changes for anything more complicated thanget_mapped_range_mut().copy_from_slice(my_data); in particular, replacingview[start..end]withview.slice(start..end).By @kpreid in #9042.
Depth/stencil state changes
The
depth_write_enabledanddepth_comparemembers ofDepthStencilStateare now optional, and may be omitted when they do not apply, to match WebGPU.depth_write_enabledis applicable, and must beSome, ifformathas a depth aspect, i.e., is a depth or depth/stencil format. Otherwise, a value ofNonebest reflects that it does not apply, althoughSome(false)is also accepted.depth_compareis applicable, and must beSome, ifdepth_write_enabledisSome(true), or ifdepth_fail_opfor either stencil face is notKeep. Otherwise, a value ofNonebest reflects that it does not apply, althoughSome(CompareFunction::Always)is also accepted.There is also a new constructor
DepthStencilState::stencilwhich may be used instead of a struct literal for stencil operations.Example 1: A configuration that does a depth test and writes updated values:
depth_stencil: Some(wgpu::DepthStencilState { format: wgpu::TextureFormat::Depth32Float, - depth_write_enabled: true, - depth_compare: wgpu::CompareFunction::Less, + depth_write_enabled: Some(true), + depth_compare: Some(wgpu::CompareFunction::Less), stencil: wgpu::StencilState::default(), bias: wgpu::DepthBiasState::default(), }),Example 2: A configuration with only stencil:
depth_stencil: Some(wgpu::DepthStencilState { format: wgpu::TextureFormat::Stencil8, - depth_write_enabled: false, - depth_compare: wgpu::CompareFunction::Always, + depth_write_enabled: None, + depth_compare: None, stencil: wgpu::StencilState::default(), bias: wgpu::DepthBiasState::default(), }),Example 3: The previous example written using the new
stencil()constructor:D3D12 Agility SDK support
Added support for loading a specific DirectX 12 Agility SDK runtime via the Independent Devices API. The Agility SDK lets applications ship a newer D3D12 runtime alongside their binary, unlocking the latest D3D12 features without waiting for an OS update.
Configure it programmatically:
Or via environment variables:
The
sdk_versionmust match the version of theD3D12Core.dllin the provided path exactly, or loading will fail.If the Agility SDK fails to load (e.g. version mismatch, missing DLL, or unsupported OS), wgpu logs a warning and falls back to the system D3D12 runtime.
By @cwfitzgerald in #9130.
primitive_indexis now a WGSLenableextensionWGSL shaders using
@builtin(primitive_index)must now request it withenable primitive_index;. TheSHADER_PRIMITIVE_INDEXfeature has been renamed toPRIMITIVE_INDEXand moved fromFeaturesWGPUtoFeaturesWebGPU. By @inner-daemons in #8879 and @andyleiserson in #9101.maxInterStageShaderComponentsreplaced bymaxInterStageShaderVariablesMigrated from the
max_inter_stage_shader_componentslimit tomax_inter_stage_shader_variables, following the latest WebGPU spec. Components counted individual scalars (e.g. avec4= 4 components), while variables counts locations (e.g. avec4= 1 variable). This changes validation in a way that should not affect most programs. By @ErichDonGubler in #8652, #8792.Other Breaking Changes
StageError::InvalidWorkgroupSize. By @ErichDonGubler in #9192.New Features
General
ACCELERATION_STRUCTURE_BINDING_ARRAY. By @kvark in #8923.wgpu-naga-bridgecrate with conversions betweennagaandwgpu-types(features to capabilities, storage format mapping, shader stage mapping). By @atlv24 in #9201.AdapterInfofromDevice. By @sagudev in #8807.Limits::or_worse_values_from. By @atlv24 in #8870.Features::FLOAT32_BLENDABLEon Vulkan and Metal. By @timokoesters in #8963 and @andyleiserson in #9032.Dx12BackendOptions::force_shader_modelto allow using advanced features in passthrough shaders without bundling DXC. By @inner-daemons in #8984.Dx12Compiler::Autoto automatically use static or dynamic DXC if available, before falling back to FXC. By @inner-daemons in #8882.insert_debug_marker,push_debug_groupandpop_debug_groupon WebGPU. By @evilpie in #9017.@builtin(draw_index)to the vulkan backend. By @inner-daemons in #8883.TextureFormat::channelsmethod to get some information about which color channels are covered by the texture format. By @TornaxO7 in #9167V6_8variant toDxcShaderModelandnaga::back::hlsl::ShaderModel. By @inner-daemons in #8882 and @ErichDonGubler in #9083.V6_9variant toDxcShaderModelandnaga::back::hlsl::ShaderModel. By @ErichDonGubler in #9083.naga
SPV_KHR_non_semantic_infofor debug info. Also removesnaga::front::spv::SUPPORTED_EXT_SETS. By @inner-daemons in #8827.coherent, supported on all native backends, andvolatile, only on Vulkan and GL. By @atlv24 in #9168.constcontexts; by @ErichDonGubler in #8943:nagaArena::lenArena::is_emptyRange::first_and_lastfront::wgsl::Frontend::set_optionsir::Block::is_emptyir::Block::lenGLES
GlDebugFnsoption inGlBackendOptionsto control OpenGL debug functions (glPushDebugGroup,glPopDebugGroup,glObjectLabel, etc.). Automatically disables them on Mali GPUs to work around a driver crash. By @Xavientois in #8931.WebGPU
insert_debug_marker,push_debug_groupandpop_debug_group. By @evilpie in #9017.begin_occlusion_queryandend_occlusion_query. By @evilpie in #9039.Changes
General
.metalextension for metal source files, instead of.msl. By @inner-daemons in #8880.BufferAccessError:OutOfBoundsOverrunvariant into newOutOfBoundsStartOffsetOverrunandOutOfBoundsEndOffsetOverrunvariants.NegativeRangevariant in favor of newMapStartOffsetUnderrunandMapStartOffsetOverrunvariants.TransferError::BufferOverrunvariant into newBufferStartOffsetOverrunandBufferEndOffsetOverrunvariants.ImmediateUploadError:TooLargevariant in favor of newStartOffsetOverrunandEndOffsetOverrunvariants.Unalignedvariant in favor of newStartOffsetUnalignedandSizeUnalignedvariants.ValueStartIndexOverrunandValueEndIndexOverruninvariantsmax_bindings_per_bind_group, as required by WebGPU. By @andyleiserson in #9118.max_uniform_buffer_binding_sizeandmax_storage_buffer_binding_sizelimits are nowu64instead ofu32, to match WebGPU. By @wingertge in #9146.naga
wgpunow reject shaders with anenabledirective for functionality that is not available, even if that functionality is not used by the shader. By @andyleiserson in #8913.supported_capabilitiesto all backends. By @inner-daemons in #9068.Metal
objc2bindings internally, which should resolve a lot of leaks and unsoundness. By @madsmtm in #5641.MTLCommandQueuebecause the Metal object is thread-safe. By @andyleiserson in #9217.deno_webgpu
GPU.wgslLanguageFeaturesproperty. By @andyleiserson in #8884.GPUFeatureNamenow includes allwgpuextensions. Feature names for extensions should be written with awgpu-prefix, although unprefixed names that were accepted previously are still accepted. By @andyleiserson in #9163.Hal
Bug Fixes
General
@blend_srcmembers whether or not they are used by an entry point.TypeFlags::IO_SHAREABLEis not set for structs other than@blend_srcstructs.strip_index_formatisn't None and equals index buffer format for indexed drawing with strip topology. By @beicause in #8850.EXPERIMENTAL_PASSTHROUGH_SHADERStoPASSTHROUGH_SHADERSand made this no longer an experimental feature. By @inner-daemons in #9054.playercommands are now represented usingoffset+sizeinstead. By @ErichDonGubler in #9073.local_invocation_idandlocal_invocation_indexbeing written multiple times in HLSL/MSL backends, and naming conflicts when users name variables__local_invocation_idor__local_invocation_index. By @inner-daemons in #9099.naga
u32. By @andyleiserson in #8912.@must_useattribute on WGSL built-in functions, when applicable. You can waive the error with a phony assignment, e.g.,_ = subgroupElect(). By @andyleiserson in #8713.workgroupUniformLoadincorrectly returning an atomic when called on an atomic, it now returns the innerTas per the spec. By @cryvosh in #8791.sign()builtin to return zero when the argument is zero. By @mandryskowski in #8942.u32andi32). By @BKDaugherty in #9142.+=) LHS and RHS. By @andyleiserson in #9181.float16-format vertex input data was accessed via anf16-type variable in a vertex shader. By @andyleiserson in #9166.Validation
frag_depth, then the pipeline must have a depth attachment. By @andyleiserson in #8856.const v = vec2<i32>(); let r = v.xyz. By @andyleiserson in #8949.beginOcclusionQuery. By @andyleiserson in #9086.Onewhen the blend operation isMinorMax. TheBlendFactorOnUnsupportedTargeterror is now reported withinColorStateErrorrather than directly inCreateRenderPipelineError. By @andyleiserson in #9110.Vulkan
first_vertexfield. By @Vecvec in #9220Metal / macOS
GLES
DisplayHandleshould now be passed toInstanceDescriptorfor correct EGL initialization on Wayland. By @MarijnS95 in #8012Note that the existing workaround to create surfaces before the adapter is no longer valid.
Performance
GLES
GL_EXT_multisampled_render_to_textureextension when applicable to skip the multi-sample resolve operation. By @opstic in #8536.Documentation
General
QuerySet,QueryType, andresolve_query_set()describing how to use queries. By @kpreid in #8776.Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.