Commit Graph

7908 Commits

Author SHA1 Message Date
teoxoy
d3eed4920b put all state in State 2024-06-27 10:20:11 +02:00
teoxoy
83a8699be7 remove multi_draw_indirect2 2024-06-27 10:20:11 +02:00
teoxoy
3dcd5ab422 move comment that was preventing fmt from running 2024-06-27 10:20:11 +02:00
teoxoy
ebb930e9fd add more fields to State and cleanup fn params 2024-06-27 10:20:11 +02:00
teoxoy
9791b6ccb9 extract render bundle command processing into their own functions 2024-06-27 10:20:11 +02:00
teoxoy
3eb387f413 simplify IndexState 2024-06-27 10:20:11 +02:00
teoxoy
6db9ceede1 inline pipeline.as_info().id() 2024-06-27 10:20:11 +02:00
teoxoy
fb60aa86c3 use .error_ident() for api_log!s in render_pass_end_impl 2024-06-27 10:20:11 +02:00
XiaoPeng
82210e1cdc remove stale weak refs before insert view/bind_groups 2024-06-26 10:18:07 +02:00
XiaoPeng
3d5d7dec02 clear refs to died texture views 2024-06-26 10:18:07 +02:00
Nicolas Silva
e92e543b7b Allow clippy::pattern_type_mismatch in hal
For the same reasons we allow it in core.
2024-06-25 15:11:47 +02:00
teoxoy
bfcb5457c6 remove unnecessary unsafe block 2024-06-25 11:14:41 +02:00
teoxoy
ad2d797f81 move InvalidQueueId error variant to top level error types 2024-06-25 11:14:41 +02:00
teoxoy
3005b46a29 inline ComputePass.parent_id() 2024-06-25 11:14:41 +02:00
teoxoy
f55fa6e217 make ResourceInfo.label private 2024-06-25 11:14:41 +02:00
teoxoy
a56698cbe6 use .error_ident() in a few more places 2024-06-25 11:14:41 +02:00
teoxoy
8106028f23 remove ResourceInfo.label() 2024-06-25 11:14:41 +02:00
teoxoy
c4e067b394 use .error_ident() for resource_log! in Drop impls 2024-06-25 11:14:41 +02:00
teoxoy
5f78485f30 pass Label to ResourceInfo::new 2024-06-25 11:14:41 +02:00
teoxoy
beaa6e95e4 remove duplicate label fields 2024-06-25 11:14:41 +02:00
teoxoy
bbf824767d remove IDs from Destroyed{Buffer,Texture} 2024-06-25 11:14:41 +02:00
teoxoy
d5d806a474 pass through pipeline_id instead of getting it via .as_info().id() 2024-06-25 11:14:41 +02:00
teoxoy
1b40c8c745 replace check_valid_to_use with ParentDevice.same_device checks 2024-06-25 11:14:41 +02:00
teoxoy
06da3e88d0 remove IDs from QueryResetMap 2024-06-25 11:14:41 +02:00
teoxoy
d30c02ffa3 use .error_ident() for resource logging 2024-06-25 11:14:41 +02:00
teoxoy
eeb57e1cee pass BufferId to unmap for tracing 2024-06-25 11:14:41 +02:00
teoxoy
1a4f6aca6f trace as soon as possible 2024-06-25 11:14:41 +02:00
teoxoy
fd52ec8997 remove tracing from deferred texture view and bind group destruction
we already trace texture view and bind group drop in the corresponding `Global` methods so we might end up with double drop actions
2024-06-25 11:14:41 +02:00
teoxoy
812a562331 remove tracing from Destroyed{Buffer,Texture} drop impl
we already trace buffer drop and destroy in the corresponding `Global` methods so we might end up with double drop/destroy actions
2024-06-25 11:14:41 +02:00
teoxoy
f2ea30772c move destroy/drop tracing actions in Global's methods 2024-06-25 11:14:41 +02:00
teoxoy
e2c4348959 replace .then_some(()).ok_or_else(e) with ifs 2024-06-25 11:14:41 +02:00
Andreas Reich
b4c7987aa7
Separate renderpass arc resolve & renderpass consume on end (#5794) 2024-06-25 09:37:29 +02:00
Jim Blandy
29e3b984a4 [naga] Use HandleSet in Validator::needs_visit.
Change the type of `naga::valid::Validator::needs_visit` from `BitSet`
to `HandleSet`. Adjust uses.

Add `HandleSet` method `iter`.
2024-06-25 09:34:30 +02:00
Jim Blandy
71a52bdba4 [naga spv-out] Use HandleSet in ExpressionConstnessTracker.
Change `naga:🔙:spv::ExpressionConstnessTracker::inner` from a
`BitSet` to a `HandleSet<Expression>`. Adjust uses.
2024-06-25 09:34:30 +02:00
Jim Blandy
43f390e86f [naga] Use HandleSet in Validator::valid_expression_set.
Add `HandleSet` methods `new`, `clear`, `clear_for_arena`, and
`remove`.

Change the type of `naga::valid::Validator::valid_expression_set` from
`BitSet` to `HandleSet`. Adjust uses.
2024-06-25 09:34:30 +02:00
Jim Blandy
f262dce065 [naga] Change HandleSet::insert to return a bool.
Change `HandleSet::insert` to return `true` if the handle was not
already in the set.

Change uses in `naga::compact` which were taking advantage of the
prior return type of `()` to avoid needing to use semicolons in
`match` arms.
2024-06-25 09:34:30 +02:00
Jim Blandy
0656fb8ea8 [naga] Use HandleSet in naga::proc::index.
Change `naga::proc::index::find_checked_indexes` to return a
`HandleSet<Expression>`, rather than an untyped `BitSet`.

Fix uses in the Metal Shading Language backend.
2024-06-25 09:34:30 +02:00
Jim Blandy
aac6fc7267 [naga] Move HandleSet from compact into arena. 2024-06-25 09:34:30 +02:00
Jim Blandy
34f5376517 [naga] Clarify Debug form of arena::Range.
Change the `std::fmt::Debug` impl for `naga::arena::Range` to print a
start-inclusive, end-exclusive range.

- This is more consistent with Rust's `std::ops::Range`.

- This is consistent with the serialization form used in snapshots,
  which simply uses the serialization of `std::ops::Range`.

- It is not consistent with Naga's constructor function
  `Range::new_from_bounds`, which takes an inclusive end value, or
  with `Range::first_and_last`, which returns an inclusive end value.
  Both of these need to represent ranges' end points as `Handle`s, but
  exclusive end values might not be valid `Handle` values. I think
  this divergence is tolerable.
2024-06-25 09:27:15 +02:00
Jim Blandy
a5d57db269 [naga] Break naga::arena up into submodules.
This commit is almost entirely code motion. The only meaningful
changes should be:

- changes to imports
- changes to visibility
- changes to use visible associated constructor functions instead of
  trying to construct values directly using now-invisible fields
- moving the crate-level "Arena" docs into the `arena` module
2024-06-24 12:42:02 -07:00
Jim Blandy
bef9eb4074 [naga] Move naga/src/arena.rs to naga/src/arena/mod.rs. 2024-06-24 12:42:02 -07:00
Jim Blandy
3623c54fb7 [naga] Use Handle::new, don't construct the Handle directly.
In preparation for making `Handle` fields private to another module,
have the `Iterator` implementation for `arena::Range` call
`Handle::new` to construct the handle being produced, rather than
building it using a struct literal.
2024-06-24 12:42:02 -07:00
Jim Blandy
3e20909ade [naga] Use Range::from_index_range in Arena::range_from.
Use the associated function `Range::from_index_range` to construct the
return value of `Arena::range_from`, rather than constructing the
`Range` directly, in preparation for those fields becoming private.
2024-06-24 12:42:02 -07:00
9SMTM6
a7d4d2c79f
Allow using include_wgsl! in const contexts (#5872)
* include_wgsl! Switch from into() call to construction

This allows usage in const contexts.

* Describe constification of include_wgsl! in changelog
2024-06-24 17:46:30 +00:00
teoxoy
333ed78529 [gl] reorder program_cache & context lock acquisition
We are using `program_cache.try_lock()` when creting pipelines which is covered by a guard gotten from `context.lock()`. For the `.try_lock()` to always succeed we need to make sure that the other lock acquisitions are also covered by a `context.lock()`.

The `wgpu_examples::hello_compute::tests::multithreaded_compute` test has been failing intermittently in CI due to this.
2024-06-24 16:57:06 +02:00
Teodor Tanasoaia
7cf071195b [glsl] add more reserved keywords from previous specs 2024-06-24 16:55:36 +02:00
Nicolas Silva
ddff69ba21
Avoid leaking submitted command encoders (#5141)
* Avoid leaking submitted command encoders

* changelog
2024-06-24 12:16:55 +00:00
Kamil Jarosz
355613342e [naga] Add packed as a keyword for GLSL
Turns out that sometimes `packed` is a keyword,
and the produced GLSL had syntax errors due to that.
2024-06-24 11:21:24 +02:00
Nicolas Silva
1de04926b1
Add infrastructure for counting and reporting internal resources (#5708)
* Add an optional system for counting and reporting internal resources and events
* Count API objects in wgpu-hal
* Expose internal counters in wgpu-core and wgpu.
2024-06-24 11:20:10 +02:00
Jim Blandy
afc8e38fc1 [naga] Use HandleVec in Layouter.
Change `naga::proc::layouter::Layouter::layouts` to be a `HandleVec`,
not a `Vec`.
2024-06-24 10:32:49 +02:00