Commit Graph
2176 Commits
Author SHA1 Message Date
Zachary Harrold 66263789bc [wgpu-core]: Remove x_instead_of_y exceptions (#7598) 2025-04-23 03:17:29 +00:00
teoxoy 3b72d59a3c make memory pressure detection optional and configurable 2025-04-22 09:21:27 +02:00
teoxoy 7b482622d3 allow sampler creation to return OOMs
This is to preserve the current behavior as tested by the `SAMPLER_CREATION_FAILURE` test.

This is not spec compliant but it's unclear what we should do instead. I opened https://github.com/gpuweb/gpuweb/issues/5142 to figure out what we should do.
2025-04-22 09:21:27 +02:00
teoxoy c13fc3d141 don't call release_gpu_resources when losing the device
This removes the possibility of deadlocks happening since `release_gpu_resources` tries to lock resources (trackers, snatchable_lock, pending_writes, life_tracker) while they might be already locked; `handle_hal_error` is called in lots of places.

Removing the call only delays destruction since `release_gpu_resources` is still called in `maintain`.
2025-04-22 09:21:27 +02:00
teoxoy ece29b6e68 [D3D12/VK] add OOM check on submit and poll that will lose the device if we are over 95% of our budget 2025-04-22 09:21:27 +02:00
teoxoy c144f2a697 invalidate Device on OOM errors with the exception of buffer, texture, query set and acceleration structure creation 2025-04-22 09:21:27 +02:00
teoxoy c49620d1a2 add device validity checks to Queue methods 2025-04-22 09:21:27 +02:00
RedMindZ f64eae7734 Fixed a deadlock caused by locking the device's snatchable lock **after** locking the queue's pending writes (#7582) 2025-04-21 11:08:57 -04:00
Ebbe Steenhoudt 7cab1747ee Loosen Viewport validation requirements to match the new specs (#7564) 2025-04-18 15:17:53 +02:00
teoxoy 597114052e [d3d12] get vertex_index & instance_index builtins working for indirect draws 2025-04-15 17:56:17 +02:00
Teodor Tanasoaia 78d05f5f71 [core] check that indirect buffers have not been destroyed (#7534) 2025-04-14 11:06:32 -04:00
Connor Fitzgerald 45d8f42513 Use workspace package information everywhere 2025-04-10 20:41:28 -04:00
Bruce Mitchener dde9422114 Fix build with profiling enabled (#7509) 2025-04-11 00:34:05 +00:00
Bruce Mitchener 3081c4f094 Fix typos (#7510) 2025-04-10 15:09:03 -04:00
Connor Fitzgerald 8c2c2ce203 Release v25 (#7505) 2025-04-10 16:13:02 +00:00
Vecvec 8010203281 Rework acceleration structure build tracking. 2025-04-09 22:27:04 -04:00
Vecvec 382a1e3c9b Make submission index lockable. 2025-04-09 22:27:04 -04:00
Vecvec 1c4b73c098 Implement as_hal for BLASes and TLASes (#7303) 2025-04-09 14:50:43 -04:00
Sylvain BennerandConnor Fitzgerald 14690470bb [metal] Metal compute shader passthrough (#7326)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-04-09 14:25:41 +00:00
Vecvec e8e66afb72 Fix new acceleration structure building validation errors. (#7486) 2025-04-07 15:17:06 +02:00
Connor Fitzgerald c860a2cf8c Rename and unsafe start_capture -> start_graphics_debugger_capture (#7470)
* Improve `start_capture` docs

* Docs
2025-04-03 13:07:22 -04:00
Connor Fitzgerald c344bec508 Comments 2025-04-03 10:35:20 -04:00
Connor Fitzgerald 6a986f4bc4 Timestamp normalization 2025-04-03 10:35:20 -04:00
Josh Groves ab38e8e430 Avoid overflows for extreme scissor coordinates (#7459) 2025-04-01 09:47:39 -04:00
Connor Fitzgerald a9279de793 Fix assorted issues with WebGL (#7448)
* Fix validation error when configuring the surface on WebGL

* Remove unneeded `webgl` feature

* Fix compilation of the `noop` backend on `wasm32`

* Prevent `webgpu` examples from incorrectly falling back to WebGL

* Reduce dependency set when building wasm examples

* Fix various warnings
2025-03-31 22:02:21 -04:00
Erich Gubler 1d4740e89d build: upgrade ron 0.8.1 → 0.9.0 2025-03-26 16:03:03 -04:00
teoxoy 9a2b5fdb70 abstract away usage of scratch space for buffer barriers and unique index iterators 2025-03-26 18:26:31 +00:00
teoxoy 3705928273 [validate_draw] refactor out an is_bit_set function 2025-03-26 18:26:31 +00:00
teoxoy 7d15c511de move indirect validation code to its own folder
rename items appropriately
internalize indirect buffer bind groups
2025-03-26 18:26:31 +00:00
teoxoy ef622c1061 validate multi draw indirect calls 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
teoxoy 53c2d15e0b implement indirect draw validation 2025-03-26 18:26:31 +00:00
Erich Gubler 299079fb69 chore: remove unnecessarily allow'd unused_braces (#7416) 2025-03-24 22:23:24 +00:00
Bruce Mitchener ccaf9a84f8 Fix clippy::implicit_saturating_sub lints (#7395) 2025-03-22 13:17:34 -04:00
Bruce Mitchener edd0ef80af Fix clippy::manual_repeat_n lints (#7394) 2025-03-22 16:18:34 +00:00
Bruce Mitchener b7e7d7ce7a Fix clippy::manual_contains lints (#7384) 2025-03-20 21:55:52 -04:00
Connor Fitzgerald 4687973c9a Use bytemuck instead of slice::from_raw_parts for transmutes (#7376) 2025-03-19 22:05:21 -04:00
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
Erich Gubler 4db992a66d refactor(core): avoid manually reimplemented sort_by_key (#7366) 2025-03-18 17:43:04 -04: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 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
David ZhongandErich Gubler 3eb1bd53bb Use TextureViewDescriptor::usage when Creating Texture View (#7162)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-03-11 13:01:23 -04: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
Kevin Reid 16d41cfaf3 Make std usage optional for wgpu-core. (#7279)
* Make `wgpu_core::snatch::LockTrace` fully instead of partially conditional.

Now, when `cfg(not(debug_assertions))`, there is no `SNATCH_LOCK_TRACE`
thread local, and `LockTrace` has no data fields.

* Make `std` usage optional for `wgpu-core`.

Adds a `std` feature, enabled by default, to `wgpu-core`. When that
feature is disabled, the following functionality is not available:

* `Send + Sync` for resources.
* `trace` feature.
* `observe_locks` feature.
* Snatch lock recursive locking assertion.
2025-03-06 14:07:38 -05:00
Matilde Morrone 7eb69f43b6 Add DRM support to Vulkan backend (#7212)
* Add basic drm support to vulkan backend

* Move vulkan drm implementation to its own module

* Properly feature gate drm support and add safety docs

* Disable drm on wasm targets

* Remove old fixme comment from vulkan drm backend

* Move cfg check inside drm module

* Use expect instead of allow for create_surface_from_drm

* Document that drm is not available on apple platforms
2025-03-04 20:53:38 +00:00
Vecvec 5b3266db23 Support getting hit vertex positions (#7183) 2025-03-04 20:06:44 +01:00
Erich Gubler 0b5197d8d0 refactor: sync. wgpu-core's allow(clippy::arc_with_non_send_sync) to wgpu (#6771) 2025-02-28 12:37:30 -05:00
Erich Gubler 6f0c2434a7 chore(hal,core): use core::{error::Error,format} instead of std
This allows `wgpu-hal` to be used in `no_std` environments, except that
currently, only the `noop` backend supports `no_std`.
In the future, `cfg(all(gles, webgl))` should also be `no_std`, but that
requires further work.

Co-Authored_by: Kevin Reid <kpreid@switchb.org>
2025-02-26 22:58:50 -05: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