658 Commits

Author SHA1 Message Date
Andy Leiserson
27e7408f16 Restore the buffer size changes 2025-07-10 09:52:20 -07:00
Andy Leiserson
b0527800a1 Revert "Restore unintentional support for zero-size buffers"
This reverts commit c0a580d6f0343a725b3defa8be4fdf0a9691eaad.
2025-07-09 16:29:41 -04:00
Andy Leiserson
c0a580d6f0 Restore unintentional support for zero-size buffers 2025-07-08 14:45:12 -07:00
Andy Leiserson
3d0fe3a003 Check the math for buffer-texture copies 2025-07-08 12:11:56 -07:00
Andy Leiserson
b695317a9b
Rg11b10ufloat should be resolvable when it is renderable (#7878) 2025-07-03 17:51:48 -04:00
teoxoy
918fdc98b5 remove reason from ErrorType::DeviceLost since it's always "unknown" and users should register the lost callback instead 2025-07-02 11:11:37 +02:00
Erich Gubler
7ff0bd784e fix!: remove WebGpuError impl. for Request{Adapter,Device}Error 2025-06-30 10:58:56 -04:00
Erich Gubler
964c5bbf4c feat(core): impl WebGpuError for API errors 2025-06-30 10:58:56 -04:00
Erich Gubler
c8752e5118 feat(types): add error::{ErrorType, WebGpuError} APIs 2025-06-30 10:58:56 -04:00
Erich Gubler
c3922d53d7 docs(types): Make docs. on DeviceLostReason variants less terse 2025-06-30 10:58:56 -04:00
SupaMaggie70Incorporated
e40e66d205
DXIL & HLSL passthrough (#7831)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-25 18:12:58 -04:00
Vecvec
dc0d457a9a
Add limits for acceleration structures (#7845) 2025-06-25 14:49:55 -04:00
Jamie Nicol
8cdbcc1755 Add ExternalTexture BindingType behind new Feature flag
Adds a new feature flag, `EXTERNAL_TEXTURE`, indicating device support
for our implementation of WebGPU's `GPUExternalTexture` [1] which will
land in upcoming patches. Conceptually this would make more sense as a
downlevel flag, as it is a core part of the WebGPU spec which we do not
yet support. We do not want, however, to cause applications to reject
adapters because we have not finished implementing this, so for now we
are making it an opt-in feature.

As an initial step towards supporting this feature, this patch adds a
new `BindingType` corresponding to WebGPU's
`GPUExternalTextureBindingLayout` [2]. This binding type dictates that
when creating a bind group the corresponding entry must be either an
external texture or a texture view with certain additional requirements
[3].

As of yet wgpu has no concept of an external texture (that will follow
in later patches) but for now this patch ensures that texture views
corresponding to an external texture binding type are validated
correctly. Note that as the feature flag is not yet supported on any
real backends, bind group layout creation will fail before getting the
chance to attempt to create a bind group. But in the added tests using
the noop backend we can see this validation taking place.

[1] https://www.w3.org/TR/webgpu/#gpuexternaltexture
[1] https://www.w3.org/TR/webgpu/#dictdef-gpuexternaltexturebindinglayout
[2] https://gpuweb.github.io/gpuweb/#bind-group-creation
2025-06-17 15:00:29 -07:00
Dmitry Zamkov
bbb7cc79ef
Implement clip-distances extension for GL and Vulkan backends (#7730)
* Basic implementation of `clip_distances` for Vulkan and GL backends

* Added GPU test for `clip-distances`

* Update feature array size

* Add changelog entry

* Validate `clip_distances` array size

* Check for `clip_distances` enable directive

* Consolidate code for generating `enable` directives in WGSL backend and add `clip_distances`.
2025-06-16 10:33:31 +02:00
Erich Gubler
cf83de3a5d
chore!: remove deprecated type aliases for idents. in 2024-08 spec. rename (#7790)
This backs out commit 9436d56271c6f3141ee5da882355ea45784c446c.
2025-06-12 09:55:00 -04:00
Vecvec
73eb83ded1
[wgpu] Blas compaction (#7285)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-11 21:40:10 -04:00
Vecvec
efbac5dfba
Add extra acceleration structure vertex formats. (#7580) 2025-06-11 18:17:14 -04:00
andristarr
0e1baff277
Navigatable docs for BufferUsages::MAP_WRITE (#7742) 2025-06-01 20:22:56 +09:00
Raphael Hetzel
0d569d5550
Optional web-specific deps for wasm32 (#7565) 2025-05-29 22:26:01 +00:00
Dmitry Zamkov
44957709ff
Vulkan support for SHADER_EARLY_DEPTH_TEST and fix to conservative depth optimizations (#7676)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-05-24 09:52:39 +00:00
Mehmet Oguz Derin
2a62299a84
Support Sliced 3D for ASTC (#7577)
Enables "texture-compression-astc-sliced-3d" for backends that support ASTC (such as excluding D3D12).
2025-05-04 12:48:16 +02:00
Connor Fitzgerald
9fccdf5cf3
Extract texture <-> buffer copy logic to wgpu-types (#7553) 2025-04-28 21:15:59 +00:00
Florian Denis
1806414771
[wgpu-types]: Expose wgpu::Limits::defaults() (#7622) 2025-04-24 09:56:14 -04:00
teoxoy
3b72d59a3c make memory pressure detection optional and configurable 2025-04-22 09:21:27 +02:00
Teodor Tanasoaia
6ea7962da7
[d3d12] remove the need for dxil.dll (#7566) 2025-04-17 16:21:36 +02:00
teoxoy
edbadd2b99 expand on InstanceFlags::VALIDATION_INDIRECT_CALL docs 2025-04-15 17:56:17 +02:00
teoxoy
45d78e2fb4 remove DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW 2025-04-15 17:56:17 +02:00
Connor Fitzgerald
45d8f42513 Use workspace package information everywhere 2025-04-10 20:41:28 -04:00
Connor Fitzgerald
8c2c2ce203
Release v25 (#7505) 2025-04-10 16:13:02 +00:00
Sylvain Benner
14690470bb
[metal] Metal compute shader passthrough (#7326)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-04-09 14:25:41 +00:00
Connor Fitzgerald
460eff4866 [d3d12] Always associate a size with an allocation 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
6a986f4bc4 Timestamp normalization 2025-04-03 10:35:20 -04:00
teoxoy
2ab3b6da8d guarantee DownlevelFlags::COMPUTE_SHADERS when DownlevelFlags::INDIRECT_EXECUTION is enabled 2025-03-26 18:26:31 +00:00
teoxoy
0285e60984 Replace the indirect-validation feature with InstanceFlags::VALIDATION_INDIRECT_CALL.
With the only caveat that device creation will now panic if the `wgsl` feature is not enabled, `InstanceFlags::VALIDATION_INDIRECT_CALL` is set and the device supports `DownlevelFlags::INDIRECT_EXECUTION`.
2025-03-26 18:26:31 +00:00
Connor Fitzgerald
4687973c9a
Use bytemuck instead of slice::from_raw_parts for transmutes (#7376) 2025-03-19 22:05:21 -04:00
Christopher Fleetwood
c6286791fe
feat: implement F16 support in shaders (#5701)
Co-authored-by: FL33TW00D <fleetwoodpersonal@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: ErichDonGubler <erichdongubler@gmail.com>
2025-03-19 16:26:50 +00:00
SupaMaggie70Incorporated
e8ce3ae973
Add mesh shader stages to wgt::ShaderStages and naga::ShaderStage (#7292)
* Initial changes

* Fixed metal backend in wgpu-hal, ran tests
2025-03-15 05:34:20 +00:00
Kevin Reid
029bdb107a docs: Add links and examples for VertexAttribute and friends.
* Added “upward” links from `VertexAttribute` and `VertexBufferLayout`
  to the places they are used.
* Documented the exact expected inputs of `vertex_attr_array!` and hid
  the internal implementation.
* Added doc-test examples for:
    * `VertexBufferLayout`, demonstrating how to construct a
      `VertexBufferLayout` that corresponds to a `struct`.
    * `vertex_attr_array!`, demonstrating exactly what the output of the
      macro is.
2025-03-14 18:31:30 -04:00
Kevin Reid
fbe005f11a Make request_adapter() report which backends were tried.
This will help users determine whether the problem is:

* a backend is not statically enabled
* a backend is not dynamically enabled
* no drivers or physical adapters are present for that backend
  (further distinction would be useful here)
* no adapters met the required criteria

There are deficiencies in the reporting of WebGPU vs. WebGL support.
Those would best be fixed by also fixing the mutual exclusion of those
backends.
2025-03-14 11:45:49 +01:00
Kevin Reid
326ad03ce1 Move trace_dir/trace_path to a custom enum inside DeviceDescriptor.
This allows `wgpu` to not unconditionally depend on `std::path::Path`.
It’s also, in my opinion, more user-friendly, because the feature which
most users will not use (and is not currently functional) is now a
defaultable struct field instead of a required parameter.

The disadvantage is that `wgpu-types` now has to know about tracing.
2025-03-10 22:17:06 -04:00
Andreas Reich
fedc80eb80
[wgsl-in, wgsl-out, glsl-in] WebGPU compliant dual source blending feature (#7146)
Makes the dual source implementation in wgpu WebGPU spec compliant.
Furthermore, makes the dual source blending extension available when targeting WebGPU.
2025-03-08 21:07:37 +01:00
Kevin Reid
7319512778
Additional documentation for buffer mapping, types, and constants. (#7283)
* Additional documentation for buffer mapping, types, and constants.

* Clarify `Snorm` texture format conversion.

* Fix typo.
2025-03-06 19:08:34 +00:00
Bruce Mitchener
e446551b27
docs: Improve linking, backticks (#7281) 2025-03-06 12:37:19 -05:00
SupaMaggie70Incorporated
20bad46d40
Add multiview mesh shaders to wgpu-hal (#7278) 2025-03-06 12:25:55 -05:00
Vecvec
5b3266db23
Support getting hit vertex positions (#7183) 2025-03-04 20:06:44 +01:00
SupaMaggie70Incorporated
a6109bf69b
Mesh shaders - initial wgpu hal changes (#7089)
* Initial(untested commit), vulkan and gles only supported

* Maybe fixed compiles for metal and dx12

* Hopefully fixed compiles for other backends and updated to functional(?) vulkan thing

* Fixed the clippy warning

* Fixed silly documentation mistake

* Fixed issue with multiview feature

* Dummy commit for dummy CI

The CI pooped itself, hopefully this fixes that. Will probably be undone either way.

* Re trigger CI checks, to avoid #7126

* Changes based on code review

* Fixed clippy warning, broken cargo.lock

* Unfucked cargo.lock for real this time

* Switched match to if-let in accordance with review

* Updated changelog

* Fix CI error

Done from web out of impatience

* CI is very angry 😡

Made CI less angry by fixing formatting(hopefully). This commit was also done from GitHub web.

* Removed comment in following request

* Update wgpu-hal/src/vulkan/adapter.rs

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-03-04 00:12:38 +00:00
Erich Gubler
c626d4f819 build: update CORE_MSRV 1.80.1 → 1.82.0 2025-02-26 22:58:50 -05:00
Erich Gubler
8774ab53d5 chore: remove std::mem::* imports now unnecessary with CORE_MSRV
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](https://github.com/rust-lang/rust/pull/123168/).
2025-02-26 22:58:50 -05:00
Erich Gubler
18951ea3d2 build: update CORE_MSRV 1.76.0 → 1.80.1 2025-02-26 22:58:50 -05:00
Kevin Reid
3447b3e7b6 Polish documentation of PresentMode.
* Link to where it is used and how to check support.
* Link from `Auto*` to the variants they refer to.
* Organize mode information into lists.
* Document which value is the default value.
* Various wording changes.

I mostly did not touch the descriptions of the individual modes.
I think that they could use some explanation of jargon (what is a
“presentation engine”, really?) but I am not the person to write that.
2025-02-24 10:15:40 +01:00