Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with trunk #3

Merged
merged 370 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
370 commits
Select commit Hold shift + click to select a range
edc2cd9
introduce `Device.check_is_valid`
teoxoy Jun 19, 2024
4b5666c
move most device validity checks inside the device's methods
teoxoy Jun 19, 2024
0b7a5b0
move command encoder/buffer creation in a new device method
teoxoy Jun 19, 2024
cc7b2db
move `map_async` body in a new buffer method
teoxoy Jun 19, 2024
284c807
reorder `map_async` validation steps
teoxoy Jun 19, 2024
d4b3856
docs(readme): use emoji literals instead of shortcodes (#5843)
onkoe Jun 19, 2024
584f9e1
[core] Improve resource and api logging.
jimblandy Jun 12, 2024
7b89b6d
Fix web example build (#5832)
Wumpf Jun 20, 2024
43177d7
replace uses of `Id.backend()` with `A::VARIANT`
teoxoy Jun 19, 2024
8d805c9
remove `TextureBindGroupState.add_single`'s return type
teoxoy Jun 19, 2024
2a7f09a
make `clear_texture_via_render_passes` infallible (in practice it was…
teoxoy Jun 19, 2024
8465a64
remove usage of Texture IDs in clear code
teoxoy Jun 19, 2024
a21bbdc
remove usage of Buffer IDs in clear code
teoxoy Jun 19, 2024
0c4b449
use `Arc::ptr_eq` for resource equality
teoxoy Jun 19, 2024
836f016
use the tracker index as key in hashmap instead of ID
teoxoy Jun 19, 2024
068da49
use `error_ident` for log instead of ID
teoxoy Jun 19, 2024
87382d7
make `check_buffer_usage` a buffer method
teoxoy Jun 19, 2024
862f195
make `check_texture_usage` a texture method
teoxoy Jun 19, 2024
a979d2e
simplify `BufferTracker.set_single`'s return type
teoxoy Jun 19, 2024
6a181fa
remove IDs from `StatelessBindGroupState`
teoxoy Jun 19, 2024
d221839
take buffer lookup out of `BufferBindGroupState.add_single`
teoxoy Jun 19, 2024
97a038a
make return type of `TextureTracker.set_single` non-optional
teoxoy Jun 19, 2024
a024afe
consolidate destroyed texture/buffer errors and separate them from in…
teoxoy Jun 19, 2024
2ec7254
remove old comment
teoxoy Jun 20, 2024
7bd9195
take resource lookup out of `StatelessTracker.add_single`
teoxoy Jun 20, 2024
08f5eb8
introduce `TextureView.try_raw`
teoxoy Jun 20, 2024
b0d2517
change `BindGroup.raw` to `BindGroup.try_raw`
teoxoy Jun 20, 2024
f507226
remove ID from `QueueSubmitError::BufferStillMapped`
teoxoy Jun 20, 2024
aaec1c3
take resource lookup out of `BufferUsageScope.merge_single`
teoxoy Jun 20, 2024
26eceab
move body of `BufferUsageScope.insert_merge_single` in `BufferUsageSc…
teoxoy Jun 20, 2024
123a59a
change return type of `ResourceMetadataProvider.get` to `&Arc<T>`
teoxoy Jun 20, 2024
5f6848e
remove IDs from `UsageConflict` variants
teoxoy Jun 20, 2024
ef2da1a
rename `UsageConflict` to `ResourceUsageCompatibilityError`
teoxoy Jun 20, 2024
2e1e1cd
inline id getters
teoxoy Jun 20, 2024
1e784c9
use `TrackerIndex` instead of IDs in `PendingWrites`'s fields
teoxoy Jun 20, 2024
2a3c353
[naga] Introduce `Baked` newtype for writing baked expression names.
jimblandy Jun 19, 2024
92287c3
[naga hlsl-out] Use `Baked` for baked expressions.
jimblandy Jun 19, 2024
29aa68e
[naga dot-out] Use `Handle::write_prefixed` instead of `index`.
jimblandy Jun 20, 2024
beb89f7
[naga msl-out] Use `Handle::write_prefixed` instead of `index`.
jimblandy Jun 20, 2024
7721e33
[naga] Delete unused constant `Handle::DUMMY`.
jimblandy Jun 19, 2024
9f498fd
[naga] Use new `NonMaxU32` type for `Handle` indices.
jimblandy Jun 18, 2024
090c906
[naga] Simplify function names and comments.
jimblandy Jun 18, 2024
d6c4d5c
[naga] Manually implement `serde` traits for `NonMaxU32`.
jimblandy Jun 20, 2024
9b5035c
[naga] Introduce `HandleVec`.
jimblandy Jun 20, 2024
35477df
automatically check for subgroup support when creating a naga `Valida…
Elabajaba Jun 20, 2024
7175079
[naga] Fix `cargo doc --document-private-items`.
jimblandy Jun 22, 2024
6405dcf
[naga spv-in] Adjust types of globals used by atomic instructions.
schell Jun 5, 2024
0f6abc9
[naga-cli] add --defines options for the glsl parser (#5859)
theomonnom Jun 23, 2024
f227ca1
docs(CHANGELOG): add entry for #5812
ErichDonGubler Jun 20, 2024
4b485fd
build(deps): bump crate-ci/typos from 1.22.7 to 1.22.9 (#5867)
dependabot[bot] Jun 24, 2024
056d0db
[naga] Use `HandleVec` in `Typeifier`.
jimblandy Jun 23, 2024
9f0a7cb
[naga] Use `HandleVec` in `ExpressionKindTracker`.
jimblandy Jun 23, 2024
afc8e38
[naga] Use `HandleVec` in `Layouter`.
jimblandy Jun 23, 2024
1de0492
Add infrastructure for counting and reporting internal resources (#5708)
nical Jun 24, 2024
3556133
[naga] Add `packed` as a keyword for GLSL
kjarosh Jun 21, 2024
ddff69b
Avoid leaking submitted command encoders (#5141)
nical Jun 24, 2024
7cf0711
[glsl] add more reserved keywords from previous specs
teoxoy Jun 24, 2024
333ed78
[gl] reorder `program_cache` & `context` lock acquisition
teoxoy Jun 24, 2024
a7d4d2c
Allow using include_wgsl! in const contexts (#5872)
9SMTM6 Jun 24, 2024
3e20909
[naga] Use `Range::from_index_range` in `Arena::range_from`.
jimblandy Jun 23, 2024
3623c54
[naga] Use `Handle::new`, don't construct the `Handle` directly.
jimblandy Jun 23, 2024
bef9eb4
[naga] Move `naga/src/arena.rs` to `naga/src/arena/mod.rs`.
jimblandy Jun 22, 2024
a5d57db
[naga] Break `naga::arena` up into submodules.
jimblandy Jun 23, 2024
34f5376
[naga] Clarify `Debug` form of `arena::Range`.
jimblandy Jun 24, 2024
aac6fc7
[naga] Move `HandleSet` from `compact` into `arena`.
jimblandy Jun 23, 2024
0656fb8
[naga] Use `HandleSet` in `naga::proc::index`.
jimblandy Jun 23, 2024
f262dce
[naga] Change `HandleSet::insert` to return a `bool`.
jimblandy Jun 23, 2024
43f390e
[naga] Use `HandleSet` in `Validator::valid_expression_set`.
jimblandy Jun 23, 2024
71a52bd
[naga spv-out] Use `HandleSet` in `ExpressionConstnessTracker`.
jimblandy Jun 23, 2024
29e3b98
[naga] Use `HandleSet` in `Validator::needs_visit`.
jimblandy Jun 23, 2024
b4c7987
Separate renderpass arc resolve & renderpass consume on end (#5794)
Wumpf Jun 25, 2024
e2c4348
replace `.then_some(()).ok_or_else(e)` with `if`s
teoxoy Jun 20, 2024
f2ea307
move destroy/drop tracing actions in `Global`'s methods
teoxoy Jun 20, 2024
812a562
remove tracing from `Destroyed{Buffer,Texture}` drop impl
teoxoy Jun 20, 2024
fd52ec8
remove tracing from deferred texture view and bind group destruction
teoxoy Jun 20, 2024
1a4f6ac
trace as soon as possible
teoxoy Jun 20, 2024
eeb57e1
pass `BufferId` to `unmap` for tracing
teoxoy Jun 20, 2024
d30c02f
use `.error_ident()` for resource logging
teoxoy Jun 20, 2024
06da3e8
remove IDs from `QueryResetMap`
teoxoy Jun 20, 2024
1b40c8c
replace `check_valid_to_use` with `ParentDevice.same_device` checks
teoxoy Jun 20, 2024
d5d806a
pass through `pipeline_id` instead of getting it via `.as_info().id()`
teoxoy Jun 20, 2024
bbf8247
remove IDs from `Destroyed{Buffer,Texture}`
teoxoy Jun 20, 2024
beaa6e9
remove duplicate label fields
teoxoy Jun 20, 2024
5f78485
pass `Label` to `ResourceInfo::new`
teoxoy Jun 21, 2024
c4e067b
use `.error_ident()` for `resource_log!` in Drop impls
teoxoy Jun 21, 2024
8106028
remove `ResourceInfo.label()`
teoxoy Jun 21, 2024
a56698c
use `.error_ident()` in a few more places
teoxoy Jun 21, 2024
f55fa6e
make `ResourceInfo.label` private
teoxoy Jun 21, 2024
3005b46
inline `ComputePass.parent_id()`
teoxoy Jun 21, 2024
ad2d797
move `InvalidQueueId` error variant to top level error types
teoxoy Jun 21, 2024
bfcb545
remove unnecessary unsafe block
teoxoy Jun 21, 2024
e92e543
Allow clippy::pattern_type_mismatch in hal
nical Jun 25, 2024
3d5d7de
clear refs to died texture views
xiaopengli89 Jun 25, 2024
82210e1
remove stale weak refs before insert view/bind_groups
xiaopengli89 Jun 25, 2024
fb60aa8
use `.error_ident()` for `api_log!`s in `render_pass_end_impl`
teoxoy Jun 25, 2024
6db9cee
inline `pipeline.as_info().id()`
teoxoy Jun 25, 2024
3eb387f
simplify `IndexState`
teoxoy Jun 25, 2024
9791b6c
extract render bundle command processing into their own functions
teoxoy Jun 21, 2024
ebb930e
add more fields to `State` and cleanup fn params
teoxoy Jun 21, 2024
3dcd5ab
move comment that was preventing fmt from running
teoxoy Jun 21, 2024
83a8699
remove `multi_draw_indirect2`
teoxoy Jun 21, 2024
d3eed49
put all state in `State`
teoxoy Jun 25, 2024
9b4bb8b
remove `CommandBuffer.limits`
teoxoy Jun 25, 2024
bc2f8ed
extract `set_bind_group` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
3a199cf
extract `set_pipeline` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
5fdb663
extract `set_push_constant` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
fefb9c2
extract `dispatch` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
868b9cd
extract `dispatch_indirect` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
c72af7b
extract `push_debug_group` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
f609e82
extract `pop_debug_group` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
3ff6802
extract `insert_debug_marker` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
e41cfbf
extract `write_timestamp` from `compute_pass_end_impl`
teoxoy Jun 25, 2024
8ee9df9
move same device check and tracker insertion inside `validate_and_beg…
teoxoy Jun 25, 2024
f0f61d9
move the raw encoder in `State`
teoxoy Jun 25, 2024
cbe4b67
put all state in `State`
teoxoy Jun 25, 2024
bc683fa
extract `set_bind_group` from `render_pass_end_impl`
teoxoy Jun 25, 2024
36e5381
extract `set_pipeline` from `render_pass_end_impl`
teoxoy Jun 25, 2024
ae65b70
extract `set_index_buffer` from `render_pass_end_impl`
teoxoy Jun 25, 2024
6cb18ed
extract `set_vertex_buffer` from `render_pass_end_impl`
teoxoy Jun 25, 2024
49800c3
extract `set_blend_constant` from `render_pass_end_impl`
teoxoy Jun 25, 2024
5c941bf
extract `set_stencil_reference` from `render_pass_end_impl`
teoxoy Jun 25, 2024
63e55ce
extract `set_viewport` from `render_pass_end_impl`
teoxoy Jun 25, 2024
b295a45
extract `set_push_constant` from `render_pass_end_impl`
teoxoy Jun 25, 2024
a79ac34
extract `set_scissor` from `render_pass_end_impl`
teoxoy Jun 25, 2024
1226589
extract `draw` from `render_pass_end_impl`
teoxoy Jun 25, 2024
e92fac0
extract `draw_indexed` from `render_pass_end_impl`
teoxoy Jun 25, 2024
df08509
extract `multi_draw_indirect` from `render_pass_end_impl`
teoxoy Jun 25, 2024
c42c02e
extract `multi_draw_indirect_count` from `render_pass_end_impl`
teoxoy Jun 25, 2024
4edebc6
extract `push_debug_group` from `render_pass_end_impl`
teoxoy Jun 25, 2024
10cf23b
extract `pop_debug_group` from `render_pass_end_impl`
teoxoy Jun 25, 2024
02f9116
extract `insert_debug_marker` from `render_pass_end_impl`
teoxoy Jun 25, 2024
f7160e7
extract `write_timestamp` from `render_pass_end_impl`
teoxoy Jun 25, 2024
3c389b9
resolve occlusion query set prior to `render_pass_end_impl`
teoxoy Jun 26, 2024
1e9844a
extract `execute_bundle` from `render_pass_end_impl`
teoxoy Jun 26, 2024
d0e63c5
move `pipeline` ident to `DispatchError::IncompatibleBindGroup`
teoxoy Jun 26, 2024
287d8ee
move `pipeline` ident to appropriate errors
teoxoy Jun 26, 2024
400372f
remove buffer id from set index/vertex buffer scopes
teoxoy Jun 26, 2024
ab1fa7d
remove compute pipeline id from set compute pipeline scope
teoxoy Jun 26, 2024
a2c60ce
remove render pipeline id from set render pipeline scope
teoxoy Jun 26, 2024
f54b354
use `.validate_dynamic_bindings()` in render bundle's `set_bind_group`
teoxoy Jun 26, 2024
92c8cf4
remove bind group id from set bind group scope
teoxoy Jun 26, 2024
c33de62
Merge remote-tracking branch 'refs/remotes/gfx-rs/trunk' into ray-tra…
Vecvec Jul 1, 2024
9d12a0a
build(deps): bump the patch-updates group across 1 directory with 27 …
dependabot[bot] Jul 1, 2024
c9a2d97
buffer size mismatch: more detail in error message (#5858)
nolanderc Jul 1, 2024
0a76c0f
Renderpass take resource ownership (#5884)
Wumpf Jul 1, 2024
f25e07b
Fix soundness issue with Snatchable
nical Jul 1, 2024
981db9b
trace only `compute_pass_end_with_unresolved_commands`
teoxoy Jun 20, 2024
fc6fe76
trace only `render_pass_end_with_unresolved_commands`
teoxoy Jun 25, 2024
d26aef5
use `.error_ident()` for `log::trace!` in `render_pass_end`
teoxoy Jul 2, 2024
66777cc
remove `PassErrorScope::PassEncoder` and id arg of `PassErrorScope::P…
teoxoy Jun 26, 2024
a422d1c
remove `ResourceInfo.id`
teoxoy Jun 26, 2024
90f7377
introduce `ResourceType` trait
teoxoy Jun 26, 2024
727956f
introduce `StorageItem` trait
teoxoy Jun 26, 2024
985968f
remove unused `Resource` bound
teoxoy Jun 26, 2024
ae7da8f
introduce `Labeled` trait
teoxoy Jun 27, 2024
c63f0a0
introduce `Trackable` trait
teoxoy Jun 27, 2024
c3ebfde
remove `Resource` trait
teoxoy Jun 27, 2024
f34f7eb
impl `ParentDevice` via macro
teoxoy Jun 27, 2024
6fe041d
make `Queue.device` non-optional
teoxoy Jun 27, 2024
a4bb5df
rename error variants that contain IDs
teoxoy Jun 27, 2024
4df5474
remove `MissingCopyDstUsageFlag` error variants
teoxoy Jun 27, 2024
1841857
use `.check_usage()` for `QUERY_RESOLVE`
teoxoy Jun 27, 2024
2fe761f
remove `MissingCopySrcUsageFlag` error variant
teoxoy Jun 27, 2024
ca0027d
use `ResourceErrorIdent` in a few buffer error variants
teoxoy Jun 27, 2024
9ec0f45
move the BGL compatibility check in the binder
teoxoy Jun 27, 2024
0d53987
simplify the BGL compatibility check
teoxoy Jun 27, 2024
42e16c7
simplify logic of `Entry.is_valid`
teoxoy Jun 27, 2024
4a19ac2
introduce `MultiError` and use it for BGL incompatibility errors
teoxoy Jun 28, 2024
9d3d4ee
implement exclusive pipeline validation
teoxoy Jun 28, 2024
ed1e8ec
remove label getters from Global
teoxoy Jun 28, 2024
df7a6de
don't print the scope twice
teoxoy Jun 28, 2024
08b8e96
move `ContextError`'s fmt logic in its Display impl
teoxoy Jun 28, 2024
3547138
remove `PrettyError`
teoxoy Jun 28, 2024
c4d71d9
use `Registry.get()` instead of `Registry.read().get_owned()`
teoxoy Jul 1, 2024
b904e2c
use `Registry.get()` for `device_set_device_lost_closure`
teoxoy Jul 1, 2024
16c7d84
remove `Registry.try_get()`
teoxoy Jul 1, 2024
896418c
Panic on non-existent entry in `Storage.get`, this is consistent with…
teoxoy Jul 1, 2024
1f6ac35
change `Storage.force_replace` to take an `Arc<T>`
teoxoy Jul 1, 2024
79b15b8
move out ID to BGL mapping from `Device.create_pipeline_layout()`
teoxoy Jul 1, 2024
d8b0b59
assign resources/errors in the `Global`'s pipeline creation functions
teoxoy Jul 1, 2024
1be5194
move out ID to resource mapping code from pipeline creation methods
teoxoy Jul 2, 2024
b61be30
move out ID to resource mapping code from `Device.create_bind_group`
teoxoy Jul 2, 2024
69b44c6
gate fns behind either `serde` or `replay` since Firefox needs those
teoxoy Jul 2, 2024
3ad91f2
fix merge
Vecvec Jul 3, 2024
8555869
clippy
Vecvec Jul 3, 2024
b8c5b22
don't clone resources for `ResourceMetadataProvider::Direct`
teoxoy Jul 2, 2024
7b38700
make `Device.create_buffer` return an `Arc<Buffer>`
teoxoy Jul 2, 2024
a971e7f
remove duplicate check, it's already present in `Device.create_buffer`
teoxoy Jul 2, 2024
029168f
remove no-op, calling `schedule_resource_destruction` with `last_subm…
teoxoy Jul 2, 2024
53c79bd
move buffer creation logic in a new `Device` method
teoxoy Jul 2, 2024
dc55cb4
add `Texture::new` fn
teoxoy Jul 2, 2024
40022c1
remove duplicate check, it's already present in `Device.create_textur…
teoxoy Jul 2, 2024
7f3e1bb
move code after calls to `FutureId.assign` inside `Device` fns
teoxoy Jul 2, 2024
96255d4
change `FutureId.assign` to not return a clone of the resource passed…
teoxoy Jul 2, 2024
cd9f003
move `Device.set_queue` call in `create_device_and_queue_from_hal`
teoxoy Jul 2, 2024
39a268c
remove `FutureId.assign_existing`
teoxoy Jul 2, 2024
dbcb273
remove `StatelessTracker.add_single`
teoxoy Jul 2, 2024
249c802
simplify `State.set_bind_group`
teoxoy Jul 2, 2024
9308e15
use `Storage.get_owned` in cases where we used to later clone the res…
teoxoy Jul 2, 2024
3df4c8a
remove unused `std::ops::Index` impl for `Storage`
teoxoy Jul 2, 2024
addd80c
replace `Registry.read().get_owned()` with `Registry.get()`
teoxoy Jul 2, 2024
4f62235
take guard to render bundles at the top of `resolve_render_command_ids`
teoxoy Jul 2, 2024
5b2e78d
cleanup adapter usages within the `Device`
teoxoy Jul 2, 2024
eb0eb34
unregister adapters like all other resources
teoxoy Jul 2, 2024
ef7d272
use a `read` guard instead of `write`
teoxoy Jul 2, 2024
a9c74f4
use `Surface.get_capabilities` in all relevant places
teoxoy Jul 2, 2024
e26d2d7
move command buffer resolving in `Global`'s methods
teoxoy Jul 3, 2024
3a68147
Allow unconsumed inputs in fragment shaders (#5531)
Imberflur Jul 4, 2024
37f2836
[example hello] Produce output when run in the usual way.
jimblandy Jul 3, 2024
7910fd8
[wgpu-hal] require a `Surface` to be passed to `Instance.enumerate_ad…
teoxoy Jul 3, 2024
9f34acd
[wgpu-hal] return `None` in `Adapter.surface_capabilities()` if the `…
teoxoy Jul 3, 2024
7600c61
refactor: `vertex_index_common`: use `strum` `enum` iter.
ErichDonGubler Jun 18, 2024
764b15a
refactor: `vertex_index_common`: elide `tests` alloc. w/ `Itertools::…
ErichDonGubler Jun 18, 2024
5c29ad5
refactor: `vertex_index_common`: use `size_of_val` instead of magic n…
ErichDonGubler Jun 18, 2024
f02ec0e
test: fix `wgpu-test` building by itself (#5912)
ErichDonGubler Jul 5, 2024
4816a2d
refactor!: suppress `dead_code` in `wgpu::util::DownloadBuffer` (#5917)
ErichDonGubler Jul 5, 2024
d41b9ab
refactor: use built-in `{integer}::power_of_two` methods (#5909)
ErichDonGubler Jul 5, 2024
00a32ca
refactor: satisfy `missing_docs,clippy::empty_docs`
ErichDonGubler Jul 5, 2024
25bc704
chore: satisfy `clippy::manual_unwrap_or_default`
ErichDonGubler Jul 4, 2024
3eb8835
merge & fix
Vecvec Jul 7, 2024
b524bb2
remove some uses of blas ids
Vecvec Jul 8, 2024
f02507d
fmt
Vecvec Jul 8, 2024
bc8c572
build(deps): bump JamesIves/github-pages-deploy-action from 4.6.1 to …
dependabot[bot] Jul 8, 2024
2cffa1d
chore(clippy): satisfy `unused_qualifications`
ErichDonGubler Jul 3, 2024
4c6318c
Expose gpu allocation configuration options (#5875)
nical Jul 8, 2024
89c3baf
Add cfg_alias indirection to Naga's x_out features
Wumpf Jul 6, 2024
e1913b1
Introduce `msl-out-if-target-apple` feature to Naga
Wumpf Jul 6, 2024
7c51bb4
Introduce `hlsl-out-if-target-windows` feature to Naga
Wumpf Jul 6, 2024
bd2b284
remove unused `TempResource::Texture`
teoxoy Jul 4, 2024
5266bd1
change `prepare_staging_buffer` to return a non null u8 pointer
teoxoy Jul 4, 2024
fabbca2
use `StagingBuffer` instead of `Buffer` for `mapped_at_creation` Buffers
teoxoy Jul 4, 2024
ab88dce
remove unused `TempResource::Buffer`
teoxoy Jul 4, 2024
ef909d0
remove `Device.create_buffer_impl`
teoxoy Jul 4, 2024
7223bfa
remove `Arc`s around `TempResource` variants
teoxoy Jul 4, 2024
c6761bd
add `ActiveSubmission.temp_resources` that contains all temporary res…
teoxoy Jul 4, 2024
1404950
remove `device_maintain_ids`
teoxoy Jul 4, 2024
439e28b
move trackers into `EncoderInFlight` on submit
teoxoy Jul 4, 2024
61739d9
remove `PendingWrites.executing_command_buffers`
teoxoy Jul 4, 2024
3cc6c27
remove `LifetimeTracker.future_suspected_{buffers,textures}`
teoxoy Jul 4, 2024
3fba403
don't check if the buffer is still "present" from the user's perspect…
teoxoy Jul 4, 2024
3142e15
remove the triage suspected machinery
teoxoy Jul 4, 2024
0e1c1f7
replace the tracker in `Device` with a new `DeviceTracker`
teoxoy Jul 4, 2024
a270577
make resource metadata generic over a `T: Clone`
teoxoy Jul 4, 2024
152a7e7
remove unnecessary `PhantomData`
teoxoy Jul 4, 2024
ac88c73
remove unused `BufferTracker.get()`
teoxoy Jul 4, 2024
f5a4489
don't call `drain_transitions()` of we drop the results
teoxoy Jul 4, 2024
aa9cb71
introduce `DeviceBufferTracker` which holds weak references to buffers
teoxoy Jul 4, 2024
4255268
introduce `DeviceTextureTracker` which holds weak references to textures
teoxoy Jul 4, 2024
4afba3b
Merge remote-tracking branch 'refs/remotes/gfx-rs/trunk' into ray-tra…
Vecvec Jul 9, 2024
7cb078b
fix merge
Vecvec Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 12 additions & 2 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
[profile.default]
slow-timeout = { period = "45s", terminate-after = 2 }

# Use two threads for tests with "2_threads" in their name
# Use two threads for tests with "2 threads" in their name
[[profile.default.overrides]]
filter = 'test(~2_threads)'
filter = 'test(~2_threads) | test(~2 threads)'
threads-required = 2

# Use four threads for tests with "4 threads" in their name
[[profile.default.overrides]]
filter = 'test(~4_threads) | test(~4 threads)'
threads-required = 4

# Use eight threads for tests with "8 threads" in their name
[[profile.default.overrides]]
filter = 'test(~8_threads) | test(~8 threads)'
threads-required = 8
2 changes: 2 additions & 0 deletions .deny.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[bans]
multiple-versions = "deny"
skip-tree = [
# We never enable loom in any of our dependencies but it causes dupes
{ name = "loom", version = "0.7.2" },
{ name = "windows-sys", version = "0.45" },
{ name = "winit", version = "0.27" },
{ name = "winit", version = "0.29" },
Expand Down
41 changes: 23 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ jobs:
cargo -V

# Use special toolchain for rustdoc, see https://github.com/gfx-rs/wgpu/issues/4905
- name: Install Rustdoc Toolchain
run: |
rustup toolchain install ${{ env.DOCS_RUST_VERSION }} --no-self-update --profile=minimal --component rust-docs --target ${{ matrix.target }}
cargo +${{ env.DOCS_RUST_VERSION }} -V
# - name: Install Rustdoc Toolchain
# run: |
# rustup toolchain install ${{ env.DOCS_RUST_VERSION }} --no-self-update --profile=minimal --component rust-docs --target ${{ matrix.target }}
# cargo +${{ env.DOCS_RUST_VERSION }} -V

- name: disable debug
shell: bash
Expand Down Expand Up @@ -195,11 +195,11 @@ jobs:
# build for WebGPU
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv,fragile-send-sync-non-atomic-wasm
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv
cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --no-deps --features glsl,spirv
# cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --no-deps --features glsl,spirv

# all features
cargo clippy --target ${{ matrix.target }} --tests --all-features
cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --no-deps --all-features
# cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --no-deps --all-features

- name: check em
if: matrix.kind == 'em'
Expand All @@ -226,18 +226,22 @@ jobs:
cargo clippy --target ${{ matrix.target }} --no-default-features

# Check with all features.
cargo clippy --target ${{ matrix.target }} --tests --all-features
cargo clippy --target ${{ matrix.target }} --tests --benches --all-features

# build docs
cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --all-features --no-deps
- name: check private item docs
if: matrix.kind == 'native'
shell: bash
run: |
set -e

# wgpu_core package
cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --all-features --no-deps --package wgpu-core --package wgpu-hal --document-private-items
# cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} --all-features --no-deps
# - name: check private item docs
# if: matrix.kind == 'native'
# shell: bash
# run: |
# set -e

# # wgpu_core package
# cargo +${{ env.DOCS_RUST_VERSION }} doc --target ${{ matrix.target }} \
# --package wgpu-core \
# --package wgpu-hal \
# --package naga \
# --all-features --no-deps --document-private-items

# We run minimal checks on the MSRV of the core crates, ensuring that
# its dependency tree does not cause issues for firefox.
Expand Down Expand Up @@ -539,7 +543,8 @@ jobs:
cargo xtask test --llvm-cov

- name: check naga snapshots
run: git diff --exit-code -- naga/tests/out
# git diff doesn't check untracked files, we need to stage those then compare with HEAD.
run: git add . && git diff --exit-code HEAD naga/tests/out

- uses: actions/upload-artifact@v4
if: always() # We want artifacts even if the tests fail.
Expand Down Expand Up @@ -623,7 +628,7 @@ jobs:
cargo fmt --manifest-path xtask/Cargo.toml -- --check

- name: Check for typos
uses: crate-ci/typos@v1.20.10
uses: crate-ci/typos@v1.22.9

check-cts-runner:
# runtime is normally 2 minutes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if: ${{ failure() }}

- name: Deploy the docs
uses: JamesIves/[email protected].0
uses: JamesIves/[email protected].3
if: github.ref == 'refs/heads/trunk'
with:
token: ${{ secrets.WEB_DEPLOY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: cargo xtask run-wasm --no-serve

- name: Deploy WebGPU examples
uses: JamesIves/[email protected].0
uses: JamesIves/[email protected].3
if: github.ref == 'refs/heads/trunk'
with:
token: ${{ secrets.WEB_DEPLOY }}
Expand Down
158 changes: 158 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,39 @@ Bottom level categories:

### Major Changes

#### Lifetime bounds on `wgpu::RenderPass` & `wgpu::ComputePass`

`wgpu::RenderPass` & `wgpu::ComputePass` recording methods (e.g. `wgpu::RenderPass:set_render_pipeline`) no longer impose a lifetime constraint to objects passed to a pass (like pipelines/buffers/bindgroups/query-sets etc.).

This means the following pattern works now as expected:
```rust
let mut pipelines: Vec<wgpu::RenderPipeline> = ...;
// ...
let mut cpass = encoder.begin_compute_pass(&wgpu::ComputePassDescriptor::default());
cpass.set_pipeline(&pipelines[123]);
// Change pipeline container - this requires mutable access to `pipelines` while one of the pipelines is in use.
pipelines.push(/* ... */);
// Continue pass recording.
cpass.set_bindgroup(...);
```
Previously, a set pipeline (or other resource) had to outlive pass recording which often affected wider systems,
meaning that users needed to prove to the borrow checker that `Vec<wgpu::RenderPipeline>` (or similar constructs)
aren't accessed mutably for the duration of pass recording.


Furthermore, you can now opt out of `wgpu::RenderPass`/`wgpu::ComputePass`'s lifetime dependency on its parent `wgpu::CommandEncoder` using `wgpu::RenderPass::forget_lifetime`/`wgpu::ComputePass::forget_lifetime`:
```rust
fn independent_cpass<'enc>(encoder: &'enc mut wgpu::CommandEncoder) -> wgpu::ComputePass<'static> {
let cpass: wgpu::ComputePass<'enc> = encoder.begin_compute_pass(&wgpu::ComputePassDescriptor::default());
cpass.forget_lifetime()
}
```
⚠️ As long as a `wgpu::RenderPass`/`wgpu::ComputePass` is pending for a given `wgpu::CommandEncoder`, creation of a compute or render pass is an error and invalidates the `wgpu::CommandEncoder`.
`forget_lifetime` can be very useful for library authors, but opens up an easy way for incorrect use, so use with care.
This method doesn't add any additional overhead and has no side effects on pass recording.

By @wumpf in [#5569](https://github.com/gfx-rs/wgpu/pull/5569), [#5575](https://github.com/gfx-rs/wgpu/pull/5575), [#5620](https://github.com/gfx-rs/wgpu/pull/5620), [#5768](https://github.com/gfx-rs/wgpu/pull/5768) (together with @kpreid), [#5671](https://github.com/gfx-rs/wgpu/pull/5671), [#5794](https://github.com/gfx-rs/wgpu/pull/5794), [#5884](https://github.com/gfx-rs/wgpu/pull/5884).

#### Querying shader compilation errors

Wgpu now supports querying [shader compilation info](https://www.w3.org/TR/webgpu/#dom-gpushadermodule-getcompilationinfo).
Expand All @@ -62,16 +95,139 @@ for message in compilation_info

By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410)

#### 64 bit integer atomic support in shaders.

Add support for 64 bit integer atomic operations in shaders.

Add the following flags to `wgpu_types::Features`:

- `SHADER_INT64_ATOMIC_ALL_OPS` enables all atomic operations on `atomic<i64>` and
`atomic<u64>` values.

- `SHADER_INT64_ATOMIC_MIN_MAX` is a subset of the above, enabling only
`AtomicFunction::Min` and `AtomicFunction::Max` operations on `atomic<i64>` and
`atomic<u64>` values in the `Storage` address space. These are the only 64-bit
atomic operations available on Metal as of 3.1.

Add corresponding flags to `naga::valid::Capabilities`. These are supported by the
WGSL front end, and all Naga backends.

Platform support:

- On Direct3d 12, in `D3D12_FEATURE_DATA_D3D12_OPTIONS9`, if
`AtomicInt64OnTypedResourceSupported` and `AtomicInt64OnGroupSharedSupported` are
both available, then both wgpu features described above are available.

- On Metal, `SHADER_INT64_ATOMIC_MIN_MAX` is available on Apple9 hardware, and on
hardware that advertises both Apple8 and Mac2 support. This also requires Metal
Shading Language 2.4 or later. Metal does not yet support the more general
`SHADER_INT64_ATOMIC_ALL_OPS`.

- On Vulkan, if the `VK_KHR_shader_atomic_int64` extension is available with both the
`shader_buffer_int64_atomics` and `shader_shared_int64_atomics` features, then both
wgpu features described above are available.

By @atlv24 in [#5383](https://github.com/gfx-rs/wgpu/pull/5383)

#### A compatible surface is now required for `request_adapter()` on WebGL2 + `enumerate_adapters()` is now native only.

When targeting WebGL2, it has always been the case that a surface had to be created before calling `request_adapter()`.
We now make this requirement explicit.

Validation was also added to prevent configuring the surface with a device that doesn't share the same underlying
WebGL2 context since this has never worked.

Calling `enumerate_adapters()` when targeting WebGPU used to return an empty `Vec` and since we now require users
to pass a compatible surface when targeting WebGL2, having `enumerate_adapters()` doesn't make sense.

By @teoxoy in [#5901](https://github.com/gfx-rs/wgpu/pull/5901)

### New features
#### Vulkan

- Added a `PipelineCache` resource to allow using Vulkan pipeline caches. By @DJMcNab in [#5319](https://github.com/gfx-rs/wgpu/pull/5319)

#### General

- Added `as_hal` for `Buffer` to access wgpu created buffers form wgpu-hal. By @JasondeWolff in [#5724](https://github.com/gfx-rs/wgpu/pull/5724)
- Unconsumed vertex outputs are now always allowed. Removed `StageError::InputNotConsumed`, `Features::SHADER_UNUSED_VERTEX_OUTPUT`, and associated validation. By @Imberflur in [#5531](https://github.com/gfx-rs/wgpu/pull/5531)
- Added memory allocation hints to `DeviceDescriptor` by @nical in [#5875](https://github.com/gfx-rs/wgpu/pull/5875)
- `MemoryHints::Performance`, the default, favors performance over memory usage and will likely cause large amounts of VRAM to be allocated up-front. This hint is typically good for games.
- `MemoryHints::MemoryUsage` favors memory usage over performance. This hint is typically useful for smaller applications or UI libraries.
- `MemoryHints::Manual` allows the user to specify parameters for the underlying GPU memory allocator. These parameters are subject to change.
- These hints may be ignored by some backends. Currently only the Vulkan and D3D12 backends take them into account.

#### Naga

- Added -D, --defines option to naga CLI to define preprocessor macros by @theomonnom in [#5859](https://github.com/gfx-rs/wgpu/pull/5859)
- Added type upgrades to SPIR-V atomic support. Added related infrastructure. Tracking issue is [here](https://github.com/gfx-rs/wgpu/issues/4489). By @schell in [#5775](https://github.com/gfx-rs/wgpu/pull/5775).
- Implement `WGSL`'s `unpack4xI8`,`unpack4xU8`,`pack4xI8` and `pack4xU8`. By @VlaDexa in [#5424](https://github.com/gfx-rs/wgpu/pull/5424)
- Began work adding support for atomics to the SPIR-V frontend. Tracking issue is [here](https://github.com/gfx-rs/wgpu/issues/4489). By @schell in [#5702](https://github.com/gfx-rs/wgpu/pull/5702).
- In hlsl-out, allow passing information about the fragment entry point to omit vertex outputs that are not in the fragment inputs. By @Imberflur in [#5531](https://github.com/gfx-rs/wgpu/pull/5531)

```diff
let writer: naga::back::hlsl::Writer = /* ... */;
-writer.write(&module, &module_info);
+writer.write(&module, &module_info, None);
```

#### WebGPU

- `include_wgsl!` is now callable in const contexts by @9SMTM6 in [#5872](https://github.com/gfx-rs/wgpu/pull/5872)

### Changes

#### General

- Avoid introducing spurious features for optional dependencies. By @bjorn3 in [#5691](https://github.com/gfx-rs/wgpu/pull/5691)
- `wgpu::Error` is now `Sync`, making it possible to be wrapped in `anyhow::Error` or `eyre::Report`. By @nolanderc in [#5820](https://github.com/gfx-rs/wgpu/pull/5820)

#### Metal
- Removed the `link` Cargo feature.

This was used to allow weakly linking frameworks. This can be achieved with putting something like the following in your `.cargo/config.toml` instead:
```toml
[target.'cfg(target_vendor = "apple")']
rustflags = ["-C", "link-args=-weak_framework Metal -weak_framework QuartzCore -weak_framework CoreGraphics"]
```

### Bug Fixes

#### General

- Ensure render pipelines have at least 1 target. By @ErichDonGubler in [#5715](https://github.com/gfx-rs/wgpu/pull/5715)
- `wgpu::ComputePass` now internally takes ownership of `QuerySet` for both `wgpu::ComputePassTimestampWrites` as well as timestamp writes and statistics query, fixing crashes when destroying `QuerySet` before ending the pass. By @wumpf in [#5671](https://github.com/gfx-rs/wgpu/pull/5671)
- Validate resources passed during compute pass recording for mismatching device. By @wumpf in [#5779](https://github.com/gfx-rs/wgpu/pull/5779)
- Fix a `CommandBuffer` leak. By @cwfitzgerald and @nical in [#5141](https://github.com/gfx-rs/wgpu/pull/5141)

#### DX12

- Do not feed `&""` to `D3DCompile`, by @workingjubilee in [#5812](https://github.com/gfx-rs/wgpu/issues/5812).

#### Metal

- Fix unrecognized selector crash on iOS 12. By @vladasz in [#5744](https://github.com/gfx-rs/wgpu/pull/5744).

#### Vulkan

- Fix enablement of subgroup ops extension on Vulkan devices that don't support Vulkan 1.3. By @cwfitzgerald in [#5624](https://github.com/gfx-rs/wgpu/pull/5624).

#### GLES / OpenGL

- Fix regression on OpenGL (EGL) where non-sRGB still used sRGB [#5642](https://github.com/gfx-rs/wgpu/pull/5642)
- Fix `ClearColorF`, `ClearColorU` and `ClearColorI` commands being issued before `SetDrawColorBuffers` [#5666](https://github.com/gfx-rs/wgpu/pull/5666)
- Replace `glClear` with `glClearBufferF` because `glDrawBuffers` requires that the ith buffer must be `COLOR_ATTACHMENTi` or `NONE` [#5666](https://github.com/gfx-rs/wgpu/pull/5666)
- Return the unmodified version in driver_info. By @Valaphee in [#5753](https://github.com/gfx-rs/wgpu/pull/5753)

#### WebGPU

- Added support for pipeline-overridable constants to the WebGPU backend by @DouglasDwyer in [#5688](https://github.com/gfx-rs/wgpu/pull/5688)

#### Naga

- In spv-out don't decorate a `BindingArray`'s type with `Block` if the type is a struct with a runtime array by @Vecvec in [#5776](https://github.com/gfx-rs/wgpu/pull/5776)
- Add `packed` as a keyword for GLSL by @kjarosh in [#5855](https://github.com/gfx-rs/wgpu/pull/5855)

## v0.20.0 (2024-04-28)

### Major Changes
Expand Down Expand Up @@ -223,6 +379,7 @@ By @atlv24 and @cwfitzgerald in [#5154](https://github.com/gfx-rs/wgpu/pull/5154
- Fix deadlocks caused by recursive read-write lock acquisitions [#5426](https://github.com/gfx-rs/wgpu/pull/5426).
- Remove exposed C symbols (`extern "C"` + [no_mangle]) from RenderPass & ComputePass recording. By @wumpf in [#5409](https://github.com/gfx-rs/wgpu/pull/5409).
- Fix surfaces being only compatible with first backend enabled on an instance, causing failures when manually specifying an adapter. By @Wumpf in [#5535](https://github.com/gfx-rs/wgpu/pull/5535).
- Clean up weak references to texture views and bind groups. By @xiaopengli89 [#5595](https://github.com/gfx-rs/wgpu/pull/5595).

#### Naga

Expand All @@ -246,6 +403,7 @@ By @atlv24 and @cwfitzgerald in [#5154](https://github.com/gfx-rs/wgpu/pull/5154
- Set object labels when the DEBUG flag is set, even if the VALIDATION flag is disabled. By @DJMcNab in [#5345](https://github.com/gfx-rs/wgpu/pull/5345).
- Add safety check to `wgpu_hal::vulkan::CommandEncoder` to make sure `discard_encoding` is not called in the closed state. By @villuna in [#5557](https://github.com/gfx-rs/wgpu/pull/5557)
- Fix SPIR-V type capability requests to not depend on `LocalType` caching. By @atlv24 in [#5590](https://github.com/gfx-rs/wgpu/pull/5590)
- Upgrade `ash` to `0.38`. By @MarijnS95 in [#5504](https://github.com/gfx-rs/wgpu/pull/5504).

#### Tests

Expand Down
Loading
Loading