239 Commits

Author SHA1 Message Date
teoxoy
a2878db5f2 add indirect_buffer_offsets test 2025-03-26 18:26:31 +00:00
teoxoy
53c2d15e0b implement indirect draw validation 2025-03-26 18:26:31 +00:00
Erich Gubler
1e172b2e14 test: repair multi-instance tests (#7388) 2025-03-21 13:25:31 -04:00
Connor Fitzgerald
db4cb26858 Allow overriding instance flags in tests (#7374) 2025-03-20 11:35:54 -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
Andy Leiserson
8474132bd2 [tests] Test case for multiple bindings with different sizes (#7360)
* [tests] Test case for multiple bindings with different sizes (#7359)

* Fix clippy
2025-03-17 18:16:21 -04:00
Kevin Reid
fcac8a9b28 Add Device::noop().
This is a useful shortcut for tests and example code, allowing it to
create a noop device without needing to deal with nonexistent
fallibility and asynchrony.
2025-03-14 20:59:28 -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
David Zhong
3eb1bd53bb Use TextureViewDescriptor::usage when Creating Texture View (#7162)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-03-11 13:01:23 -04: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
Kent Slaney
2fac7fa954 [naga] Correct override resolution in array lengths.
When the user provides values for a module's overrides, rather than
replacing override-sized array types with ordinary array types (which
could require adjusting type handles throughout the module), instead
edit all overrides to have initializers that are fully-evaluated
constant expressions. Then, change all backends to handle
override-sized arrays by retrieving their overrides' values.

For arrays whose sizes are override expressions, not simple references
to a specific override's value, let front ends built array types that
refer to anonymous overrides whose initializers are the necessary
expression.

This means that all arrays whose sizes are override expressions are
references to some `Override`. Remove `naga::PendingArraySize`, and
let `ArraySize::Pending` hold a `Handle<Override>` in all cases.

Expand `tests/gpu-tests/shader/array_size_overrides.rs` to include the
test case that motivated this approach.
2025-03-06 14:21:40 -08:00
Vecvec
5b3266db23 Support getting hit vertex positions (#7183) 2025-03-04 20:06:44 +01:00
Connor Fitzgerald
99437e7343 Turn dependency tests from xtask subcommand into #[test]s (#7220) 2025-02-27 05:22:08 +00:00
Connor Fitzgerald
8fb09a5ad6 Move REPO_MSRV to 1.85 (#7218) 2025-02-24 23:39:34 -05:00
Connor Fitzgerald
8a4e50f1a0 Rename tests/validation_tests to tests/validation-tests 2025-02-23 14:06:34 -05:00
Connor Fitzgerald
31eb329748 Make tests/compile_tests into tests/compile-tests 2025-02-23 14:06:34 -05:00
Connor Fitzgerald
c4114e7347 Rename tests/tests to tests/gpu-tests 2025-02-23 14:06:34 -05:00
Connor Fitzgerald
ab0e4b1b6f Refactor Validation Tests a Bit (#7199) 2025-02-23 12:57:19 -05:00
Jamie Nicol
7e42040fa5 Add validation tests ensuring destroyed textures and buffers cause submission to fail (#7181) 2025-02-19 10:09:17 -05:00
Connor Fitzgerald
e590555a8c test: use spirv-as instead of pre-assembled SPIR-V (#7157) 2025-02-17 14:48:09 -05:00
Connor Fitzgerald
194d4b1f36 New Binding Array Limit (#6952) 2025-02-17 09:22:24 -05:00
Kevin Reid
9da04c2b0b Add getters and From implementations to BufferSlice. (#7148)
* Add getters to `BufferSlice` to obtain its parts.

* Add conversions from `BufferSlice` to `BufferBinding` and `BindingResource`.
2025-02-17 11:06:13 +01: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
Connor Fitzgerald
106b709798 Remove HashMaps from wgpu API (#7133)
* Remove HashMaps from Surface API

* Fix Comments and Errors
2025-02-14 14:36:22 -05:00
Kevin Reid
c4b25b8794 Duplicate BufferSlice methods onto Buffer and vice versa. (#7123)
This allows users to skip creation of `BufferSlice` if they have no use
for it, and brings `wgpu` closer to the WebGPU API without removing any
Rust convenience. New functions:

* `BufferSlice::slice()`
* `Buffer::map_async()`
* `Buffer::get_mapped_range()`
* `Buffer::get_mapped_range_mut()`
* `Buffer::get_mapped_range()`
2025-02-13 14:40:09 +01:00
Kevin Reid
0f111cb27c Add a test for the noop backend. 2025-02-12 22:31:47 -05:00
Kevin Reid
118a985ccd Allow creating Noop backend through the normal mechanisms. 2025-02-12 22:31:47 -05:00
Vecvec
5af9e30009 Fix HLSL single scalar loads (#7104) 2025-02-12 18:05:32 +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
Vecvec
6558deb204 Split up features. (#6905)
Splits up features into wgpu & webgpu features.
2025-02-08 17:38:06 +01:00
Vecvec
d34707ec3f Rename instance_id & instance_custom_index to instance_index & instance_custom_data (#6780) 2025-02-05 18:23:22 +01:00
Vecvec
7cde4707ec Fix hlsl storage format generation (#6993) 2025-01-31 16:31:03 +01:00
Connor Fitzgerald
8caefceb8e Add rust-version to more crates (#7036) 2025-01-31 10:33:10 +01:00
@brody4hire - C. Jonathan Brody
ea4d18c108 cleanup: resolve spelling errors in test comments (#7028) 2025-01-29 23:49:26 +00:00
@brody4hire - C. Jonathan Brody
df54acc05d use hashbrown in more crates (etc.) (#6938)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 11:50:33 -05: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
Teodor Tanasoaia
a8bd1fe1ac [d3d12] bound check dynamic buffers (#6931)
To achieve this for dynamic storage buffers we changed the way we bind them. They now go in root tables and we pass the offset via a root constant.
2025-01-23 17:18:36 +00:00
Connor Fitzgerald
a1fc4a0316 Allow Short Circuting GL Fences (#6942) 2025-01-21 19:28:14 +00:00
Connor Fitzgerald
436f716715 Unconditionally Generate Bindless Samplers in DX12 (#6766) 2025-01-21 14:24:03 -05: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
Andreas Reich
426c1d364f Fix missing wgt re-export on wgpu for CopyExternalImageDestInfo (#6962) 2025-01-20 18:00:34 +00:00
Vecvec
bdef8c0407 [spirv] Stop naga causing undefined behavior in rayQueryGet*Intersection (#6752)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-17 00:04:33 +00: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
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
Connor Fitzgerald
c71d67010f Fix Features when Depending on wgpu (#6915) 2025-01-14 18:19:43 +00: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