Commit Graph
392 Commits
Author SHA1 Message Date
Kristoffer Søholm 41bb9cbd25 Fix validation for bindings with different sizes (#9341) 2026-04-02 18:01:28 -07:00
e46eda2e4f Full per_vertex implementation (#9219)
* Some stuff worked on

* Works on MSL

* Ready for test 2

* Fix for a thing lol

* Fixed 2 errors

* Fixed DXC

* Add changelog

* Updated CI to hopefully pass on macOS

* Various fixes

* Some final fixes

* CHanged CI

* Update naga/src/front/wgsl/parse/directive/enable_extension.rs

Co-authored-by: atlv <email@atlasdostal.com>

* Thing

---------

Co-authored-by: atlv <email@atlasdostal.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-04-02 05:33:42 +00:00
Dylan Blokhuis 438ed2a7ce feat(core): support building custom geometry BLAS (#9290) 2026-04-01 20:55:22 +13:00
Kristoffer Søholm fd04edc0ac Fix bad debug_assert in dx12 indirect multi draw (#9332) 2026-03-31 13:46:25 -04:00
Andy Leiserson e14050d7db fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING (#9346)
* fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING

Fixes #9343

* Update test and waive failure

Related to #5231

* changelog
2026-03-31 17:02:11 +02:00
Inner Daemons a53ffffe38 Mesh shader HLSL writer (#8752) 2026-03-24 15:42:38 -04:00
Kevin Reid 1148bac37c Convert comments on lint attributes to reasons. (#9292) 2026-03-24 18:58:52 +00:00
Andy Leiserson 0226d561c0 test: Limit bucketing tests 2026-03-23 18:25:15 -07:00
Andy LeisersonandTeodor Tanasoaia 55b45559a7 feat(core): Limit bucketing
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2026-03-23 18:25:15 -07:00
Andy Leiserson f9b4cbf365 refactor(tests): Add NoopBackendOptions::enabled() constructor 2026-03-23 18:25:15 -07:00
Andy Leiserson d5c0b137e0 test: Annotate one more KosmicKrisp failure (#9256)
Tracked in #9187
2026-03-18 11:13:25 -06:00
Connor Fitzgerald f59124f3f6 Add support for the D3D12 Agility SDK (#9130) 2026-03-16 20:43:32 -04:00
Andy Leiserson e80dc8decf Annotate expected failures on Metal, MoltenVK, and KosmicKrisp (#9188) 2026-03-14 22:41:20 -04:00
Vecvec 50a4eaa75c [vulkan] Offset AccelerationStructureGeometryTrianglesDataKHR::vertex_data instead of using first_vertex (#9220) 2026-03-14 22:30:09 -04:00
Andy Leiserson ca3239e689 chore!: Move PRIMITIVE_INDEX feature into the WebGPU group (#9101)
Enable relevant CTS tests.
2026-03-13 13:52:14 -07:00
teoxoy 51fb8017d4 add test for max binding index 2026-03-13 16:24:43 +01:00
Kevin Reid a97a49d1d6 Replace &mut [u8] access to mapped buffers with WriteOnly.
When accessing a buffer for writing, do not expose (or internally
create) any `&'a mut [u8]` references to that memory, so as to avoid
exposing write-combining memory that might visibly misbehave in atomic
operations. Instead, expose the new pointer type `WriteOnly<'a, [u8]>`
which offers only write operations. This can be sliced and reborrowed,
allowing it to be used in most ways which `&mut [u8]` would be,
hopefully with near-zero overhead.

This pointer type might also allow users to opt in to uninitialized
memory for performance, while confining the consequences to GPU UB
rather than Rust UB. However, that is a future possibility and is not
implemented in this commit other than as a consideration in defining the
API of the `WriteOnly` type.

This change is not a complete solution to the problem of write-combining
memory because it is still possible to read after writing by calling
`get_mapped_range()` after `get_mapped_range_mut()`. However, that is
solvable separately, perhaps with a barrier or a validation change,
and is not particularly coupled with this part of the solution.
2026-03-11 16:58:48 -04:00
Dzmitry Malyshau da77a43313 Update naga capabilities for TLAS array 2026-03-11 08:18:38 -07:00
Dzmitry Malyshau adc3534f1c Add max_binding_array_acceleration_structure_elements_per_shader_stage limit 2026-03-11 08:18:38 -07:00
Dzmitry Malyshau e39b3aec8e Plumbing and a test for ACCELERATION_STRUCTURE_BINDING_ARRAY 2026-03-11 08:18:38 -07:00
Marijn Suijten 35db26b2c6 Make HasDisplayHandle optional in WindowHandle (#8782) 2026-03-10 11:36:12 -04:00
Genna Wingert ce7dad3026 fix: Change type of max_*_buffer_binding_size to follow spec 2026-03-09 16:49:06 -06:00
Mikołaj Radkowski 665cb34e32 Fix multi-planar texture copying (#9069) 2026-03-01 12:14:03 +01:00
Teodor Tanasoaia e114d2f0a7 Add support for gaps in bind group layouts & update relevant validation (#9034)
* [wgpu-core] add support for optional BG & BGL entries

* [wgpu] allow gaps in bind group layouts

And allow unbinding in the web backend.

* adapt tests

* add changelog entry

* [wgpu] remove generic from `PipelineLayoutDescriptor`
2026-02-25 19:47:36 +01:00
Andy Leiserson b09a919c6a DepthStencilState validation fixes (#8840)
* Make `depth_compare` and `depth_write_enabled` optional

These fields are optional in the WebGPU API. Having them optional in the
wgpu API as well keeps validation logic centralized in wgpu-core.

Fixes #8830

* Remove `DepthStencilStateIdl`
2026-02-25 14:59:48 +01:00
Inner Daemons fdd903e6e4 Add supported caps info to naga backends (#9068)
* Initial commit

* 3/5 done I think

* Updated naga bin to use new caps

* Made clippy shut up

* Tried to fix dota2 validation error

* HLSL list made, also formatted Cargo.toml

* Made stuff work with snapshots

* Added changelog and GLSL list

* Updated message
2026-02-23 06:44:20 -07: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
Inner Daemons dc29f72675 Fix metallib tests (#9049)
* Single commit fix

* Moved up the guards
2026-02-13 21:05:36 -05:00
Inner Daemons 6bca1014b2 Various SPIR-V fixes for mesh shaders (#8756)
* Initial commit adding miscellaneous changes from msl-write and hlsl-write

* Same as previous commit

* Fixed divergence issue

* Removed some unnecessary barriers

* Zero init workgroup memory

* Added limits validation

* Added changelog

* Handled overflow, removed todo

* Lets see if this fixes llvmpipe

* Also this commit fixes llvmpipe maybe

* Unfortunate but not too unexpected at this point

* Updated feature to say to use ShaderRuntimeChecks::unchecked()

* Updated snapshots and took some changes from the hlsl writer

* Snapshots

* 2 quick tweaks

* Updated framework with suggestions by Connor in #8752

* Moved the task runtime limits into naga::back

* Fixed soem stuff

* Fixed checks: >= into >

* Cant believe I forgot this

* Removed code using u64 to check stuff

* Removed thing with limiting it to 2<<21

* Some more work

* Fixed compiles

* Added new field to spv options

* Updated some stuff to pass around the task runtime limits in more ways

* New PR started

* Did another quick fix

* Another quick fix

* Added changelog entry

* Added some explanation docs

* Fixed a warning

* Fixed shader

* Fixed some things & added docs

* Reverted dxc thing

* Fixed thing

* Refactored to TaskDispatchLimits

* Fixed compile error
2026-02-12 14:47:42 -05: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
Inner Daemons fab57513ec Add metallib passthrough (#8886) 2026-01-30 13:52:05 -05: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 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
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
Vecvec c97fe3e7c4 [HLSL] Make ray queries safer. (#8763) 2026-01-15 21:35:18 -05:00
switch b0a043a7a0 staging belt: allow creation with custom buffer usages (#8580) 2026-01-15 20:23:02 -05:00
atlvandConnor 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
Andy Leiserson 3bd29ef6eb Tracing tests 2026-01-09 15:55:33 +01:00
Jamie Nicol 3597514381 [naga spv-out] Handle 2-row matrices in uniform buffers
Two-row matrices in uniform buffers in Vulkan/SPIR-V's default
"extended" (std140) layout do not adhere to WGSL/Naga IR's layout
rules - each column is aligned to a minimum of 16 bytes rather than
just the vector size.

To work around this, we emit additional std140 compatible type
declarations for each type used in a uniform buffer that requires
one. Any two-row matrix struct member is decomposed into the
containing struct as separate vectors for each column. Two-row
matrices used directly as uniform buffers are wrapped in a struct with
a vector member for each column, and arrays (of arrays, etc) of
two-row matrices are declared as arrays (of arrays) of structs
containing a vector member for each column.

When loading such a value from a uniform buffer, we convert from the
std140 compatible type to the regular type immediately after loading.
Accesses of a uniform two-row matrix's columns using constant indices
are rewritten to access the containing struct's vector members
directly. Accesses using dynamic indices are implemented by loading
and converting the matrix, extracting each column then `switch`ing on
the index to select the correct column.

We can now remove the expected failure annotation for the Vulkan
backend on the uniform_input struct_layout test, as it now passes.
2026-01-06 11:28:24 +00:00
Jamie Nicol c1802e5bc1 [test] Add additional matrix struct_layout tests
Extend existing tests to use dynamic indexing of matrices' columns as
well static indexing. Add new tests for arrays of matrices.
2026-01-06 11:28:24 +00:00
Marijn Suijten 234ec66152 Allow optional RawDisplayHandle in InstanceDescriptor (#8012) 2025-12-23 14:53:04 -05:00
703c7d274d Naga mesh shader SPIR-V writer (#8456)
Co-authored-by: Inner Daemons <magnus.larsson.mn@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-12-16 23:33:15 -05:00
Connor Fitzgerald e52e8336b0 Bring immediate api in line with spec (#8724) 2025-12-16 13:13:09 +01:00
Vecvec 7721a3e065 [spv-out] handle rayQueryTerminate correctly. (#8581) 2025-12-15 12:53:39 -05:00
Moritz Zielke 2a190372f7 fix(OpenGL): enable using VertexFormat::Unorm10_10_10_2 on gl (#8717) 2025-12-12 12:25:14 -05:00
Connor Fitzgerald c272cd163a Fix multiple_devices test on non-compute hardware 2025-12-08 12:26:45 +01:00
Connor Fitzgerald e3149bac9e LoadOp::DontCare (#8549) 2025-12-08 03:41:38 +00:00
Layl 21e6143ed0 Add MULTISAMPLE_ARRAY feature flag. (#8571) 2025-12-05 18:31:05 +01:00