Erich Gubler and Jim 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
cb10986178
chore(core): unmap_inner: add note explaining self.size usage in tracing
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
Inner Daemons
8f50bb9d98
Make passthrough shaders non-experimental ( #9054 )
...
* Refactored passthrough shaders
* Added a changelog entry
2026-02-18 12:29:50 -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
55a906767a
refactor: satisfy clippy::manual_is_multiple_of for transfer alignment checks ( #9072 )
2026-02-17 23:34:25 -05:00
Andy Leiserson
e59fb7d423
fix(core): Calculate total number of bindings correctly ( #8997 )
2026-02-12 14:29:56 +01:00
Inner Daemons
7609ed99e5
Add draw_id builtin ( #8883 )
2026-02-11 20:47:29 +00:00
Inner Daemons
702c4ef4da
[wgsl] gate primitive_index built-in behind its extension & [glsl-out] require extensions for gl_PrimitiveID if needed ( #8879 )
2026-02-10 12:40:41 +01:00
Connor Fitzgerald
04746e747e
Implement 3 part MSRV policy ( #8999 )
2026-02-08 17:04:36 -05:00
Luo Zhihao
c0f04c801c
Validate strip_index_format equals index buffer format for indexed drawing with strip topology
2026-02-01 23:14:52 -08:00
Andy Leiserson
2c9e77a19d
clippy: Adjust large-error-threshold and remove waivers ( #8974 )
2026-01-30 22:37:24 -05:00
Inner Daemons
fab57513ec
Add metallib passthrough ( #8886 )
2026-01-30 13:52:05 -05:00
Andy Leiserson
1af73121f4
fix(core): Read-write bindings are compatible with write-only shaders ( #8951 )
...
Fixes #8905
2026-01-30 09:44:22 -08:00
Andy Leiserson
735e8d2a40
Fix validation related to depth bias and frag_depth
...
* Depth bias is only supported with triangle topologies (fixes #6071 )
* If the shader outputs `frag_depth`, the pipeline must have a depth
attachment
2026-01-30 09:36:29 -08:00
Andy Leiserson
b316204dff
Allow shaders w/ dual-source blend I/O in non-DSB pipelines
...
Fixes #8592
2026-01-30 09:36:29 -08:00
Andy Leiserson
3bacd7bee5
refactor(core): Tweak dual-source blending validation
2026-01-30 09:36:29 -08:00
Andy Leiserson
c6bf076d78
fix(naga): Reject unsupported enable extensions ( #8913 )
...
Previously we required that the enable extension be declared and that
the capability be present if the functionality was used, but allowed the
extension to be declared if the functionality was not used.
2026-01-30 10:08:04 -05:00
Vecvec
8a37e0f56a
[wgsl in and IR] naga ray tracing pipelines ( #8570 )
2026-01-29 14:18:56 -05:00
Inner Daemons
c82e37b683
Validate pipelines with passthrough shaders but no explicit layout passed ( #8881 )
2026-01-28 20:14:33 -05:00
Vecvec
f3b5243db7
Refactor build_acceleration_structures to require fewer passes ( #8904 )
2026-01-28 16:14:28 -05: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
Inner Daemons and Erich Gubler
4d11f5f8de
Made traces use .metal extension instead of .msl ( #8880 )
...
* Changed msl snapshots to use .metal extension
* Made traces use `.metal` extension instead of `.msl`
* Added changelog entry
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com >
2026-01-26 17:25:43 +00:00
pin and Erich Gubler
8ad8a820c6
Add basic NetBSD support ( #8695 )
...
* Add basic NetBSD support
- closes https://github.com/gfx-rs/wgpu/issues/8541
- replaces https://github.com/gfx-rs/wgpu/pull/8679
```
Tests:
Summary [ 149.522s] 469 tests run: 463 passed, 6 failed, 0 skipped
FAIL [ 0.095s] naga::naga snapshots::convert_snapshots_spv
FAIL [ 0.387s] wgpu-benchmark::bench/wgpu-benchmark Computepass Encoding
FAIL [ 0.386s] wgpu-benchmark::bench/wgpu-benchmark Device::create_bind_group
FAIL [ 0.378s] wgpu-benchmark::bench/wgpu-benchmark Device::create_buffer
FAIL [ 0.389s] wgpu-benchmark::bench/wgpu-benchmark Renderpass Encoding
FAIL [ 0.075s] wgpu-test::wgpu-validation api::instance::multi_instance::multi_instance
```
* Exclude Vulkan and DRM surface paths on NetBSD
Match platform support and avoiding cfg mismatches between wgpu and wgpu-core.
(with help from LLM)
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com >
2026-01-26 16:27:57 +00:00
Andy Leiserson
8636195cb7
Implement tracing for derived BGLs ( #8855 )
2026-01-19 10:41:22 +01:00
atlv and Connor Fitzgerald
4a3526a745
Add per-vertex attribute support to vulkan, spir-v and wgsl. ( #8821 )
...
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com >
2026-01-16 01:04:06 +00:00
atlv
fc9060f510
BarycentricNoPerspective ( #8852 )
2026-01-15 19:42:44 -05:00
Vecvec
bdc8f618c1
Use invalidate not flush when reading back from device. ( #8838 )
2026-01-15 15:25:46 -05:00
Luo Zhihao
2b8b5f7cdc
Fix typo in docs regarding memory init tracker ( #8858 )
2026-01-12 09:26:03 -05:00
Sam
11666170b4
expose adapter info on device ( #8807 )
...
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com >
2026-01-09 13:50:49 -07:00
Andy Leiserson
1481b23e55
Clean up imports/exports in wgpu_core::command ( #8836 )
2026-01-09 12:23:34 -08:00
Andy Leiserson
cd7958561a
Restore tracing support in wgpu
...
The loop/break changes in `play.rs` are reverting changes made in #4202 .
Fixes #5974
2026-01-09 15:55:33 +01:00
Andy Leiserson
d6b788829e
docs(core): Update ID-related doc comments
2026-01-09 15:55:33 +01:00
Andy Leiserson
3bd29ef6eb
Tracing tests
2026-01-09 15:55:33 +01: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
376a36a9d2
fix(core): Validate storage texture formats when creating BGLs ( #8735 )
...
This moves existing validation from binding creation to BGL
creation. Binding creation already had a check that returns
`CreateBindGroupError::InvalidStorageTextureFormat` if the format
does not match the layout, so it is not necessary to revalidate
the format support at that point.
2026-01-07 17:00:57 +01:00
Erich Gubler
727cbc3d13
refactor(core): debug_assert that we wrote at least one deduction for maxInterStageShaderVariables errors
2026-01-05 14:59:38 -08:00
Erich Gubler
6bf665ab26
fix(core): do not deduct Position built-in from maxInterStageShaderVariables
2026-01-05 14:59:38 -08:00
Erich Gubler
cd271a6be7
fix(core): compare fragment input indices against maxInterStageShaderVariables directly, not max_fragment_input_variables
2026-01-05 14:59:38 -08:00
Erich Gubler
a2c8c0de7c
docs(core): add (one among others) spec. citation for logic in Interface::check_stage
2025-12-23 16:09:17 -05:00
Erich Gubler
6948a01d8c
fix(core): remove max_inter_stage_shader_components validation
2025-12-23 16:09:17 -05:00
Erich Gubler
a26de1262c
fix(core): add fragment-stage max_inter_stage_shader_variables validation
2025-12-23 16:09:17 -05:00
Erich Gubler
bfb153222b
fix(core): add vertex-stage max_inter_stage_shader_variables validation (minus clip-distances)
...
Notable public API additions:
- New `StageError` variants:
- `VertexOutputLocationTooLarge`
- `TooManyVertexOutputs`
- Add new `shader_io_deductions` submodule of `wgpu_core::validation` with:
- A `ShaderIoDeduction` trait
- `enum MaxVertexShaderOutputDeduction`
- `MaxInterStageShaderVariablesDeductions` for them.
2025-12-23 16:09:17 -05:00
Erich Gubler
344eeb4bc8
refactor(core): migrate from naga::ShaderStage to new ShaderStageForValidation
...
In order to prepare for spec.-compliant validation of shader I/O, we
need to create a new `enum` that will have the same set of _variants_ as
`naga::ShaderStage`, but will carry additional information relevant to
validation. As a preparatory step, create the new `enum` (called
`ShaderStageForValidation`), and use it as the source of truth for
details of the stage being validated. This yields several immediate
benefits, even before making adjustments for the new validation:
- Stage-specific stage is now properly encapsulated. `compare_function`,
which was previously passed as a `Option`al sibling argument, is now
properly associated with only the vertex shader stage.
- This led to an odd discovery that `compare_function` was being
provided to `check_stages` with other stages, but not actually
actually checked. This seems like a rightfully squashed bug.
- Instead of passing a `wgpu_types::ShaderStages` (with a single bit)
and `naga::ShaderStage` side-by-side, encapsulate both into conversion
methods for an instance of `ShaderStageForValidation`, so errors are
impossible to make.
2025-12-23 16:09:17 -05:00
Erich Gubler
f71d51a356
refactor(core): reverse conv. b/w wgt::ShaderStages and naga::ShaderStage
...
This will better prepare for the subsequent commit, which supplants
`naga::ShaderStage` as the source of truth in this code.
2025-12-23 16:09:17 -05:00
Erich Gubler
05c1746ac6
refactor(core): make Interface::shader_stage_from_stage_bit a free function
2025-12-23 16:09:17 -05:00
Marijn Suijten
234ec66152
Allow optional RawDisplayHandle in InstanceDescriptor ( #8012 )
2025-12-23 14:53:04 -05:00
Andy Leiserson
df4ae64df6
Check GPUDepthStencilState.format even when neither is enabled ( #8766 )
...
Fixes #8736
2025-12-22 18:33:59 -08:00