Commit Graph
383 Commits
Author SHA1 Message Date
Andy Leiserson bcc59481c9 Eagerly initialize buffer tails (#9791) 2026-07-08 17:22:05 -04:00
Sam 4e9fd048d3 [core] Make some Global methods thin in device (#9826)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-07-07 15:08:49 +02:00
Sam 52a280d631 [core] Move validity into Arc<Buffer> (#9803)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-07-06 13:51:11 +02:00
Sam 9749877df6 [core] Move validity into Arc<Blas> (#9800)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-07-06 12:33:51 +02:00
Sam 7418e2d1c1 [core] Use two staged validity in Texture. (#9788) 2026-07-02 09:06:09 +02:00
Sam b76a432a27 [core] Move Fallible into Arc<Texture> (#9718)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-06-25 19:27:44 +02:00
Andy Leiserson 7d549d9d2f fix(webgl): Add destination of copy_external_image_to_texture to PendingWrites (#9727) 2026-06-24 14:12:06 -04:00
Sam c29a05d6dd fix(core): Deferred query set destruction (#9704)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-06-18 14:39:08 -07:00
Teoxoy ab33a724dc [wgpu-core] add query set initialization tracking
Vulkan, D3D12 and Metal require slots of query sets to
have been written prior to resolving them into a buffer.
2026-06-17 11:53:01 -07:00
Sam 019bce9139 Implement QuerySet::destroy (#9671)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-06-16 12:37:11 +02:00
Andy Leiserson 560b763f64 fix(core): Correctly track texture init state after writing one aspect 2026-06-03 19:33:29 +02:00
Vecvec a1fceed071 Move fence synchronisation into wgpu-hal (#9475) 2026-05-28 14:49:12 -07:00
Andy Leiserson 6469861478 Small optimization to prepare_surface_texture_for_submit (#9473) 2026-05-08 13:39:47 -07:00
Andy Leiserson 54bf53eb11 fix(core): Check for device loss on all submit paths (#9478) 2026-05-06 19:06:19 +02:00
Andy Leiserson e1e4bb1a14 fix(core): Flush pending writes before mapAsync, if needed
Fixes #5173
2026-04-29 10:24:42 -07:00
Andy Leiserson 0aaa7ff4b1 fix(core): Flush pending writes in on_submitted_work_done 2026-04-29 10:24:42 -07:00
Andy Leiserson 8e9f7e572b refactor(core): Make submit_with_pending_writes more general
Extend the command_index lock through submission
2026-04-29 10:24:42 -07:00
Andy Leiserson 78c90239c1 chore(core): Remove an unused error variant 2026-04-29 10:24:42 -07:00
Andy Leiserson 90dd7435e9 fix(core): Don't overlap QUEUE_PENDING_WRITES and QUEUE_LIFE_TRACKER locks 2026-04-22 14:36:17 -04:00
Andy Leiserson 458d310916 docs: Update lock graph
Related to #5572
2026-04-22 14:36:17 -04:00
atlas 20f5c7430e fix(core): use wait_for_idle instead of timeout loop to wait for present in Queue drop 2026-04-14 10:51:03 +02:00
atlas 4c61d61361 fix(core): Keep surface texture alive through present preparation 2026-04-14 10:51:03 +02:00
atlas 12ab856f6c feat(core): Move present from Surface to Queue 2026-04-14 10:51:03 +02:00
atlas c662f2a595 refactor(core): Factor out submit_pending_writes from Queue::submit 2026-04-14 10:51:03 +02:00
Andy Leiserson acc5855e1f fix(core): Use more checked arithmetic, part 2 (#9363) 2026-04-09 15:21:20 -06:00
Ali 65a5c2b3bc fix Queue::writeBuffer : raise a validation error for out-of-bounds transfers on zero-size buffers (#9374) 2026-04-08 16:03:13 +00:00
Andy Leiserson 11db97cf1b fix(core): Use more checked arithmetic (#9357) 2026-04-01 15:23:21 -07:00
Niklas EickerandConnor Fitzgerald 62c2f5da97 Move ordered usages to hals (#8924)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-03-15 03:23:32 +00:00
Andy Leiserson d152e7369b Reduce binary bloat from error vtables (#9149) 2026-03-04 08:52:24 -08:00
Erich GublerandJim Blandy f24e8a9273 fix(core)!: validate start + size for buffer ops in more places
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-02-20 10:34:58 -05:00
Erich Gubler 3e4f439b0b refactor(core)!: ArcCommand::WriteBuffer: serialize offset and size instead of start..end 2026-02-20 10:34:58 -05:00
Erich Gubler 7d27b2f1e4 refactor(core)!: replace TransferError::BufferOverrun::end_offset with transfer's size
BREAKING CHANGE: Transfer operations are expressed in terms of a start
offset and a size. Trying to store anything else in errors and traces
yields extra complexity and loses clarity. Change
`TransferError::BufferOverrun` so that its `end_offset` field is no
more. Instead, add a `size` field that should only ever be saving off
fields already provided by user operations.
2026-02-20 10:34:58 -05:00
Alexander Meißner 05861da365 [hal metal] ray tracing acceleration structures (#8071)
* Fixes index_buffer label in ray_traced_triangle example.

* Fixes min_push_constant_size in ray_shadows example.

* Ensures there always is Some() buffer reference, even for get_acceleration_structure_build_sizes().

* Updates CHANGELOG.

* Adds feature detection.

* Adds Capabilities Limits.

* Adds necessary objc2-metal features in Cargo.toml

* Sets raw_tlas_instance_size.

* Sets ray_tracing_scratch_buffer_alignment.

* Adds conv::map_index_format().

* Adds conv::map_acceleration_structure_descriptor().

* Implements AccelerationStructure.

* Implements resource binding.

squash with "Implements resource binding."

* Adds CommandState::acceleration_structure_builder.

* Implements CommandEncoder::copy_acceleration_structure_to_acceleration_structure().

* Implements CommandEncoder::build_acceleration_structures().

* Implements CommandEncoder::place_acceleration_structure_barrier().

* Implements CommandEncoder::read_acceleration_structure_compact_size().

* Implements Device::get_acceleration_structure_build_sizes().

* Implements Device::get_acceleration_structure_device_address().

* Implements Device::create_acceleration_structure().

* Implements Device::destroy_acceleration_structure().

* Implements Device::tlas_instance_to_bytes().

* Adds CommandEncoder::set_acceleration_structure_dependencies().

* Review feedback
2026-02-19 06:21:11 +13:00
Erich Gubler 9bc127f128 chore: update CORE_MSRV to 1.90 (#8943)
New cases for some Clippy lints pop up as part of this upgrade that
cannot be done before, listed below. Yuck!

- `clippy::manual_is_multiple_of`
- `clippy::missing_const_for_fn`
- `clippy::useless_nonzero_new_unchecked`
2026-01-27 19:37:10 -05:00
Andy Leiserson 985da29bcf Add in-memory tracing and inline data in traces 2026-01-09 15:55:33 +01:00
Andy Leiserson e412592b23 Store failed commands in traces 2026-01-09 15:55:33 +01:00
Andy Leiserson 7985f571be Adjust the placement of the zero size check for some texture copies (#8567) 2025-11-26 18:12:47 +01:00
Andy Leiserson 71820eef20 Fix performance regression in bind group processing (#8519) 2025-11-14 00:10:42 -05:00
Erich Gubler e2e4651ecb fix(core): validate that buffer is unmapped in write_buffer calls 2025-11-05 16:12:58 -05:00
Andy Leiserson e584f382e0 Store pointers instead of IDs when tracing (1/2)
This updates pass operations.

The trace player is temporarily broken.
2025-10-30 13:52:58 +01:00
Andy Leiserson 3ca6a1c0df Defer some bind group processing until draw/dispatch
This allows us to save some work when a bind group is replaced,
although WebGPU still requires us to fail a submission if any
resource in any bind group that was ever referenced during
encoding is destroyed.

Fixes #8399
2025-10-23 14:59:25 +02:00
Andy Leiserson d575c0234b Disallow mixing the raw encoding API with the wgpu API (#8373) 2025-10-22 11:34:40 -04:00
Andreas Reich 00ea850d79 Allow timeouting on poll (#8282) 2025-10-01 07:19:24 +00:00
Andy Leiserson aaf52e93d9 Move some *Copy*Info types out of wgpu_core::command::transfer
In the future `transfer` will want to use the `Arc` versions of these
types. I have exported them from `wgpu_core::command::ffi`, to document
that these are used for FFI purposes, and from `wgpu_core::command`, for
backwards compatibility, although I also change the in-tree uses to
use them from `wgpu_types` instead of from `wgpu_core::command`.
2025-09-11 10:20:03 -07:00
Andy Leiserson d79a49a060 Rename commands to trace_commands 2025-09-11 10:20:03 -07:00
Andy Leiserson 4853133eaa Fix buffer initialization tracking for some buffer-texture copies (#8099)
Fixes #7947
Fixes #8021
Fixes #8097
2025-09-04 14:15:31 -07:00
Andy Leiserson 989d48ccb6 Tweak the bytes_per_row alignment check
Previously, the check was skipped if the copy was a single row, which is
not correct. The check should be made whenever bytes_per_row is
specified. It is permissible not to specify bytes_per_row if the copy is
a single row, but if it is specified, it must be aligned.

Also removes a redundant check of the `offset` alignment.

Since the offset and bytesPerRow alignment checks are not part of
"validating linear texture data", I chose to remove that instance of
them. These checks are now in `validate_texture_buffer_copy`, which
does not correspond 1:1 with the spec, but has a comment explaining how
it does correspond.
2025-09-04 14:15:31 -07:00
Matthias Reitinger 80a742094c [wgpu-core] Improve errors for forbidden texture copy formats (#8156)
TransferError now has separate variants for texture copy formats that
are only forbidden in combination with specific aspects
(CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that
are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).

This produces a less confusing error message by not mentioning the
aspect it is not relevant.
2025-08-29 10:03:35 +00:00
Connor Fitzgerald 884cea5ad9 Narrow locks in queue::write_buffer (#8146) 2025-08-25 11:54:30 -04:00
Vecvec c4a834e4f9 Make the compacted hal acceleration structure inherit a label from the base BLAS. #8103 2025-08-24 09:11:13 +00:00