chore(deps): update rust crate hal to v28 #537
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->28.0.0Release Notes
gfx-rs/wgpu (hal)
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.