Commit Graph
830 Commits
Author SHA1 Message Date
metamuffin 33e8df0f44 Fix deadlock between snatchable_lock and trackers in Queue::write_texture (#7004)
* Fix deadlock between snatchable_lock and trackers in Queue::write_texture

* Fix another deadlock in write_texture between pending_writes and snatchable_lock.
2025-01-27 18:01:57 +01:00
@brody4hire - C. Jonathan BrodyandConnor Fitzgerald df54acc05d use hashbrown in more crates (etc.) (#6938)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 11:50:33 -05:00
Daniel McNab fcbadc9529 Link to TextureBlitterBuilder from TextureBlitter::new (#7003) 2025-01-27 11:30:26 +01:00
ed-2100andConnor Fitzgerald 36ccc9fc1d Fix surface drop order. (#6997)
* Fix surface drop order.

* Add changes to changelog.

* Update SAFETY note.

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

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-26 22:23:51 -05:00
Dennis LonoshchukandConnor Fitzgerald 0e7d93ed92 Adds hello window example (#6992)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 02:08:52 +00:00
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
SamsonandErich Gubler 04aff59a14 [naga] implement pointer_composite_access WGSL language extension (#6913)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-23 13:29:17 -05:00
Kent Slaney 3cd2e7caf0 [naga] Remove unused types and global expressions in a single pass.
In compaction, correctly identify unused types and global expressions,
rather than treating all global expressions referred to by
`PendingArraySize::Expression` array lengths as used even if the array
type itself is not.

This is tested by checking that going from expression to type and
back, along with the opposite, is correctly marked as used. It also
checks that adding an unused type using an expression gets compacted
out.

See the comments on `ModuleTracer::type_expression_tandem` for
details.

Fixes #6788.
2025-01-23 08:11:18 -08:00
Daniel McNab 5e2bcc9191 Improve the docs of PipelineCache and friends (#6978) 2025-01-23 11:56:05 +01: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
b626020769 [naga] parse and validate @must_use attribute (#6801)
* feat: parse and enforce `@must_use` attribute

* feat: refuse `@must_use` of void function

* generated naga/tests/out/ir

* revert extraneous changes

* fix clippy

* update repeated attribute error to trunk format

* struct members can't have `@must_use`

* review fixes

* Remove must_use from FunctionResult and revert the related changes

---------

Co-authored-by: turbocrime <turbocrime@users.noreply.github.com>
Co-authored-by: Jamie Nicol <jnicol@mozilla.com>
2025-01-20 18:09:36 +00:00
Andreas Reich 426c1d364f Fix missing wgt re-export on wgpu for CopyExternalImageDestInfo (#6962) 2025-01-20 18:00:34 +00:00
@brody4hire - C. Jonathan Brody 68a6f3bf8c update & clean up recent changes in CHANGELOG.md (#6948) 2025-01-19 09:16:07 +01:00
Andreas Reich e2d14c677a Fix building wgpu with --no-default-feautures on web (wasm32-unknown-unknown) (#6946)
* Fix wasm build without features

* silence unused warnings if wgc & webgpu are disabled

* add no-features check for web ci

* add changelog entry
2025-01-18 15:05:57 -05:00
Erich Gubler 3b3e1939f9 Eliminate overflow in query set bounds checks (#6933) 2025-01-17 16:36:22 +00:00
VecvecandConnor Fitzgerald 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
Andreas Reich d5d5157b5d Add "Most objects in wgpu are now Clone" to highlight section (#6930) 2025-01-16 11:13:04 -05:00
@brodycj - C. Jonathan BrodyandConnor Fitzgerald beb33414c7 trace directory path updates (#6924)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-16 14:50:15 +00:00
@brodycj - C. Jonathan Brody 623f143a82 Start using hashbrown (#6925) 2025-01-16 14:53:36 +01:00
Connor Fitzgerald 779261e64d Release v24 (#6923) 2025-01-15 16:29:22 -05:00
caelunshunandConnor Fitzgerald 30364134f3 Expose conversions between TextureFormat and naga::StorageFormat (#6185)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-15 17:44:14 +00:00
Connor Fitzgerald 0f37714fb8 Separate Out Backend Options into Individual Structs (#6895) 2025-01-15 17:32:15 +00:00
Kent SlaneyandConnor Fitzgerald a32467041d fix >= in template list matching for a<b>=c (#6898)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-15 17:25:04 +00:00
atlv be95178709 64 bit image atomics (#5537) 2025-01-15 08:05:13 -05:00
sagudev 6c10e0be73 Add changelog
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-01-15 11:14:17 +01:00
VecvecandConnor Fitzgerald 21de7f7773 Support DXR in wgpu-hal & naga. (#6777)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-14 21:28:37 -05:00
Jim Blandy 90a97a1ed9 Add CHANGELOG.md entries for jimblandy's PRs. (#6918) 2025-01-14 22:45:03 +00:00
VecvecandConnor Fitzgerald 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
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 HarroldandConnor Fitzgerald 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
Eric Szentivanyi 4efc992d6d Add raw_handle method for metal texture (#6894)
* Add `raw_handle` method for metal texture

* Add raw_handle method for metal texture (#6894)
2025-01-11 02:45:09 +00:00
Connor FitzgeraldandGuus Waals b0f1fa66ef Add VisionOS Support (#6888)
* Add visionos support

* Use `target_vendor = "apple"`

* Fixes

* Build VisionOS

* Gah

* Bleh

* Typos

---------

Co-authored-by: Guus Waals <_@guusw.nl>
2025-01-10 17:33:58 +00:00
SamsonandErich Gubler dc9b2eb718 Add Instance::wgsl_language_features (#6814)
* docs(naga): clarify desc. for `LanguageExtension`

* feat(naga): expose `{,Implemented,Unimplemented}LanguageExtension`

* feat(naga): expose `ImplementedLanguageExtension` as `WgslLanguageExtension`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>

* feat: add `Instance::wgsl_language_features`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>

* refactor: reimpl. `ImplementedLanguageExtension::all` w/ `strum::VariantArray`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-10 04:02:39 +00:00
Asher Jingkong ChenandTeodor Tanasoaia 198762e5cc feat: Add 32-bit floating-point atomics (SHADER_FLOAT32_ATOMIC) (#6234)
* feat: Add 32-bit floating-point atomics

* Current supported platforms: Metal
* Platforms to support in the future: Vulkan

Related issues or PRs:

* gfx-rs/wgpu#1020

* Add changelog

* Edit changelog

* feat: Add 32-bit float atomics support for Vulkan (SPIR-V shaders)

* atomicSub for f32 in the previous commits is removed.

* Update test

* chore: doc type link

* refactor: Revise float atomics on msl and spv

* Make branches tidy
* Also revise old codes
* Ensure the implementations are supported by Metal and Vulkan backends

* refactor: Renaming flt32 atomics to float32 atomics

* chore: Add link to Vulkan feature

* fix: cargo fmt

* chore: hack comment

* Revert changelog

* Fix: Cargo advisory

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

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

* Update naga/src/lib.rs

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

* Adjust feature flag position

---------

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2025-01-09 16:03:47 +00:00
Eddie HatfieldandErich Gubler 1f67474140 Add directive keywords to error message for parsing global item (#6723)
Notify the user that they can also use `diagnostic`, `enable`, or
`requires` in this context.

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-08 16:24:03 +00:00
Vecvec 658052885a Use transform_buffer_offset when initialising transform_buffer. (#6864)
* use `transform_buffer_offset` instead of `index_buffer_offset` in part of the initialisation of transform_buffer.

* Format.

* Changelog.

* Only unwrap transform alignment once.
2025-01-07 03:01:50 -05:00
Connor Fitzgerald 991ee61026 Impl Hash on AdapterInfo and DeviceType (#6869) 2025-01-06 20:42:22 -05:00
Connor Fitzgerald 4124fbfff1 Raise Vulkan/DX12/GL max_color_attachment_bytes_per_sample Limit (#6866) 2025-01-06 20:23:47 -05:00
Connor Fitzgerald cb6dbb897f Vulkan Sampler Cache (#6847) 2025-01-06 19:17:17 -05:00
Andreas Reich fb210ab363 Pass InstanceDescriptor by reference and make it clonable (#6849) 2025-01-06 15:40:30 -05:00
Vecvec 74f3a2f919 [vulkan] allocate descriptors for acceleration structures (#6861) 2025-01-06 15:37:13 -05:00
Matthew Wong 826db5e6b6 [naga] change i32 arithmetic operations to use wrapping_ instead of checked_ (#6835) 2025-01-06 14:08:56 +01:00
Andreas Reich 959c2db0bc Explicitly enable dx12 & metal features on wgpu-info (#6844) 2025-01-03 14:09:38 -05:00
Andreas Reich c46624f1fa Fix filtering out dx12 software adapters (#6843) 2025-01-02 14:36:23 -05:00
Vecvec 7b5a348c7c Set index type to NONE in get_acceleration_structure_build_sizes (#6802) 2024-12-23 17:20:26 -05:00
Eddie HatfieldandErich Gubler 79280bc3d4 Detect a common syntax error case for diagnostic_directive (#6718)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-12-18 11:21:45 -05:00
Valtteri ValliusandConnor Fitzgerald 0fe20342e0 Add multiple render targets example (v2) (#5313)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-12-18 04:41:21 +00:00
Schell Carl ScivallyandJim Blandy ea7556853d [naga spv-in] Support atomics in fields of global structs
Handle SPIR-V input that performs atomic operations on structs that
have more than one field. Track which fields of which struct types are
used by atomic operations on which global variables, and then give
those global variables new types in which exactly those fields have
had their `Scalar` leaf types changed to `Atomic`.

Add snapshot tests.

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-12-17 07:45:41 -08:00
VecvecandConnor Fitzgerald 0d927c244f Add documentation for the raytracing API (#6747)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-12-16 20:21:38 +00:00
Connor Fitzgerald 89a8867f9b Enable Partial Binding on DX12 (#6734) 2024-12-16 15:47:19 +00:00