Commit Graph
2830 Commits
Author SHA1 Message Date
Jim Blandy 4f4581fdff [core] Combine ShaderModuleState with ShaderMetaData.
In `wgpu_core::pipeline`, delete `ShaderMetaData` and turn
`ShaderModuleState` into the equivalent enum, giving both the
`NagaModule` and `Passthrough` variants their own `raw` field.

Arrange for uses of `ShaderModuleState` to extract the raw `wgpu_hal`
module in the `match` expression that handles the two variants.

In isolation, this change looks like mere rearrangement, not a
cleanup, but hopefully either way it's easy to see that it has no
effect on behavior. Subsequent commits will remove `raw` from the
`NagaModule` variant; this refactor will allow that to affect only the
`NagaModule` `match` arms, leaving the passthrough code unaffected.
2026-10-26 23:42:33 +00:00
Jim Blandy 00583c146b [core] Move ShaderMetaData, PassthroughInterface to pipeline.rs.
Move the definitions of `ShaderMetaData` and `PassthroughInterface`
from `wgpu_core::validation`, which does not use them, to
`wgpu_core::pipeline`, where they are used in `ShaderModuleState`, and
created.
2026-10-26 23:42:33 +00:00
Jim Blandy 48b67d4826 [core] Refactor ShaderMetaData use sites to use match.
Slightly reorder the sites that consume `ShaderMetaData` values, so
that the code for the `NagaModule` and `Passthrough` cases can be
gathered into `match` statements.
2026-10-26 23:42:33 +00:00
Jim Blandy 69863648a8 [core] Turn ShaderMetaData into a Naga-vs.-passthrough enum.
Rename the `ShaderMetaData::Interface` variant to `NagaModule`,
and make it a struct-like variant.

Delete `ShaderMetaData::interface`, and update its call sites to use a
`match` expression directly on the enum instead. This makes the use
sites clearer, by making it apparent which style of module we're
processing.
2026-10-26 23:42:33 +00:00
sagudev a8cfdef04e [core] Support passing MapMode as (potentially invalid) bitflags
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-26 18:49:57 +00:00
sagudev 9e80fc9d1d [core] Do device validity check at the start of try_map_async
this is important as we need to return Abort error instead of Operation error which is raised on invalid buffer

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-26 18:49:57 +00:00
sagudev 4e98175c04 [core] Destruct BufferMappingOperation into mode and callback arguments
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-26 18:49:57 +00:00
JMS55 2edafa5240 Record 1 barrier for N Queue::write_buffer/texture calls by deferring to submit time (#10319) 2026-10-25 11:57:55 +00:00
Andy Leiserson 63e505290e fix(core): Check that clear_texture targets all aspects (#10684) 2026-10-22 17:16:48 +00:00
Sam 4fb3ccaa77 [core] Do not forget to fire user callback in configure (#10686)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-22 06:42:02 +00:00
Inner DaemonsandAndy Leiserson 0f0262acdd Correctly zero init multiplanar textures (#9700)
Co-authored-by: Andy Leiserson <aleiserson@mozilla.com>
2026-10-22 00:11:46 +00:00
Jim Blandy ccd6966eed [core] Clean up Interface::finalize_entry_point_name. (#10556) 2026-10-21 10:03:11 +00:00
Jim Blandy 28a16856de [core] Include the shader stage in MissingEntryPoint errors. (#10544) 2026-10-21 09:23:00 +00:00
Jim Blandy 3050396df2 [core] Combine Create{Compute,Render}PipelineError. (#10569) 2026-10-20 19:51:32 +00:00
Andy Leiserson 0342e2fba5 fix(core): Check same-device for external texture planes (#10636) 2026-10-20 16:56:33 +00:00
Ian McFarlane efcf445784 Fix crash in lock validation due to TLS destructor call order (#10030) 2026-10-17 02:24:41 +00:00
Sam ee1904a1f8 [core] Read-only slice into WC memory is OK (#10634)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-17 00:59:57 +00:00
Abir Deol 14328f4991 Validate mesh draws in render bundles against the multiview mask (#10496) 2026-10-14 16:15:09 +00:00
Kevin Reid 60036cdc0a Fix Cargo lint from Rust 1.100 (#10576) 2026-10-14 00:35:08 +00:00
Andy Leiserson eb4678dd08 refactor(naga): Expose indices of ExternalTextureParams members 2026-10-13 19:34:06 +00:00
Kevin Reid 20a17523e2 Fix Clippy lint from Rust versions newer than 1.96 (#10575) 2026-10-13 17:06:07 +00:00
zerozebrazone e375d51d36 docs: fix typos in comments (#10582)
Signed-off-by: zerozebrazone <zerozebrazone@outlook.com>
2026-10-13 15:55:19 +00:00
Andy Leiserson eddf0b4c8f Fix a wasm cfg condition (#10577) 2026-10-13 03:10:04 +00:00
KOGA MitsuhiroandAndy Leiserson 889eea9505 fix(types): Exclude SURFACE_VIEW_FORMATS from compliant() (#10425)
Co-authored-by: Andy Leiserson <aleiserson@mozilla.com>
2026-10-13 01:54:39 +00:00
Sam 10ddb587ac [core] Add offset bounds check in BufferMapping::Read (#10579) 2026-10-11 17:18:03 +00:00
sagudev 80e59f179f less in wgpu
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-08 11:08:30 +00:00
sagudev 928b9d10ae better safety on BufferMapping
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-08 11:08:30 +00:00
sagudev 33f33e3d73 change map state on unmap even on destroyed device
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-08 11:08:30 +00:00
sagudev f4455f178d get_mapped_range return Mapping which holds the BufferState lock
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-10-08 11:08:30 +00:00
Connor Fitzgerald f0a620a195 typo fix (#10541) 2026-10-07 18:41:27 +00:00
Connor Fitzgerald 475507a24f typo fix (#10540) 2026-10-05 16:49:16 +00:00
superroket169 7b38991c62 test: move tests of the small crates into #[cfg(test)] modules (#10467) 2026-10-05 16:00:14 +00:00
Erich GublerandNazar Mokrynskyi cc706f714a refactor: wgpu{,-core}: remove recursion_limit attrs.
Now that we force the compiler to eagerly evaluate `Send + Sync` for
types that have had problems with `recursion_limit`s, we should be able
to use the compiler's defaults. Remove the attributes raising the
default.

Co-authored-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
2026-10-05 15:05:01 +00:00
Connor Fitzgerald 8d16ec493b fix(core): implement Send and Sync for Device manually
Every resource holds an `Arc<Device>`, so evaluating their auto traits
used to walk all of `Device`. This exceeded the default recursion limit
on nightly for `wgpu::CoreCommandEncoder`.
2026-10-05 15:05:01 +00:00
Stuart Parmenter 79348d63e6 Use separate Vulkan memory pool for TRANSIENT buffers (#10232) 2026-10-02 21:25:28 +00:00
Sam fcd059f423 Move MapMode into wgpu-types and use it instead of HostMap in wgpu-core (#10474)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-09-28 11:15:27 +00:00
sagudev 251badd212 TextureView::{as, from}_core
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-09-27 06:46:29 +00:00
Alex Andreba 67299ee4a6 Added an InstanceBuilder to wgpu_core (#10204) 2026-09-27 05:54:39 +00:00
Sam 6293e039ca [core] "consume" adapter on first succesful request_device if STRICT_WEBGPU_COMPLIANCE (#10444)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-09-24 13:34:16 +00:00
Patrik NilssonandConnor Fitzgerald 3ea8d8c6ef perf(core): Inline small bind group descriptor storage (#10188)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-09-24 05:54:36 +00:00
Sam 0ea906f074 Fix lock rank graph for SURFACE_PRESENTATION (#10426)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-09-23 16:39:13 +00:00
Jim Blandy 323acfb729 [core] Documentation tweaks for Varying, StageIo. 2026-09-22 08:51:48 +00:00
Jim Blandy dd5022ba2d [core] Add whitespace to CreateShaderModuleError for clarity. 2026-09-22 08:51:48 +00:00
Andy Leiserson c8dc1509b9 Enable wgpu_validate_locks in CI and local debug builds
Fixes #5937
2026-09-18 19:56:30 +00:00
Andy Leiserson b9f7ddad53 Fix lock issues affecting mark_externally_initialized test
- `RwLockReadGuard::forget` was not actually forgetting the
  `LockStateGuard`, resulting in a "double unlock" error when
  `SnatchableResourceGuard` later called `force_unlock_read`.
- Adjust both the test and the lock graph to avoid lock
  rank errors.
2026-09-18 19:56:30 +00:00
Andy Leiserson 468e87264a Lock graph updates 2026-09-18 19:56:30 +00:00
Andy Leiserson 8392a3bc53 Avoid overlapping locks in set_acceleration_structure_dependencies 2026-09-18 19:56:30 +00:00
Andy Leiserson dea6925ee1 Release BLAS_COMPACTION_STATE before acquiring QUEUE_LIFE_TRACKER 2026-09-18 19:56:30 +00:00
Connor Fitzgerald 35332d2114 Update agent tooling (#10202) 2026-09-18 15:06:10 +00:00
Jinlei Li 8630a774af fix(core): Implement render bundle debug commands (#10308) 2026-09-18 12:55:21 +00:00