626 Commits

Author SHA1 Message Date
teoxoy
2ab3b6da8d guarantee DownlevelFlags::COMPUTE_SHADERS when DownlevelFlags::INDIRECT_EXECUTION is enabled 2025-03-26 18:26:31 +00:00
teoxoy
0285e60984 Replace the indirect-validation feature with InstanceFlags::VALIDATION_INDIRECT_CALL.
With the only caveat that device creation will now panic if the `wgsl` feature is not enabled, `InstanceFlags::VALIDATION_INDIRECT_CALL` is set and the device supports `DownlevelFlags::INDIRECT_EXECUTION`.
2025-03-26 18:26:31 +00:00
Connor Fitzgerald
4687973c9a Use bytemuck instead of slice::from_raw_parts for transmutes (#7376) 2025-03-19 22:05:21 -04:00
Christopher Fleetwood
c6286791fe feat: implement F16 support in shaders (#5701)
Co-authored-by: FL33TW00D <fleetwoodpersonal@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: ErichDonGubler <erichdongubler@gmail.com>
2025-03-19 16:26:50 +00:00
SupaMaggie70Incorporated
e8ce3ae973 Add mesh shader stages to wgt::ShaderStages and naga::ShaderStage (#7292)
* Initial changes

* Fixed metal backend in wgpu-hal, ran tests
2025-03-15 05:34:20 +00:00
Kevin Reid
029bdb107a docs: Add links and examples for VertexAttribute and friends.
* Added “upward” links from `VertexAttribute` and `VertexBufferLayout`
  to the places they are used.
* Documented the exact expected inputs of `vertex_attr_array!` and hid
  the internal implementation.
* Added doc-test examples for:
    * `VertexBufferLayout`, demonstrating how to construct a
      `VertexBufferLayout` that corresponds to a `struct`.
    * `vertex_attr_array!`, demonstrating exactly what the output of the
      macro is.
2025-03-14 18:31:30 -04:00
Kevin Reid
fbe005f11a Make request_adapter() report which backends were tried.
This will help users determine whether the problem is:

* a backend is not statically enabled
* a backend is not dynamically enabled
* no drivers or physical adapters are present for that backend
  (further distinction would be useful here)
* no adapters met the required criteria

There are deficiencies in the reporting of WebGPU vs. WebGL support.
Those would best be fixed by also fixing the mutual exclusion of those
backends.
2025-03-14 11:45:49 +01:00
Kevin Reid
326ad03ce1 Move trace_dir/trace_path to a custom enum inside DeviceDescriptor.
This allows `wgpu` to not unconditionally depend on `std::path::Path`.
It’s also, in my opinion, more user-friendly, because the feature which
most users will not use (and is not currently functional) is now a
defaultable struct field instead of a required parameter.

The disadvantage is that `wgpu-types` now has to know about tracing.
2025-03-10 22:17:06 -04:00
Andreas Reich
fedc80eb80 [wgsl-in, wgsl-out, glsl-in] WebGPU compliant dual source blending feature (#7146)
Makes the dual source implementation in wgpu WebGPU spec compliant.
Furthermore, makes the dual source blending extension available when targeting WebGPU.
2025-03-08 21:07:37 +01:00
Kevin Reid
7319512778 Additional documentation for buffer mapping, types, and constants. (#7283)
* Additional documentation for buffer mapping, types, and constants.

* Clarify `Snorm` texture format conversion.

* Fix typo.
2025-03-06 19:08:34 +00:00
Bruce Mitchener
e446551b27 docs: Improve linking, backticks (#7281) 2025-03-06 12:37:19 -05:00
SupaMaggie70Incorporated
20bad46d40 Add multiview mesh shaders to wgpu-hal (#7278) 2025-03-06 12:25:55 -05:00
Vecvec
5b3266db23 Support getting hit vertex positions (#7183) 2025-03-04 20:06:44 +01:00
SupaMaggie70Incorporated
a6109bf69b Mesh shaders - initial wgpu hal changes (#7089)
* Initial(untested commit), vulkan and gles only supported

* Maybe fixed compiles for metal and dx12

* Hopefully fixed compiles for other backends and updated to functional(?) vulkan thing

* Fixed the clippy warning

* Fixed silly documentation mistake

* Fixed issue with multiview feature

* Dummy commit for dummy CI

The CI pooped itself, hopefully this fixes that. Will probably be undone either way.

* Re trigger CI checks, to avoid #7126

* Changes based on code review

* Fixed clippy warning, broken cargo.lock

* Unfucked cargo.lock for real this time

* Switched match to if-let in accordance with review

* Updated changelog

* Fix CI error

Done from web out of impatience

* CI is very angry 😡

Made CI less angry by fixing formatting(hopefully). This commit was also done from GitHub web.

* Removed comment in following request

* Update wgpu-hal/src/vulkan/adapter.rs

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-03-04 00:12:38 +00:00
Erich Gubler
c626d4f819 build: update CORE_MSRV 1.80.1 → 1.82.0 2025-02-26 22:58:50 -05:00
Erich Gubler
8774ab53d5 chore: remove std::mem::* imports now unnecessary with CORE_MSRV
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](https://github.com/rust-lang/rust/pull/123168/).
2025-02-26 22:58:50 -05:00
Erich Gubler
18951ea3d2 build: update CORE_MSRV 1.76.0 → 1.80.1 2025-02-26 22:58:50 -05:00
Kevin Reid
3447b3e7b6 Polish documentation of PresentMode.
* Link to where it is used and how to check support.
* Link from `Auto*` to the variants they refer to.
* Organize mode information into lists.
* Document which value is the default value.
* Various wording changes.

I mostly did not touch the descriptions of the individual modes.
I think that they could use some explanation of jargon (what is a
“presentation engine”, really?) but I am not the person to write that.
2025-02-24 10:15:40 +01:00
Connor Fitzgerald
ae5dc0e7cb Target Specific Compilation (#7076) 2025-02-22 12:38:58 +01:00
Teodor Tanasoaia
b5e32cec58 add max_shader_model to Dx12Compiler (#7167) 2025-02-18 13:44:23 +01:00
Connor Fitzgerald
194d4b1f36 New Binding Array Limit (#6952) 2025-02-17 09:22:24 -05:00
Connor Fitzgerald
d8833d0798 Use Update After Bind Descriptors for Bind Groups With Binding Arrays (#6815)
* Use Update After Bind Descriptors for Bind Groups With Binding Arrays

Update After Bind

x

* Comments

* Fix URL
2025-02-15 12:02:27 -05:00
Connor Fitzgerald
7e119968ce Properly Deal with Timeouts (#7030) 2025-02-14 23:19:51 +00:00
Erich Gubler
eea3dde67e fix: use separate pub consts for FeaturesWebGPU 2025-02-14 12:18:41 -05:00
Erich Gubler
b05e9705bf fix: add cbindgen:ignore on const with the same ident. 2025-02-14 12:18:41 -05:00
Erich Gubler
a7a5784156 refactor: use match instead of if let for Features::from_bits 2025-02-14 12:18:41 -05:00
Erich Gubler
8ecafe2750 refactor: use match, instead of if, for Features::from_name 2025-02-14 12:18:41 -05:00
Erich Gubler
e8e09d059f fix: use same visibility for Features fields as itself 2025-02-14 12:18:41 -05:00
Erich Gubler
26eded137a fix: allow(missing_docs) on Features fields 2025-02-14 12:18:41 -05:00
Erich Gubler
36ad109d7a style: fmt. bitflags_array! macro a bit
Most important points:

- Make macro repetitions easy to parse as a human.
- Try to follow `rustfmt` a bit more closely.
2025-02-14 12:18:41 -05:00
Bruce Mitchener
7fe8e3818a wgpu-types: Improve formatting of docs (#7125) 2025-02-13 12:25:21 -05:00
Kevin Reid
118a985ccd Allow creating Noop backend through the normal mechanisms. 2025-02-12 22:31:47 -05:00
Kevin Reid
0143b4aaa0 Rename Empty backend to Noop.
This is in preparation for making it a more substantial test stub,
able to execute nontrivial code, and usable from the safe `wgpu` API.
2025-02-12 22:31:47 -05:00
Adrian Wielgosik
0f5d575ef3 Lower max_color_attachments limit for GL to 4 (#6994)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-02-13 00:37:34 +00:00
Vecvec
3a4a40aae4 [wgpu-hal] Blas compaction (#7101) 2025-02-12 13:19:07 +00:00
Vecvec
0922631125 Fix transform buffer when building blas (#7062)
Co-authored-by: Nicolas Silva <nical@fastmail.com>
2025-02-10 20:18:41 -05:00
Andreas Reich
e5e7138169 Expose FeaturesWGPU & FeaturesWebGPU via wgpu crate & implement From (#7086)
* move tests into conditionally compiled mod and place them at the end. add some whitespace for readability

* allow creation of `Features` from `FeaturesWGPU` & `FeaturesWebGPU`
2025-02-10 09:19:14 +01:00
Vecvec
6558deb204 Split up features. (#6905)
Splits up features into wgpu & webgpu features.
2025-02-08 17:38:06 +01:00
JMS55
0fc0b35899 Transition resources (#6678)
* WIP

* Fix typo

* WIP: Implement structure of  command_encoder_transition_resources

* WIP

* More work

* Clippy

* Fix web build

* Use new types for API, more docs

* Add very basic test

* Try to fix test cfg

* Fix merge

* Missed commit

* Use wgt types instead of hal types

* Implement `Clone` for `ShaderModule` (#6939)

* Move to dispatch trait, move more things to wgt

* Move existing code to use new wgt types

* Fixes

* Format import

* Format another file

* Fixes

* Make module private

* Fix imports

* Fix test imports

* Rexport types

* Fix imports

* Fix import

---------

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-24 00:54:19 -05:00
Connor Fitzgerald
d8e7ab1ad1 Refactor Cargo.toml Significantly (#6980) 2025-01-23 22:49:48 +00:00
Connor Fitzgerald
a1fc4a0316 Allow Short Circuting GL Fences (#6942) 2025-01-21 19:28:14 +00:00
Connor Fitzgerald
4ed5021996 Ban Dynamic Offsets and Binding Arrays in the Same Bind Group (#6811)
* Ban Dynamic Offsets and Binding Arrays in the Same Bind Group

* Add Tests and Uniform Buffer Restriction
2025-01-20 13:28:32 -05:00
Connor Fitzgerald
779261e64d Release v24 (#6923) 2025-01-15 16:29:22 -05:00
Connor Fitzgerald
0f37714fb8 Separate Out Backend Options into Individual Structs (#6895) 2025-01-15 17:32:15 +00:00
atlv
be95178709 64 bit image atomics (#5537) 2025-01-15 08:05:13 -05:00
Vecvec
21de7f7773 Support DXR in wgpu-hal & naga. (#6777)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-14 21:28:37 -05:00
Vecvec
0b2c9e4f4b [Ray-tracing] Change index offset to first index (#6873)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-14 16:56:24 -05:00
atlv
18471d8e78 Image atomics support (#6706)
* Image atomics support

* Address feedback

* fix merge

* Fixes

* Add a couple tests

* Update wgpu-types/src/lib.rs

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

* feedback

* feedback

* glsl

* glsl fix

* fix glsl

* fix fix

* fix fix fic

* fix?

* fix

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2025-01-13 15:37:12 +00:00
Zachary Harrold
05e62f96f9 Add no_std support to wgpu-types (#6892)
* Initial Commit

* Remove now-redundant `format` import

* Update CHANGELOG.md

* Appropriately feature-gate `texture_format_serialize` test

* Remove `alloc` feature

Also fixed some documentation links and a Wasm `std` import

* Revert change to `Serialize` for `TextureFormat`

* Combine use statements

* Switch from `PathBuf` to `String`

* Consider environmental flags as unset on `no_std`

* Fix missing `format!`

* Add new CI tasks for `no_std` testing

* Comment out known failing CI matrix option

* Update all usage of `Dx12Compiler::DynamicDxc`

* Added comments to CI

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* CI Touchups

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-12 05:03:47 +00:00
the letter L
1aabf22e7a fix cts_runner (#6840)
* fix: unbreak compute_pass execution and state

* fix: cts_runner js_runtime needs Permissions struct

* fix: ColorWrites bitflags serde

---------

Co-authored-by: turbocrime <turbocrime@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-10 16:46:10 +00:00