chore(deps): update rust crate hal to v29#563
Closed
renovate[bot] wants to merge 1 commit intotrunkfrom
Closed
Conversation
Member
|
Closing in favor of #565. |
Contributor
Author
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
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:
27.0.4→29.0.0Release Notes
gfx-rs/wgpu (hal)
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.v28.0.1Compare Source
General
Vulkan
Metal
v28.0.0Compare Source
Major Changes
Mesh Shaders
This has been a long time coming. See the tracking issue for more information.
They are now fully supported on Vulkan, and supported on Metal and DX12 with passthrough shaders. WGSL parsing and rewriting
is supported, meaning they can be used through WESL or naga_oil.
Mesh shader pipelines replace the standard vertex shader pipelines and allow new ways to render meshes.
They are ideal for meshlet rendering, a form of rendering where small groups of triangles are handled together,
for both culling and rendering.
They are compute-like shaders, and generate primitives which are passed directly to the rasterizer, rather
than having a list of vertices generated individually and then using a static index buffer. This means that certain computations
on nearby groups of triangles can be done together, the relationship between vertices and primitives is more programmable, and
you can even pass non-interpolated per-primitive data to the fragment shader, independent of vertices.
Mesh shaders are very versatile, and are powerful enough to replace vertex shaders, tesselation shaders, and geometry shaders
on their own or with task shaders.
A full example of mesh shaders in use can be seen in the
mesh_shaderexample. For the full specification of mesh shaders in wgpu, go to docs/api-specs/mesh_shading.md. Below is a small snippet of shader code demonstrating their usage:Thanks
This was a monumental effort from many different people, but it was championed by @inner-daemons, without whom it would not have happened.
Thank you @cwfitzgerald for doing the bulk of the code review. Finally thank you @ColinTimBarndt for coordinating the testing effort.
Reviewers:
wgpuContributions:nagaContributions:wgsl-inimplementation in naga. By @inner-daemons in #8370.spv-outimplementation in naga. By @inner-daemons in #8456.wgsl-outimplementation in naga. By @Slightlyclueless in #8481.Testing Assistance:
Thank you to everyone to made this happen!
Switch from
gpu-alloctogpu-allocatorin thevulkanbackendgpu-allocatoris the allocator used in thedx12backend, allowing to configurethe allocator the same way in those two backends converging their behavior.
This also brings the
Device::generate_allocator_reportfeature tothe vulkan backend.
By @DeltaEvo in #8158.
wgpu::Instance::enumerate_adaptersis nowasync& available on WebGPUBREAKING CHANGE:
enumerate_adaptersis nowasync:This yields two benefits:
Adapter::request_adapter(…), makingenumerate_adaptersa portable surface. This was previously a nontrivial pain point when an application wanted to do some of its own filtering of adapters.By @R-Cramer4 in #8230
New
LoadOp::DontCareIn the case where a renderpass unconditionally writes to all pixels in the rendertarget,
Loadcan cause unnecessary memory traffic, andClearcan spend time unnecessarilyclearing the rendertargets.
DontCareis a newLoadOpwhich will leave the contentsof the rendertarget undefined. Because this could lead to undefined behavior, this API
requires that the user gives an unsafe token to use the api.
While you can use this unconditionally, on platforms where
DontCareis not available,it will internally use a different load op.
By @cwfitzgerald in #8549
MipmapFilterModeis split fromFilterModeThis is a breaking change that aligns wgpu with spec.
SamplerDescriptor { ... - mipmap_filter: FilterMode::Nearest + mipmap_filter: MipmapFilterMode::Nearest ... }By @sagudev in #8314.
Multiview on all major platforms and support for multiview bitmasks
Multiview is a feature that allows rendering the same content to multiple layers of a texture.
This is useful primarily in VR where you wish to display almost identical content to 2 views,
just with a different perspective. Instead of using 2 draw calls or 2 instances for each object, you
can use this feature.
Multiview is also called view instancing in DX12 or vertex amplification in Metal.
Multiview has been reworked, adding support for Metal and DX12, and adding testing and validation to wgpu itself.
This change also introduces a view bitmask, a new field in
RenderPassDescriptorthat allows a render pass to renderto multiple non-adjacent layers when using the
SELECTIVE_MULTIVIEWfeature. If you don't use multi-view,you can set this field to none.
One other breaking change worth noting is that in WGSL
@builtin(view_index)now requires a type ofu32, where previously it requiredi32.By @inner-daemons in #8206.
Error scopes now use guards and are thread-local.
Device error scopes now operate on a per-thread basis. This allows them to be used easily within multithreaded contexts,
without having the error scope capture errors from other threads.
When the
stdfeature is not enabled, we have no way to differentiate between threads, so error scopes return to beglobal operations.
By @cwfitzgerald in #8685
Log Levels
We have received complaints about wgpu being way too log spammy at log levels
info/warn/error. We haveadjusted our log policy and changed logging such that
infoand above should be silent unless some exceptionalevent happens. Our new log policy is as follows:
wgpuor application developers.By @cwfitzgerald in #8579.
Push constants renamed immediates, API brought in line with spec.
As the "immediate data" api is getting close to stabilization in the WebGPU specification,
we're bringing our implementation in line with what the spec dictates.
First, in the
PipelineLayoutDescriptor, you now pass a unified size for all stages:Second, on the command encoder you no longer specify a shader stage, uploads apply
to all shader stages that use immediate data.
Third, immediates are now declared with the
immediateaddress space instead ofthe
push_constantaddress space. Due to a known issue on DX12it is advised to always use a structure for your immediates until that issue
is fixed.
Finally, our implementation currently still zero-initializes the immediate data
range you declared in the pipeline layout. This is not spec compliant and failing
to populate immediate "slots" that are used in the shader will be a validation error
in a future version. See the proposal for details for determining
which slots are populated in a given shader.
By @cwfitzgerald in #8724.
subgroup_{min,max}_sizerenamed and moved fromLimits->AdapterInfoTo bring our code in line with the WebGPU spec, we have moved information about subgroup size
from limits to adapter info. Limits was not the correct place for this anyway, and we had some
code special casing those limits.
Additionally we have renamed the fields to match the spec.
By @cwfitzgerald in #8609.
New Features
MULTISAMPLE_ARRAY. By @LaylBongers in #8571.get_configurationtowgpu::Surface, that returns the current configuration ofwgpu::Surface. By @sagudev in #8664.wgpu_core::Global::create_bind_group_layout_error. By @ErichDonGubler in #8650.Changes
General
wgpu_ray_query,wgpu_ray_query_vertex_return). By @Vecvec in #8545.from_custom. By @R-Cramer4 in #8315.CommandEncoder::as_hal_muton the same encoder will now result in a panic.include_spirv!andinclude_spirv_raw!macros to be used in constants and statics. By @clarfonthey in #8250.CommandEncoder::finish()will report the label of the invalid encoder. By @kpreid in #8449.util::StagingBeltnow takes aDevicewhen it is created instead of when it is used. By @kpreid in #8462.wgpu_hal::vulkan::TextureAPI changes to handle externally-created textures and memory more flexibly. By @s-ol in #8512, #8521.maxColorAttachmentBytesPerSamplelimit. By @andyleiserson in #8697.Metal
MTLDeviceis thread-safe. By @uael in #8168naga
wgpufeatures, and this change should not be user-visible. By @andyleiserson in #8671.var<function>syntax for declaring local variables. By @andyleiserson in #8710.Bug Fixes
General
OperationError: GPUBuffer.getMappedRange: GetMappedRange range extends beyond buffer's mapped range. By @ryankaplan in #8349locations >max_color_attachmentslimit. By @ErichDonGubler in #8316.maxColorAttachmentsandmaxColorAttachmentBytesPerSample. By @evilpie in #8328wgpu_types::Limits::max_bindings_per_bind_groupwhen deriving a bind group layout for a pipeline. By @jimblandy in #8325.wgpu-halwhich did nothing useful:"cargo-clippy","gpu-allocator", and"rustc-hash". By @kpreid in #8357.wgpu_types::PollErrornow always implements theErrortrait. By @kpreid in #8384.STORAGE_READ_ONLYtexture usage is now permitted to coexist with other read-only usages. By @andyleiserson in #8490.write_buffercalls. By @ErichDonGubler in #8454.naga
||and&&operators now "short circuit", i.e., do not evaluate the RHS if the result can be determined from just the LHS. By @andyleiserson in #7339.program scope variable must reside in constant address spacein some cases. By @teoxoy in #8311.rayQueryTerminatein spv-out instead of ignoring it. By @Vecvec in #8581.DX12
D3D12_FEATURE_DATA_D3D12_OPTIONS13.UnrestrictedBufferTextureCopyPitchSupportedisfalse. By @ErichDonGubler in #7721.Vulkan
Metal
WebGPU
copy_texture_to_bufferin WebGPU, causing the copy to fail for depth/stencil textures. By @Tim-Evans-Seequent in #8445.GLES
VertexFormat::Unorm10_10_10_2can now be used onglbackends. By @mooori in #8717.hal
DropCallbacks are now called after dropping all other fields of their parent structs. By @jerzywilczek in #8353Configuration
📅 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.