fix(deps): update rust crate wgpu to v27 - autoclosed#83
Closed
renovate[bot] wants to merge 1 commit into
Closed
Conversation
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:
0.19->27.0Release Notes
gfx-rs/wgpu (wgpu)
v27.0.1Compare Source
Bug Fixes
v27.0.0Compare Source
Major Changes
Deferred command buffer actions:
map_buffer_on_submitandon_submitted_work_doneYou may schedule buffer mapping and a submission-complete callback to run automatically after you submit, directly from encoders, command buffers, and passes.
Available on
CommandEncoder,CommandBuffer,RenderPass, andComputePass.By @cwfitzgerald in #8125.
Builtin Support for DXGI swapchains on top of of DirectComposition Visuals in DX12
By enabling DirectComposition support, the dx12 backend can now support transparent windows.
This creates a single
IDCompositionVisualover the entire window that is used by the mfSurface. If a user wants to manage the composition tree themselves, they should create their own device and composition, and pass the relevant visual down intowgpuviaSurfaceTargetUnsafe::CompositionVisual.By @n1ght-hunter in #7550.
EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTUREhas been merged intoEXPERIMENTAL_RAY_QUERYWe have merged the acceleration structure feature into the
RayQueryfeature. This is to help work around an AMD driver bug and reduce the feature complexity of ray tracing. In the future when ray tracing pipelines are implemented, if either feature is enabled, acceleration structures will be available.By @Vecvec in #7913.
New
EXPERIMENTAL_PRECOMPILED_SHADERSAPIWe have added
Features::EXPERIMENTAL_PRECOMPILED_SHADERS, replacing existing passthrough types with a unifiedCreateShaderModuleDescriptorPassthroughwhich allows passing multiple shader codes for different backends. By @SupaMaggie70Incorporated in #7834Difference for SPIR-V passthrough:
This allows using precompiled shaders without manually checking which backend's code to pass, for example if you have shaders precompiled for both DXIL and SPIR-V.
Buffer mapping apis no longer have lifetimes
Buffer::get_mapped_range(),Buffer::get_mapped_range_mut(), andQueue::write_buffer_with()now return guard objects without any lifetimes. Thismakes it significantly easier to store these types in structs, which is useful for building utilities that build the contents of a buffer over time.
By @sagudev in #8046 and @cwfitzgerald in #8070.
EXPERIMENTAL_*features now require unsafe code to enableWe want to be able to expose potentially experimental features to our users before we have ensured that they are fully sound to use.
As such, we now require any feature that is prefixed with
EXPERIMENTALto have a special unsafe token enabled in the device descriptoracknowledging that the features may still have bugs in them and to report any they find.
By @cwfitzgerald in #8163.
Multi-draw indirect is now unconditionally supported when indirect draws are supported
We have removed
Features::MULTI_DRAW_INDIRECTas it was unconditionally available on all platforms.RenderPass::multi_draw_indirectis now available if the device supports downlevel flagDownlevelFlags::INDIRECT_EXECUTION.If you are using spirv-passthrough with multi-draw indirect and
gl_DrawID, you can know ifMULTI_DRAW_INDIRECTis being emulatedby if the
Feature::MULTI_DRAW_INDIRECT_COUNTfeature is available on the device, this feature cannot be emulated efficicently.By @cwfitzgerald in #8162.
wgpu::PollType::Waithas now an optional timeoutWe removed
wgpu::PollType::WaitForSubmissionIndexand added fields towgpu::PollType::Waitin order to express timeouts.Before/after for
wgpu::PollType::Wait:Before/after for
wgpu::PollType::WaitForSubmissionIndex:wgpu::PollType::WaitForSubmissionIndexandwgpu::PollType::Waithad a hard-coded timeout of 60 seconds.To wait indefinitely on the latest submission, you can also use the
wait_indefinitelyconvenience function:By @wumpf in #8282, #8285
New Features
General
wgpu, with examples. Requires passthrough. By @SupaMaggie70Incorporated in #7345.GPUExternalTexture. These allow shaders to transparently operate on potentially multiplanar source texture data in either RGB or YCbCr formats via WGSL'stexture_externaltype. This is gated behind theFeatures::EXTERNAL_TEXTUREfeature, which is currently only supported on DX12. By @jamienicol in #4386.wgpu::Device::pollcan now specify a timeout viawgpu::PollType::Wait. By @wumpf in #8282 & #8285naga
naga::front::wgsl::UnimplementedEnableExtension. By @ErichDonGubler in #8237.Changes
General
CommandEncoder::finishis called, not when the individual operations are requested. This does not affect the API, but may affect performance characteristics. By @andyleiserson in #8220.push_debug_grouppairs with exactly onepop_debug_group. By @andyleiserson in #8048.set_viewportnow requires that the supplied minimum depth value is less than the maximum depth value. By @andyleiserson in #8040.copy_texture_to_buffer,copy_buffer_to_texture, andcopy_texture_to_textureoperations more closely follows the WebGPU specification. By @andyleiserson in various PRs.bytes_per_rowon the buffer side must be 256B-aligned, even if the transfer is a single row.set_vertex_bufferandset_index_buffermust be 4B aligned. By @andyleiserson in #7929.Device::on_uncaptured_error()must now implementSyncin addition toSend, and be wrapped inArcinstead ofBox.In exchange for this, it is no longer possible for calling
wgpufunctions while in that callback to cause a deadlock (not that we encourage you to actually do that).By @kpreid in #8011.
min_subgroup_size <= max_subgroup_size. By @andyleiserson in #8085.BufferViews]. By @cwfitzgerald in #8150.F16_IN_F32downlevel flag forquantizeToF16,pack2x16float, andunpack2x16floatin WGSL input. By @aleiserson in #8130.copy_texture_to_bufferskips over padding space between rows or layers, or when the start/end of a texture-buffer transfer is not 4B aligned. By @andyleiserson in #8099.naga
storageInputOutput16. By @cryvosh in #7884.naga::proc::Namernow accepts reserved keywords using two new dedicated types,proc::{KeywordSet, CaseInsensitiveKeywordSet}. By @kpreid in #8136.rg11b10floatwas incorrectly accepted and generated by naga, but now only accepts the the correct namerg11b10ufloatinstead. By @ErikWDev in #8219.source()method ofShaderErrorno longer reports the error as its own source. By @andyleiserson in #8258.DX12
Bug Fixes
General
DX12
EGL
Vulkan
create_swapchain(). By @MarijnS95 in #8226.naga
@blend_src(…)attributes. By @ErichDonGubler in #8137.casevalues inside aswitch. By @reima in #8165.Documentation
General
SUBGROUPandSUBGROUP_BARRIERfeatures / capabilities. By @andyleiserson in #8203.v26.0.1Compare Source
Bug Fixes
wgpu::util::initialize_adapter_from_envwhenstdfeature is not enabled. By @kpreid in #7918.profilingdependency is configured to have profiling active. By @kpreid in #7916.v26.0.0Compare Source
Major Features
New method
TextureView::textureYou can now call
texture_view.texture()to get access to the texture thata given texture view points to.
By @cwfitzgerald and @Wumpf in #7907.
as_halcalls now return guards instead of using callbacks.Previously, if you wanted to get access to the wgpu-hal or underlying api types, you would call
as_haland get the hal type as a callback. Now the function returns a guard which dereferences to the hal type.By @cwfitzgerald in #7863.
Enabling Vulkan Features/Extensions
For those who are doing vulkan/wgpu interop or passthrough and need to enable features/extensions that wgpu does not expose, there is a new
wgpu_hal::vulkan::Adapter::open_with_callbackthat allows the user to modify the pnext chains and extension lists populated by wgpu before we create a vulkan device. This should vastly simplify the experience, as previously you needed to create a device yourself.Underlying api interop is a quickly evolving space, so we welcome all feedback!
By @Vecvec in #7829.
naga
no_stdsupport with default features disabled. By @Bushrat011899 in #7585.naga::front::glsl::Frontend::new_with_options. By @Vrixyz in #6364.naga::{front::wgsl::ParseError,WithSpan}::emit_error_to_string_with_path) now accept more types for theirpathargument via a new sealedAsDiagnosticFilePathtrait. By @atlv24, @bushrat011899, and @ErichDonGubler in #7643.SUBGROUPfeature to be enabled). By @dzamkov and @valaphee in #7683.atomicCompareExchangeWeakin HLSL and GLSL backends. By @cryvosh in #7658General
wgpu_hal::dx12::Adapter::as_raw(). By @tronical in ##7852VK_KHR_maintenance1which should be widely available on newer drivers). By @teoxoy in #7596wgpu_types::error::{ErrorType, WebGpuError}for classification of errors according to WebGPU'sGPUError's classification scheme, and implementWebGpuErrorfor existing errors. This allows users ofwgpu-coreto offload error classification onto the wgpu ecosystem, rather than having to do it themselves without sufficient information. By @ErichDonGubler in #6547.Bug Fixes
General
BufferSlice::get_mapped_range_as_array_buffer()on a buffer would prevent you from ever unmapping it. Note that this API has changed and is nowBufferView::as_uint8array().naga
_. By @andyleiserson in #7540.dot4U8Packedanddot4I8Packedfor all backends, using specialized intrinsics on SPIR-V, HLSL, and Metal if available, and polyfills everywhere else. By @robamler in #7494, #7574, and #7653.pack4x{I,U}8Clampedbuilt-ins to all backends and WGSL frontend. By @ErichDonGubler in #7546.valueargument oftextureStore. By @jimblandy in #7567.abs(most negative abstract int). By @jimblandy in #7507.[un]pack4x{I,U}8[Clamp]on SPIR-V and MSL 2.1+. By @robamler in #7664.select, which had issues particularly with a lack of automatic type conversion. By @ErichDonGubler in #7572.distancebuilt-in function. By @bernhl in #7530.f16for pipeline constants, i.e.,overrides in WGSL. By @ErichDonGubler in #7801.DX12
vertex_index&instance_indexbuiltins working for indirect draws. By @teoxoy in #7535Vulkan
wgpu_hal::vulkan::drm. By @ErichDonGubler in #7810.Metal
fn surface_capabilities(). By @jamesordner in #7692WebGPU
on_submitted_work_donefor WebGPU backend. By @drewcrawford in #7864Changes
wgpuanddeno_webgpunow usewgpu-types::error::WebGpuErrorto classify errors. Any changes here are likely to be regressions; please report them if you find them! By @ErichDonGubler in #6547.General
MaintainBasein favor of usingPollType. By @waywardmonkeys in #7508.destroyfunctions for buffers and textures in wgpu-core are now infallible. Previously, they returned an error if called multiple times for the same object. This only affects the wgpu-core API; the wgpu API already allowed multipledestroycalls. By @andyleiserson in #7686 and #7720.CommandEncoder::build_acceleration_structures_unsafe_tlasin favour ofas_haland applysimplifications allowed by this. By @Vecvec in #7513
sizeparameter tocopy_buffer_to_bufferhas changed fromBufferAddresstoimpl Into<Option<BufferAddress>>. This achieves the spec-defined behavior of the value being optional, while still accepting existing calls without changes. By @andyleiserson in #7659.CommandEncoder,RenderPassEncoder,ComputePassEncoder, andRenderBundleEncoderhas changed toEncoderStateErrororPassStateError. These functions will return theEndedvariant of these errors if called on an encoder that is no longer active. Reporting of all other errors is deferred until a call tofinish().CommandEncoderErrorin the error enumsClearError,ComputePassErrorInner,QueryError, andRenderPassErrorInnerhave been replaced with variants holding anEncoderStateError.enum CommandEncoderErrorhas changed significantly, to reflect which errors can be raised byCommandEncoder.finish(). There are also some errors that no longer appear directly inCommandEncoderError, and instead appear nested within theRenderPassorComputePassvariants.CopyErrorhas been removed. Errors that were previously aCopyErrorare now aCommandEncoderErrorreturned byfinish(). (The detailed reasons for copies to fail were and still are described byTransferError, which was previously a variant ofCopyError, and is now a variant ofCommandEncoderError).naga
readonly_and_readwrite_storage_textures&packed_4x8_integer_dot_productlanguage extensions as implemented. By @teoxoy in #7543naga::back::hlsl::Writer::newhas a newpipeline_optionsargument.hlsl::PipelineOptions::default()can be passed as a default. Theshader_stageandentry_pointmembers ofpipeline_optionscan be used to write only a single entry point when using the HLSL and MSL backends (GLSL and SPIR-V already had this functionality). The Metal and DX12 HALs now write only a single entry point when loading shaders. By @andyleiserson in #7626.early_depth_testfor SPIR-V backend, enablingSHADER_EARLY_DEPTH_TESTfor Vulkan. Additionally, fixed conservative depth optimizations when usingearly_depth_test. The syntax for forcing early depth tests is now@early_depth_test(force)instead of@early_depth_test. By @dzamkov in #7676.ImplementedLanguageExtension::VARIANTSis now implemented manually rather than derived usingstrum(allowingstrumto become a dev-only dependency) so it is no longer a member of thestrum::VARIANTStrait. Unless you are using this trait as a bound this should have no effect.process_overridesnow compacts the module to remove unused items. It is no longer necessary to supply values for overrides that are not used by the active entry point.compactCargo feature has been removed. It is no longer possible to exclude compaction support from the build.compactnow has an additional argument that specifies whether to remove unused functions, globals, and named types and overrides. For the previous behavior, passKeepUnused::Yes.D3D12
IDXGIFactory4fromInstance. By @MendyBerger in #7827Vulkan
HAL
no_stdsupport towgpu-hal. By @bushrat011899 in #7599Documentation
General
Adapter::request_device. By @tesselode in #7768v25.0.2Compare Source
Bug Fixes
General
Queue::write_buffer. By @RedMindZ in #7582raw-window-handledependency being too lenient. By @kpreid in #7526WebGPU
v25.0.0Compare Source
Major Features
Hashmaps Removed from APIs
Both
PipelineCompilationOptions::constantsandShaderSource::Glsl::definesnow takeslices of key-value pairs instead of
hashmaps. This is to prepare forno_stdsupport and allow us to keep which
hashmaphasher and such as implementation details. Italso allows more easily creating these structures inline.
By @cwfitzgerald in #7133
All Backends Now Have Features
Previously, the
vulkanandglesbackends were non-optional on windows, linux, and android and there was no way to disable them. We have now figured out how to properly make them disablable! Additionally, if you turn on thewebglfeature, you will only get the GLES backend on WebAssembly, it won't leak into native builds, like previously it might have.By @cwfitzgerald in #7076.
device.pollApi ReworkedThis release reworked the poll api significantly to allow polling to return errors when polling hits internal timeout limits.
Maintainwas renamedPollType. Additionally,pollnow returns a result containing information about what happened during the poll.By @cwfitzgerald in #6942 and #7030.
wgpu::Device::start_capturerenamed, documented, and made unsafeThere is now documentation to describe how this maps to the various debuggers' apis.
By @cwfitzgerald in #7470
Ensure loops generated by SPIR-V and HLSL naga backends are bounded
Make sure that all loops in shaders generated by these naga backends are bounded
to avoid undefined behaviour due to infinite loops. Note that this may have a
performance cost. As with the existing implementation for the MSL backend this
can be disabled by using
Device::create_shader_module_trusted().By @jamienicol in #6929 and #7080.
Split up
FeaturesinternallyInternally split up the
Featuresstruct and recombine them internally using a macro. There should be no breakingchanges from this. This means there are also namespaces (as well as the old
Features::*) for all wgpu specificfeatures and webgpu feature (
FeaturesWGPUandFeaturesWebGPUrespectively) andFeatures::from_internal_flagswhichallow you to be explicit about whether features you need are available on the web too.
By @Vecvec in #6905, #7086
WebGPU compliant dual source blending feature
Previously, dual source blending was implemented with a
wgpunative only feature flag and used a custom syntax in wgpu.By now, dual source blending was added to the WebGPU spec as an extension.
We're now following suite and implement the official syntax.
Existing shaders using dual source blending need to be updated:
struct FragmentOutput{ - @​location(0) source0: vec4<f32>, - @​location(0) @​second_blend_source source1: vec4<f32>, + @​location(0) @​blend_src(0) source0: vec4<f32>, + @​location(0) @​blend_src(1) source1: vec4<f32>, }With that
wgpu::Features::DUAL_SOURCE_BLENDINGis now available on WebGPU.Furthermore, GLSL shaders now support dual source blending as well via the
indexlayout qualifier:By @wumpf in #7144
Unify interface for SpirV shader passthrough
Replace device
create_shader_module_spirvfunction with a genericcreate_shader_module_passthroughfunctiontaking a
ShaderModuleDescriptorPassthroughenum as parameter.Update your calls to
create_shader_module_spirvand usecreate_shader_module_passthroughinstead:By @syl20bnr in #7326.
Noop Backend
It is now possible to create a dummy
wgpudevice even when no GPU is available. This may be useful for testing of code which manages graphics resources. Currently, it supports reading and writing buffers, and other resource types can be created but do nothing.To use it, enable the
noopfeature ofwgpu, and either callDevice::noop(), or addNoopBackendOptions { enable: true }to the backend options of yourInstance(this is an additional safeguard beyond theBackendsbits).By @kpreid in #7063 and #7342.
SHADER_F16feature is now available with naga shadersPreviously this feature only allowed you to use
f16on SPIR-V passthrough shaders. Now you can use it on all shaders, including WGSL, SPIR-V, and GLSL!By @FL33TW00D, @ErichDonGubler, and @cwfitzgerald in #5701
Bindless support improved and validation rules changed.
Metal support for bindless has significantly improved and the limits for binding arrays have been increased.
Previously, all resources inside binding arrays contributed towards the standard limit of their type (
texture_2darrays for example would contribute tomax_sampled_textures_per_shader_stage). Now these resources will only contribute towards binding-array specific limits:max_binding_array_elements_per_shader_stagefor all non-sampler resourcesmax_binding_array_sampler_elements_per_shader_stagefor sampler resources.This change has allowed the metal binding array limits to go from between 32 and 128 resources, all the way 500,000 sampled textures. Additionally binding arrays are now bound more efficiently on Metal.
This change also enabled legacy Intel GPUs to support 1M bindless resources, instead of the previous 1800.
To facilitate this change, there was an additional validation rule put in place: if there is a binding array in a bind group, you may not use dynamic offset buffers or uniform buffers in that bind group. This requirement comes from vulkan rules on
UpdateAfterBinddescriptors.By @cwfitzgerald in #6811, #6815, and #6952.
New Features
General
Buffermethods corresponding toBufferSlicemethods, so you can skip creating aBufferSlicewhen it offers no benefit, andBufferSlice::slice()for sub-slicing a slice. By @kpreid in #7123.BufferSlice::buffer(),BufferSlice::offset()andBufferSlice::size(). By @kpreid in #7148.impl From<BufferSlice> for BufferBindingandimpl From<BufferSlice> for BindingResource, allowingBufferSlices to be easily used in creating bind groups. By @kpreid in #7148.util::StagingBelt::allocate()so the staging belt can be used to write textures. By @kpreid in #6900.CommandEncoder::transition_resources()for native API interop, and allowing users to slightly optimize barriers. By @JMS55 in #6678.wgpu_hal::vulkan::Adapter::texture_format_as_rawfor native API interop. By @JMS55 in #7228.as_halfor both acceleration structures. By @Vecvec in #7303.create_shader_module_passthroughon device. By @syl20bnr in #7326.Features::MSL_SHADER_PASSTHROUGHrun-time feature allows providing pass-through MSL Metal shaders. By @syl20bnr in #7326.wgpu_hal. By @SupaMaggie70Incorporated in #7089naga
unpackSnorm4x8,unpackUnorm4x8,unpackSnorm2x16,unpackUnorm2x16for GLSL versions they aren't supported in. By @DJMcNab in #7408.Examples
GPUBufferby distributing it across many buffers, and then having the shader receive them as abinding_arrayof storage buffers. By @alphastrata in #6138Changes
General
wgpu::Instance::request_adapter()now returnsResultinstead ofOption; the error provides information about why no suitable adapter was returned. By @kpreid in #7330.hashbrownto simplify no-std support. By Brody in #6938 & #6925.instance_idandinstance_custom_indextoinstance_indexandinstance_custom_databy @Vecvec in#6780
naga
naga::ir(e.g.naga::ir::Module).The original names (e.g.
naga::Module) remain present for compatibility.By @kpreid in #7365.
usestatements to simplify futureno_stdsupport. By @bushrat011899 in #7256&operator to take the address of a component of a vector,which is not permitted by the WGSL specification. By @andyleiserson in #7284
termcolorandstderrare now optional behind features of the same names. By @bushrat011899 in #7482Vulkan
HAL queue callback support
Queue::submit()to Vulkan'svk::Semaphoreallocated outside of wgpu. By @sotaroikeda in #6813.Bug Fixes
naga
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 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.