893 Commits

Author SHA1 Message Date
Vecvec
03775c54fe
Prevent naga crashing on an aliased ray query. (#7759) 2025-06-16 08:45:39 +00:00
Dmitry Zamkov
bbb7cc79ef
Implement clip-distances extension for GL and Vulkan backends (#7730)
* Basic implementation of `clip_distances` for Vulkan and GL backends

* Added GPU test for `clip-distances`

* Update feature array size

* Add changelog entry

* Validate `clip_distances` array size

* Check for `clip_distances` enable directive

* Consolidate code for generating `enable` directives in WGSL backend and add `clip_distances`.
2025-06-16 10:33:31 +02:00
Erich Gubler
f96ac55aa4
fix(naga): don't panic on f16s in pipeline constants (#7801) 2025-06-13 10:41:19 -07:00
Andy Leiserson
82fa8e2a94 [naga] Remove non-essential override references via compaction
Adds a mode to compaction that removes unused functions, global
variables, and named types and overrides. This mode is used
everywhere except the compaction at the end of lowering, where
it is important to preserve unused items for type checking and
other validation of the module.

Pruning all but the active entry point and then compacting makes
`process_overrides` tolerant of missing values for overrides that are
not used by the active entry point.

Fixes #5885
2025-06-12 14:22:18 +09:00
Vecvec
aa427de4ea
Remove unsafe acceleration structure build (#7513) 2025-06-12 00:43:03 -04:00
atlv
645354a528
Make naga span methods take path as generic AsRef Path (#7643)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-12 01:55:25 +00:00
Vecvec
73eb83ded1
[wgpu] Blas compaction (#7285)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-11 21:40:10 -04:00
Vecvec
efbac5dfba
Add extra acceleration structure vertex formats. (#7580) 2025-06-11 18:17:14 -04:00
Erich Gubler
db3c35db90 fix(naga): properly impl. auto. type conv. for select 2025-06-11 21:55:02 +09:00
Nico Burns
630905134b
Make strum a dev-only dependency (#7776) 2025-06-11 04:32:11 -04:00
tesselode
18581f38fe
remove outdated docs for Adapter::request_device (#7768) 2025-06-07 11:48:40 +02:00
Thierry Berger
28af245d51
[wgsl-in,ir] Add support for parsing rust-style doc comments (#6364)
* [wgsl-in,ir] add support for parsing rust-style doc comments

* rename relevant items to `doc_comments` (or variations of it)

* address comments

* remove `next_until`

* rename `save_doc_comments` to `ignore_doc_comments`

* expand snapshot test and ignore blankspace when accumulating doc comments

* make tokenizer more straightforward

---------

Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2025-06-05 15:13:11 +02:00
cryvosh
bb46a7f046
[naga hlsl-out, glsl-out] Support atomicCompareExchangeWeak (#7658) 2025-06-02 13:36:44 +02:00
James Ordner
921c6ab597
[metal] remove extraneous main thread check (#7692) 2025-06-02 11:19:49 +02:00
Ryan Kaplan
1268219ba3
Change API from BufferSlice::get_mapped_range_as_array_buffer() to BufferView::as_uint8array() to fix bug where using the former API prevents you from ever unmapping your buffer (#7738)
Co-authored-by: Ryan Kaplan <ryan@Ryans-M2>
2025-06-01 22:46:55 -04:00
Zachary Harrold
6151330e3a
[wgpu-hal]: MVP no_std support (#7599)
* MVP `no_std` support in `wgpu-hal`

* Update CHANGELOG.md

* Fix visibility

* Fix unused imports

* Response to feedback

Co-Authored-By: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Update other `validation_canary` usages

Co-Authored-By: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-05-30 12:31:44 -04:00
Andy Leiserson
38e667efa5
Update the changelog entry for destroy of texture/buffer (#7731) 2025-05-28 11:27:08 -04:00
Andy Leiserson
3cca5f8cfd
Make the copy_buffer_to_buffer size parameter optional (#7659)
* Make wgpu-core's copy_buffer_to_buffer `size` parameter optional

* Make the copy size optional in more places

* Fix for webgpu backend

* [deno_webgpu] Support additional copyBufferToBuffer signatures

* Add changelog entry

* Add copyBufferToBuffer tests to CTS test list

(This doesn't actually enable the tests for the new overloads, because
of a different error reporting issue that affects many CTS tests
including these. But if you run the tests for the new overloads
manually, before and after the fix, you can see that the behavior has
changed.)

* Reproducible formula for vendoring modified webgpu-sys

Commit the updated vendor command in all the files for consistency.
2025-05-28 17:21:19 +02:00
Dmitry Zamkov
9c023e5e29
Implement subgroup quad ops (#7683)
* Rudimentary impl of quad ops, impl quad ops for spirv

* Impl quad swap for hlsl, msl and wgsl, finish spv front

* Cargo clippy & cargo fmt, impl valid for quad ops

* Enable quad feature

* Add missing feature to glsl

* Simplifying code by making `SubgroupQuadSwap` an instance of `SubgroupGather`

* Add `GroupNonUniformQuad` spv capability to Vulkan

* Adding GPU tests for quad operations

* Validate that broadcast operations use const invocation ids

* Added changelog entry

---------

Co-authored-by: valaphee <32491319+valaphee@users.noreply.github.com>
2025-05-26 09:32:01 +02:00
Andreas Reich
661b1720cb
Update changelog for v25.0.2 and v24.0.5 (#7724) 2025-05-25 17:35:50 -04:00
Dmitry Zamkov
44957709ff
Vulkan support for SHADER_EARLY_DEPTH_TEST and fix to conservative depth optimizations (#7676)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-05-24 09:52:39 +00:00
Robert Bamler
1be38fa2e2 Add changelog entry for #7664 2025-05-23 16:08:26 +02:00
Robert Bamler
d7e6a0e1fa
Potentially optimize dot4{I,U}8Packed on Metal (#7653)
* Potentially optimize `dot4{I,U}8Packed` on Metal

This might allow the Metal compiler to emit faster code (but that's not
confirmed). See
<https://github.com/gpuweb/gpuweb/issues/2677#issuecomment-1713292226>
for the optimization. The limitation to Metal 2.1+ is discussed here:
<https://github.com/gfx-rs/wgpu/pull/7574#issuecomment-2835464472>.

* [naga] Factor out new part of `put_block` on msl

CI on test failed because the latest changes to `put_block` made its
stack too big. Factoring out the new code into a separate method fixes
this issue.
2025-05-21 18:47:59 +02:00
Lucien Greathouse
45b3d66301
Fix error message for sampler arrays (#7704) 2025-05-19 19:25:36 -07:00
Andy Leiserson
0dc6bfdd67
Don't raise AlreadyDestroyed error on repeated destroy() calls (#7686)
* Don't raise `AlreadyDestroyed` error on repeated `destroy()` calls

* Add changelog entry
2025-05-13 09:10:48 +02:00
Zachary Harrold
f04391d916
[naga]: Add no_std polyfill for round_ties_even for f32 and f64 (#7585)
* Rely on `libm` for a `no_std` alternative to `round_ties_even`

Update comments around `no_std` CI task

* Update Cargo.toml

* Feedback

Co-Authored-By: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-05-08 09:59:19 -04:00
Mehmet Oguz Derin
2a62299a84
Support Sliced 3D for ASTC (#7577)
Enables "texture-compression-astc-sliced-3d" for backends that support ASTC (such as excluding D3D12).
2025-05-04 12:48:16 +02:00
Robert Bamler
0d06284d96
Allow wgpu-core to use new naga optimizations for dot4{I, U}8Packed (#7595)
* [wgpu-hal] Use highest available SPIR-V version

* [wgpu-hal] Expose capabilities `DotProductInput*`

* Introduce `{PhysicalDeviceFeatures, PrivateCapabilities}::shader_integer_dot_product`
2025-04-30 11:07:20 +00:00
Andy Leiserson
850c3d4310
[naga] Write only the current entrypoint (#7626)
Changes the MSL and HLSL backends to support writing only a single entry
point, and uses them that way in wgpu-hal.

This is working towards a fix for #5885.

* Increase the limit in test_stack_size
2025-04-30 09:59:41 +02:00
Robert Bamler
2271480f17 Add intrinsics for dot4{I,U}8Packed to changelog 2025-04-28 16:37:45 +02:00
Wouter de Bruijn
30b247a8d1
[naga glsl-out] Differentiate between support for std140 and std430 (#7579)
* [naga glsl-out] Differentiate between support for `std140` and `std430` layout, and emit `std140` in Uniforms when possible

* [naga glsl-out] Remove storage buffer std140 layout fallback, and error when we are unable to assign an explicit memory layout for uniform and storage globals

Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>

---------

Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2025-04-26 13:55:02 +02:00
teoxoy
6a7aa14fbd add changelog entry 2025-04-25 12:39:45 +02:00
Erich Gubler
96c1fb11de
docs(CHANGELOG): s/Bux Fixes/Bug Fixes (#7628) 2025-04-24 21:19:01 +00:00
Jim Blandy
02bf7f40cd
Add some missing CHANGELOG.md entries. (#7627) 2025-04-24 17:00:07 -04:00
Jim Blandy
7c5f705580 [naga] Allow textureLoad's sample index arg to be unsigned.
Permit the `sample_index` argument of `textureLoad` overloads to be
either `i32` or `u32`.
2025-04-24 13:45:12 -07:00
Zachary Harrold
bf8cc43a15
Add stderr and termcolor features to Naga (#7482)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-04-18 21:06:22 +00:00
Ebbe Steenhoudt
7cab1747ee
Loosen Viewport validation requirements to match the new specs (#7564) 2025-04-18 15:17:53 +02:00
Kaur Kuut
205e464849
Fix CHANGELOG.md link mishap. (#7563) 2025-04-17 12:26:57 -04:00
Teodor Tanasoaia
6ea7962da7
[d3d12] remove the need for dxil.dll (#7566) 2025-04-17 16:21:36 +02:00
Erich Gubler
c24bf0f56f
chore(CHANGELOG): run prettier (#7556) 2025-04-16 22:34:13 -04:00
Erich Gubler
65c06c2b21 feat(naga): add pack4x{I,U}8Clamp built-ins 2025-04-16 15:07:11 -04:00
Teodor Tanasoaia
ae3241f352
add changelog entries (#7551) 2025-04-16 15:47:01 +00:00
bernhl
06ee718ddd
[naga] Allow Scalar for MathFunction::Distance (#7530)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-04-16 08:24:32 -07:00
Andy Leiserson
09178f2400
[naga] Track globals used directly by a named expression (#7540) 2025-04-15 15:01:19 -04:00
Connor Fitzgerald
700f235378 Update changelog for 25.0.1
# Conflicts:
#	CHANGELOG.md
2025-04-11 15:18:28 -04:00
Connor Fitzgerald
27115f7d57
Add bindless support to changelog (#7516) 2025-04-11 17:39:16 +00:00
Robert Bamler
c7d0af156d Implement dot4I8Packed and dot4U8Packed
Closes #7481.

This implementation roughly follows approach 2 outlined in #7481, i.e.,
it adds a polyfill for the signed and unsigned dot product of packed
vectors for each platform. It doesn't use the specialized instructions
that are available for this operation on SPIR-V (with capability
DotProductInput4x8BitPacked).
2025-04-11 13:32:10 +02:00
Vecvec
65c56fdee4
[spv-out] Prevent ray intersection functions overwriting each other. (#7497) 2025-04-11 11:18:45 +02:00
Connor Fitzgerald
e5a2e440b2 Add f16 to changelog 2025-04-10 20:41:28 -04:00
Bruce Mitchener
fec411cf2d
Remove MaintainBase (#7508) 2025-04-10 15:09:29 -04:00