349 Commits
Author SHA1 Message Date
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
Connor Fitzgerald db907d90b1 Remove unneded feature from encoder_operations_fail_while_pass_alive test (#8606) 2025-12-03 11:31:46 -05:00
Connor FitzgeraldandKevin Reid b94c194bc9 Convert error scopes to use thread-local guards (#8595)
Co-authored-by: Kevin Reid <kpreid@switchb.org>
2025-12-02 19:11:55 +00:00
Connor Fitzgerald 218b65f9a8 Add gpu-assisted validation to a few tests 2025-12-02 12:47:49 -05:00
Connor Fitzgerald 5895de82b5 Rename push constants to immediates (#8586) 2025-12-01 15:20:02 +01:00
Connor Fitzgerald ed6b78936a Make error scopes thread local (#8585) 2025-11-27 11:20:30 +01:00
Martin Svanberg f114138e52 Support STORAGE_RESOURCE_BINDING_ARRAY on Metal (#8464) 2025-11-26 20:18:10 -05:00
Andy Leiserson 119b4efada [naga wgsl-in] Short-circuiting of && and || operators (#7339)
Addresses parts of #4394 and #6302
2025-11-19 17:06:49 -08:00
Vecvec 7ba1a0e41c Add enable extensions for ray queries and ray query vertex returns. (#8545) 2025-11-18 15:56:47 -05:00
d0cf78c8c8 [hal/metal] Mesh Shaders (#8139)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Magnus <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
2025-11-14 23:11:43 -05:00
Vecvec efca3f5066 [spirv] Make ray queries safer (#8390) 2025-11-13 00:33:32 -05:00
Andy Leiserson 7b95053f5a Adjust the expected failure conditions for subgroup_operations (#8515) 2025-11-12 16:14:23 -05:00
Connor Fitzgerald f14458b067 Improve late buffer binding size error (#8484) 2025-11-07 03:21:25 +00:00
Kevin Reid 6560412a52 Make StagingBelt own the Device it uses.
This means that usage of a `StagingBelt` only requires passing along
the current `CommandEncoder` instead of both the encoder and the device.
It also makes the API reflect the fact that a `StagingBelt` cannot be
reused with a fresh device.

As far as I know, the only reason this was not done previously was that
`Device` was not clonable, and so doing this would have required an
`Arc<Device>` or other specific mechanism.
2025-11-01 21:43:48 -04:00
ad0f3111b7 Add multiview limits and tests (#8206)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Magnus <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
2025-11-01 12:08:15 +00:00
Kevin Reid 5633ae8649 Show command encoder label in validation errors.
The plumbing to get it out of `wgpu_core` is awkward but I didn’t see
a clearly better option. I think it would make sense to have something
like `Global::get_label<T>(id: Id<T>) -> String` but that looks like a
lot more work.
2025-10-31 13:03:55 -04:00
Kevin Reid da927daf82 StagingBelt: add a test and document slice size requirements.
* Add documentation that every `allocate()` or `write_buffer()`
  operation must have a size that is a multiple of 4.

* Add assertions for those properties (this gives more helpful panics
  than leaving it to validation).

* Add a randomized test to exercise usage of StagingBelt.
  I was concerned that `StagingBelt` might have an alignment math bug;
  having written this test, I am much less concerned. There was previously
  no test for `StagingBelt` at all, if you don’t count examples/skybox.
2025-10-31 11:53:46 -04:00
Mikołaj Radkowski e7fcb94888 Make multi-planar textures renderable (#8307) 2025-10-29 13:33:48 -04:00
atlv ddcd89fd69 Implement shader barycentrics (#8320) 2025-10-29 13:15:21 -04:00
Andy Leiserson d575c0234b Disallow mixing the raw encoding API with the wgpu API (#8373) 2025-10-22 11:34:40 -04:00
OpsticandConnor Fitzgerald f0209e3db8 Add support for transient textures on Vulkan and Metal (#8247)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-10-16 19:50:01 +00:00
Connor Fitzgerald 7fdc5f1086 Improve various TextureView error messages (#8323) 2025-10-16 15:07:12 -04:00
Erich Gubler e2f70c2481 refactor: satisfy mismatched_lifetime_syntaxes lint (#8350) 2025-10-16 11:30:30 -04:00
Kevin Reid 37bd31ce5d Prune unused dependencies.
* Removed unnecessary dependency in `wgpu` on `hashbrown`.
* Removed unused dependencies in `naga-test`.
* Moved some dependencies in `wgpu-test` to `[dev-dependencies]`
  (see comment for why this is worth doing).

Candidates were discovered by `cargo clippy -- -Wunused-crate-dependencies`.
This command reports whether each dependency is unused in each *crate*,
so it has false positives when a dependency is used by only some crates
in a package, but it is still useful as a short-list.
2025-10-15 21:33:20 -04:00
Erich Gubler 54ded60d8e fix(dx12): align tex. <-> buf. copies via intermediate buffer if !UnrestrictedBufferTextureCopyPitchSupported 2025-10-14 09:39:56 -04:00
Erich Gubler adf4b2f2de fix: reject fragment shader output locations > max_color_attachments limit 2025-10-08 16:34:43 -04:00
Sam a8f51f8fd1 Split MipmapFilterMode from FilterMode (#8314) 2025-10-08 18:06:33 +02:00
Robin CramerandAndreas Reich 4652ea4189 Changed enumerate_adapters to be able to work with custom backends (#8230)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-10-06 19:27:23 +00:00
Andy Leiserson 334170b21e Block creating mesh shader pipelines when the feature is not available (#8298) 2025-10-04 03:12:52 -04:00
Andreas Reich 333f811e9c Rework wgpu::PollType to only two enum variants (#8285) 2025-10-01 18:08:07 -04:00
Andreas Reich 00ea850d79 Allow timeouting on poll (#8282) 2025-10-01 07:19:24 +00:00
Teodor Tanasoaia ce96254f4f [msl] fix vertex pulling with a stride of 0 (#8265) 2025-09-26 13:37:37 -04:00
Teodor Tanasoaia 3375284f16 [D3D12] fix setting vertex buffer array stride if 0 (#8260) 2025-09-26 11:45:37 +00:00
Andy LeisersonandAndreas Reich 1967900565 Encode commands on finish (#8220)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-25 14:22:51 -04:00
05cc6dca82 [hal/dx12] Mesh Shaders (#8110)
* Features and draw commands added

* Tried to implement the pipeline creation (completely untested)

* Fixed clippy issues

* Fixed something I think

* A little bit of work on the mesh shader example (currently doesn't work on dx12)

* Reached a new kind of error state

* Fixed an alignment issue

* DirectX 12 mesh shaders working :party:

* Removed stupid change and updated changelog

* Fixed typo

* Added backends option to example framework

* Removed silly no write fragment shader from tests to see if anything breaks

* Tried to make mesh shader tests run elsewhere too

* Removed printlns and checked that dx12 mesh shader tests run

* Documented very strange issue

* I'm so lost

* Fixed stupid typos

* Fixed all issues

* Removed unnecessary example stuff, updated tests

* Updated typos.toml

* Updated limits

* Apply suggestion from @cwfitzgerald

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Apply suggestion from @cwfitzgerald

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Removed supported backends, made example & tests always pass the filename to shader compilers

* Removed excessive bools in test params

* Added new tests to the list

* I'm a sinner for this one (unused import)

* Replaced random stuff with test params hashing

* Updated typos.toml

* Updated -Fo typo thing

* Actually fixed typo issue this time

* Update CHANGELOG.md

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Update tests/tests/wgpu-gpu/mesh_shader/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update wgpu-hal/src/dx12/mod.rs

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Addressed comments

* Lmao

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-25 03:24:56 +00:00
renovate[bot]andAndy Leiserson 6bab36d1fd chore(deps): update cargo.lock (#8197)
* chore(deps): update cargo.lock

* Update to png 0.18

* Waive cargo-deny advisory check for `adler` crate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andy Leiserson <aleiserson@mozilla.com>
2025-09-08 18:14:34 -04:00
Connor FitzgeraldandKevin Reid fb28da16c1 [wgpu] add convience functions for deferring mapping/callbacks
Co-authored-by: Kevin Reid <kpreid@switchb.org>
2025-09-07 09:42:57 +02:00
Connor FitzgeraldandAndreas Reich c488bbe604 [wgpu] Improve buffer mapping errors and allow multiple immutable borrows (#8150)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-02 12:21:16 -04:00
Connor Fitzgerald 8d1f4bb5f2 Require token for experimental features (#8163) 2025-08-29 15:43:27 -04:00
Matthias Reitinger 80a742094c [wgpu-core] Improve errors for forbidden texture copy formats (#8156)
TransferError now has separate variants for texture copy formats that
are only forbidden in combination with specific aspects
(CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that
are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).

This produces a less confusing error message by not mentioning the
aspect it is not relevant.
2025-08-29 10:03:35 +00:00
Connor Fitzgerald 2ff46cd7cd Remove MULTI_DRAW_INDIRECT feature (#8162) 2025-08-28 12:00:14 -04:00
MagnusandConnor Fitzgerald 17a17f716a Initial precompiled shaders implementation (#7834)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-08-20 16:20:59 -04:00
Kevin Reid 2d835bf3b4 Call uncaptured error handler without the lock held.
This prevents a possible deadlock if the callback itself calls wgpu
operations.
2025-08-13 16:26:46 +01:00
Jamie Nicol 486c151772 [dx12,vulkan] Add support for P010 texture format (#8086)
P010 is a 4:2:0 chroma subsampled planar format, similar to NV12. Each
component uses 16 bits of storage, of which only the high 10 bits are
used. On DX12 this maps to DXGI_FORMAT_P010, and on Vulkan this maps to
G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16.

The existing "nv12" gpu test module has been renamed to
"planar_texture", and a new test P010_TEXTURE_CREATION_SAMPLING has
been added similar to the existing NV12_TEXTURE_CREATION_SAMPLING. The
remaining tests in this module have been converted to validation tests,
and now test both NV12 and P010 formats.
2025-08-13 15:35:20 +02:00