chore(deps): update rust crate wgpu to v24 #1456
Open
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:
23
->24
Release Notes
gfx-rs/wgpu (wgpu)
v24.0.0
Compare Source
Major changes
Refactored Dispatch Between
wgpu-core
andwebgpu
The crate
wgpu
has two different "backends", one which targets webgpu in the browser, one which targetswgpu_core
on native platforms and webgl. This was previously very difficult to traverse and add new features to. The entire system was refactored to make it simpler. Additionally the new system has zero overhead if there is only one "backend" in use. You can see the new system in action by using go-to-definition on any wgpu functions in your IDE.By @cwfitzgerald in #6619.
Render and Compute Passes Now Properly Enforce Their Lifetime
A regression introduced in 23.0.0 caused lifetimes of render and compute passes to be incorrectly enforced. While this is not
a soundness issue, the intent is to move an error from runtime to compile time. This issue has been fixed and restored to the 22.0.0 behavior.
Bindless (
binding_array
) Grew More CapabilitiesPARTIALLY_BOUND_BINDING_ARRAY
on Resource Binding Tier 3 Hardware. This is most D3D12 hardware D3D12 Feature Table for more information on what hardware supports this feature. By @cwfitzgerald in #6734.Device::create_shader_module_unchecked
Renamed and Now Has Configuration Optionscreate_shader_module_unchecked
becamecreate_shader_module_trusted
.This allows you to customize which exact checks are omitted so that you can get the correct balance of performance and safety for your use case. Calling the function is still unsafe, but now can be used to skip certain checks only on certain builds.
This also allows users to disable the workarounds in the
msl-out
backend to prevent the compiler from optimizing infinite loops. This can have a big impact on performance, but is not recommended for untrusted shaders.By @cwfitzgerald and @rudderbucky in #6662.
wgpu::Instance::new
now takesInstanceDescriptor
by referencePreviously
wgpu::Instance::new
tookInstanceDescriptor
by value (which is overall fairly uncommon in wgpu).Furthermore,
InstanceDescriptor
is now cloneable.By @wumpf in #6849.
Environment Variable Handling Overhaul
Previously how various bits of code handled reading settings from environment variables was inconsistent and unideomatic.
We have unified it to (
Type::from_env()
orType::from_env_or_default()
) andType::with_env
for all types.By @cwfitzgerald in #6895
Backend-specific instance options are now in separate structs
In order to better facilitate growing more interesting backend options, we have put them into individual structs. This allows users to more easily understand what options can be defaulted and which they care about. All of these new structs implement
from_env()
and delegate to their respectivefrom_env()
methods.If you do not need any of these options, or only need one backend's info use the
default()
impl to fill out the remaining feelds.By @cwfitzgerald in #6895
The
diagnostic(…);
directive is now supported in WGSLNaga now parses
diagnostic(…);
directives according to the WGSL spec. This allows users to control certain lints, similar to Rust'sallow
,warn
, anddeny
attributes. For example, in standard WGSL (but, notably, not Naga yet—see #4369) this snippet would emit a uniformity error:…but we can now silence it with the
off
severity level, like so:There are some limitations to keep in mind with this new functionality:
@diagnostic(…)
rules asfn
attributes, but prioritization for rules in statement positions (i.e.,if (…) @​diagnostic(…) { … }
is unclear. If you are blocked by not being able to parsediagnostic(…)
rules in statement positions, please let us know in #5320, so we can determine how to prioritize it!error
,warning
,info
, andoff
severity levels. These are all technically usable now! A caveat, though: warning- and info-level are only emitted tostderr
via thelog
façade, rather than being reported through aResult::Err
in Naga or theCompilationInfo
interface inwgpu{,-core}
. This will require breaking changes in Naga to fix, and is being tracked by #6458.diagnostic(…)
rules. In fact, only thederivative_uniformity
triggering rule exists in the WGSL standard. That said, Naga contributors are excited to see how this level of control unlocks a new ecosystem of configurable diagnostics.diagnostic(…)
rules are not yet emitted in WGSL output. This means thatwgsl-in
→wgsl-out
is currently a lossy process. We felt that it was important to unblock users who neededdiagnostic(…)
rules (i.e., #3135) before we took significant effort to fix this (tracked in #6496).By @ErichDonGubler in #6456, #6148, #6533, #6353, #6537.
New Features
Naga
naga
CLI would incorrectly skip the first positional argument when--stdin-file-path
was specified. By @ErichDonGubler in #6480.quantizeToF16()
for WGSL frontend, and WGSL, SPIR-V, HLSL, MSL, and GLSL backends. By @jamienicol in #6519.usampler*
andisampler*
. By @DavidPeicho in #6513.{U,S}{int,norm}{8,16}
,Float16
andUnorm8x4Bgra
). By @nolanderc in #6632workgroup_size
. By @KentSlaney in #6635.General
map_async
andon_submitted_work_done
to track down completion of async callbacks. By @eliemichel in #6360..dll
files. By @DouglasDwyer in #6574.DeviceType
andAdapterInfo
now implHash
by @cwfitzgerald in #6868wgsl_language_features
for obtaining available WGSL language feature by @sagudev in #6814no_std
support towgpu-types
. By @bushrat011899 in #6892.Vulkan
VK_EXT_shader_atomic_float
. By @AsherJingkongChen in #6234.Metal
raw_handle
method to access raw Metal textures in #6894.D3D12
Changes
Naga
override
initializers. By @sagudev in 6920General
Surface::as_hal
take an immutable reference to the surface. By @jerzywilczek in #9999CreateBindGroupError::InvalidTextureSampleType
error message. By @ErichDonGubler in #6530.Surface::configure
andSurface::get_current_texture
are no longer fatal. By @alokedesai in #6253BlasTriangleGeometry::index_buffer_offset
toBlasTriangleGeometry::first_index
. By @Vecvec in #6873D3D12
dxcompiler.dll
&dxil.dll
are also now required. By @teoxoy in #6643.Vulkan
HAL
usage: Range<T>
, forBufferUses
,TextureUses
, andAccelerationStructureBarrier
with a newStateTransition<T>
. By @atlv24 in #6703DropCallback
API to useFnOnce
instead ofFnMut
. By @jerzywilczek in #6482Bug Fixes
General
Device
, rather than panicking. By @ErichDonGubler in #6505.Features::TIMESTAMP_QUERY
is set when using timestamp writes in render and compute passes. By @ErichDonGubler in #6497.QUERY_SET_MAX_QUERIES
(and enforced limits) from 8192 to 4096 to match WebGPU spec. By @ErichDonGubler in #6525.PreHashedMap
withFastHashMap
. By @jamienicol in #6541.TIMESTAMP_QUERY
feature before other validation.Device
on some environments. By @Dinnerbone in #6681.get_acceleration_structure_build_sizes
. By @Vecvec in #6802.wgpu-info
not showing dx12 adapters. By @wumpf in #6844.transform_buffer_offset
when initialisingtransform_buffer
. By @Vecvec in #6864.Naga
vecN
constructors have less than N arguments. By @ErichDonGubler in #6508.>=
ina<b>=c
. By @KentSlaney in #6898.Statement::ImageStore
. By @jimblandy in #6729.Vulkan
max_color_attachment_bytes_per_sample
is now correctly set to 128. By @cwfitzgerald in #6866D3D12
max_color_attachment_bytes_per_sample
is now correctly set to 128. By @cwfitzgerald in #6866Examples
Testing
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, 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.