fix(deps): update rust crate wgpu to 0.15 #54
Merged
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.14
->0.15
Release Notes
gfx-rs/wgpu
v0.15.1
Compare Source
Changes
General
Vulkan
DX12
WebGPU
CommandEncoder::clear_buffer
. By @raphlinus in #3426Bug Fixes
General
Vulkan
DX12
dxil_path
. By @Elabajaba in #3434GLES
WebGPU
{adapter|device}_features
. By @jinleili in #3428Documentation
General
v0.15.0
Compare Source
Major Changes
WGSL Top-Level
let
is nowconst
All top level constants are now declared with
const
, catching up with the wgsl spec.let
is no longer allowed at the global scope, only within functions.See https://github.com/gfx-rs/naga/blob/master/CHANGELOG.md#v011-2023-01-25 for smaller shader improvements.
Surface Capabilities API
The various surface capability functions were combined into a single call that gives you all the capabilities.
Additionally
Surface::get_default_config
now returns an Option and returns None if the surface isn't supported by the adapter.Fallible surface creation
Instance::create_surface()
now returnsResult<Surface, CreateSurfaceError>
instead ofSurface
. This allows an error to be returned if the given window is a HTML canvas and obtaining a WebGPU or WebGL 2 context fails. (No other platforms currently report any errors through this path.) By @kpreid in #3052Queue::copy_external_image_to_texture
on WebAssemblyA new api,
Queue::copy_external_image_to_texture
, allows you to create wgpu textures from various web image primitives. Specificically fromHtmlVideoElement
,HtmlCanvasElement
,OffscreenCanvas
, andImageBitmap
. This provides multiple low-copy ways of interacting with the browser. WebGL is also supported, though WebGL has some additional restrictions, represented by theUNRESTRICTED_EXTERNAL_IMAGE_COPIES
downlevel flag. By @cwfitzgerald in #3288Instance creation now takes
InstanceDescriptor
instead ofBackends
Instance::new()
andhub::Global::new()
now take anInstanceDescriptor
struct which cointains both the existingBackends
selection as well as a newDx12Compiler
field for selecting which Dx12 shader compiler to use.Instance
now also also implementsDefault
, which useswgpu::Backends::all()
andwgpu::Dx12Compiler::Fxc
forInstanceDescriptor
By @Elabajaba in #3356
Texture Format Reinterpretation
The new
view_formats
field in theTextureDescriptor
is used to specify a list of formats the texture can be re-interpreted to in a texture view. Currently only changing srgb-ness is allowed (ex.Rgba8Unorm
<=>Rgba8UnormSrgb
).let texture = device.create_texture(&wgpu::TextureDescriptor { // ... format: TextureFormat::Rgba8UnormSrgb, + view_formats: &[TextureFormat::Rgba8Unorm], });
let config = wgpu::SurfaceConfiguration { // ... format: TextureFormat::Rgba8Unorm, + view_formats: vec![wgpu::TextureFormat::Rgba8UnormSrgb], }; surface.configure(&device, &config);
MSAA x2 and x8 Support
Via the
TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
feature, MSAA x2 and x8 are now supported on textures. To query for x2 or x8 support, enable the feature and look at the texture format flags for the texture format of your choice.By @39ali in 3140
DXC Shader Compiler Support for DX12
You can now choose to use the DXC compiler for DX12 instead of FXC. The DXC compiler is faster, less buggy, and allows for new features compared to the old, unmaintained FXC compiler.
You can choose which compiler to use at
Instance
creation using thedx12_shader_compiler
field in theInstanceDescriptor
struct. Note that DXC requires bothdxcompiler.dll
anddxil.dll
, which can be downloaded from https://github.com/microsoft/DirectXShaderCompiler/releases. Both .dlls need to be shipped with your application when targeting DX12 and using theDXC
compiler. If the .dlls can't be loaded, then it will fall back to the FXC compiler. By @39ali and @Elabajaba in #3356Suballocate DX12 buffers and textures
The DX12 backend can now suballocate buffers and textures from larger chunks of memory, which can give a significant increase in performance (in testing a 100x improvement has been seen in a simple scene with 200
write_buffer
calls per frame, and a 1.4x improvement in Bistro using Bevy).Previously
wgpu-hal
's DX12 backend created a new heap on the GPU every time you calledwrite_buffer
(by callingCreateCommittedResource
), whereas now it usesgpu_allocator
to manage GPU memory (and callsCreatePlacedResource
with a suballocated heap). By @Elabajaba in #3163Backend selection by features in wgpu-core
Whereas
wgpu-core
used to automatically select backends to enablebased on the target OS and architecture, it now has separate features
to enable each backend:
None are enabled by default, but the
wgpu
crate automaticallyselects these features based on the target operating system and
architecture, using the same rules that
wgpu-core
used to, so usersof
wgpu
should be unaffected by this change. However, other cratesusing
wgpu-core
directly will need to copywgpu
's logic or writetheir own. See the
[target]
section ofwgpu/Cargo.toml
fordetails.
Similarly,
wgpu-core
now hasemscripten
andrenderdoc
featuresthat
wgpu
enables on appropriate platforms.In previous releases, the
wgpu-core
crate decided which backends tosupport. However, this left
wgpu-core
's users with no way tooverride those choices. (Firefox doesn't want the GLES back end, for
example.) There doesn't seem to be any way to have a crate select
backends based on target OS and architecture that users of that crate
can still override. Default features can't be selected based on the
target, for example. That implies that we should do the selection as
late in the dependency DAG as feasible. Having
wgpu
(andwgpu-core
's other dependents) choose backends seems like the bestoption.
By @jimblandy in #3254.
Changes
General
Default
Implementations on Enums toderive(Default)
Default
forCompositeAlphaMode
UNRESTRICTED_INDEX_BUFFER
to indicate support for usingINDEX
together with other non-copy/map usages (unsupported on WebGL). By @Wumpf in #3157DEPTH_BIAS_CLAMP
andFULL_DRAW_INDEX_UINT32
downlevel flags. By @teoxoy in #3316Surface::get_supported_formats
,Surface::get_supported_present_modes
, andSurface::get_supported_alpha_modes
intoSurface::get_capabilities
andSurfaceCapabilities
. By @cwfitzgerald in #3157Surface::get_default_config
return an Option to prevent panics. By @cwfitzgerald in #3157max_buffer_size
limit value for compatibility with Apple2 and WebGPU compliance. By @jinleili in #3255min_uniform_buffer_offset_alignment
andmin_storage_buffer_offset_alignment
is now always at least 32. By @wumpf #3262strict_assert
family of macros was moved towgpu-types
. By @i509VCB in #3051ObjectId
structure and invariants idiomatic. By @teoxoy in #3347GPUSamplerDescriptor
valid usage forlodMinClamp
andlodMaxClamp
. By @James2022-rgb in #3353Deref
implementations forQueueWriteBufferView
andBufferViewMut
. Instead, warnings are logged, since reading from these types is not recommended. By @botahamec in [#3336]view_formats
in the TextureDescriptor to match the WebGPU spec. By @jinleili in #3237TextureView
validation according to the WebGPU spec. By @teoxoy in #3410view_formats
in the SurfaceConfiguration to match the WebGPU spec. By @jinleili in #3409Vulkan
WEBGPU_TEXTURE_FORMAT_SUPPORT
downlevel flag depending on the proper format support by @teoxoy in #3367.COPY_SRC
/COPY_DST
only based on Vulkan'sTRANSFER_SRC
/TRANSFER_DST
by @teoxoy in #3366.GLES
OVR_multiview2
now report theMULTIVIEW
feature by @expenses in #3121.Limits::max_push_constant_size
on GLES is now 256 by @Dinnerbone in #3374.WebGPU
queue_validate_write_buffer
by @jinleili in #3098Added/New Features
General
Hash
forDepthStencilState
andDepthBiasState
"wgsl"
feature, to enable WGSL shaders inwgpu-core
andwgpu
. Enabled by default inwgpu
. By @daxpedda in #2890.Clone
forShaderSource
andShaderModuleDescriptor
inwgpu
. By @daxpedda in #3086.get_default_config
forSurface
to simplify user creation ofSurfaceConfiguration
. By @jinleili in #3034Adapter::get_presentation_timestamp
]. By @cwfitzgerald in #3240Features::SHADER_PRIMITIVE_INDEX
on all backends. By @cwfitzgerald in #3272TextureFormat::Stencil8
, allowing for stencil testing without depth components. By @Dinnerbone in #3343add_srgb_suffix()
forTextureFormat
for converting linear formats to sRGB. By @Elabajaba in #3419GLES
TextureFormat::Rgba8Unorm
and (non-web only)TextureFormat::Bgra8Unorm
. By @Wumpf in #3070Vulkan
SHADER_INT16
feature to enable theshaderInt16
VkPhysicalDeviceFeature. By @Elabajaba in #3401WebGPU
MULTISAMPLE_X2
,MULTISAMPLE_X4
andMULTISAMPLE_X8
toTextureFormatFeatureFlags
. By @39ali in 3140TextureFormat.describe
with the spec. By @teoxoy in 3312Metal
Device
andQueue
from raw Metal resources in wgpu-hal. By @AdrianEddy in #3338Bug Fixes
General
hal::Api::CommandBuffer
when awgpu_core::command::CommandEncoder
is dropped. By @jimblandy in #3069.copy_texture_to_texture
by @nical #3090wgpu_types::Features::DEPTH24PLUS_STENCIL8
, makingwgpu::TextureFormat::Depth24PlusStencil8
available on all backends. By @Healthire in (#3151)[https://github.com/gfx-rs/wgpu/pull/3151](https://togithub.com/gfx-rs/wgpu/pull/3151)1]queue_write_texture
by @nical in (#3146)[https://github.com/gfx-rs/wgpu/pull/3146](https://togithub.com/gfx-rs/wgpu/pull/3146)6]RenderPassCompatibilityError
andCreateShaderModuleError
not so huge. By @jimblandy in (#3226)[https://github.com/gfx-rs/wgpu/pull/3226](https://togithub.com/gfx-rs/wgpu/pull/3226)6]gfx_select!
's#[cfg]
conditions at the right time. By @jimblandy in #3253Global::queue_texture_write
. By @jimblandy in #3378.make_spirv_raw
andmake_spirv
handle big-endian binaries. By @1e1001 in #3411.Vulkan
debug_utils_set_object_name()
function toset_debug_utils_object_name()
by @elabajaba in #3273PhysicalDeviceDriverProperties
struct after it has gone out of scope. In fact, don't make a local copy at all. Introduce a helper function for buildingCStr
s from C character arrays, and remove someunsafe
blocks. By @jimblandy in #3076.DX12
depth16Unorm
formats by @teoxoy in #3313GraphicsCommandList
whenclose
orreset
fails. By @xiaopengli89 in #3204Metal
mip_level_count
orarray_layer_count
. By @cwfitzgerald in #3323GLES
WebGPU
log
instead ofprintln
in hello example by @JolifantoBambla in #2858deno-webgpu
setVertexBuffer
andsetIndexBuffer
calls onGPURenderBundleEncoder
throw an error if thesize
argument iszero, rather than treating that as "until the end of the buffer".
By @jimblandy in #3171
Emscripten
framework.rs
compile again under Emscripten. By @jimblandy in #3246Examples
stencil-triangles
to show basic use of stencil testing. By @Dinnerbone in #3343Testing/Internal
minimum supported rust version
to 1.64ResourceMetadata
into its own module. By @jimblandy in #3213v0.14.2
Compare Source
Bug Fixes
get_mapped_range
by @nical in #3233Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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 has been generated by Mend Renovate. View repository job log here.