Commit Graph
1148 Commits
Author SHA1 Message Date
John-John Tedro 71762a590c Avoid allocating during queue submit (#4947) 2024-01-03 19:39:15 +01:00
daxpeddaandConnor Fitzgerald f004a9def9 Add cfg_aliases to wgpu (#4935)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-01-02 16:05:51 -05:00
Erich Gubler e1baa5a56e docs: inline document-features usage, remove dep.
Re-implements https://github.com/gfx-rs/wgpu/pull/4886 (CC @Wumpf)
without the `document-features` crate, which has issues integrating into
Firefox builds after being `cargo vendor`ed into its repository. This
issue is being tracked against
https://github.com/slint-ui/document-features/issues/20. Once resolved,
I expect that we will want to revert this PR in its entirety, since
`document-features` is still a good addition to `wgpu`'s documentation
story.

Internally, consensus has already been achieved for this change.
Firefox's ability to build unfortunately take priority over this
particular convenience. Hopefully, we won't have to compromise shortly!

I tested this by ensuring that the HTML output of our existing
`document_features::document_features!(…)` usage was exactly the same.
There should be exactly zero regressions in the current state of
documentation for users. For maintainers, I have added a disclaimer that
one needs to keep changes in sync. with the relevant `Cargo.toml`
manifests.
2023-12-22 14:31:12 -05:00
Connor Fitzgerald 87ecc089dd Remove id32 feature 2023-12-20 21:39:24 -08:00
Brad Werth 56d9d32a07 [wgpu-core] Ensure that DeviceLostCallback is always called exactly once
* Ensure device lost closure is called exactly once before being dropped.

This requires a change to the Rust callback signature, which is now Fn
instead of FnOnce. When the Rust callback or the C closure are dropped,
they will panic if they haven't been called. `device_drop` is changed
to call the closure with a message of "Device dropped." A test is added.
2023-12-19 23:16:10 +00:00
daxpedda bcdc240a9a WebGL: add support for more RawWindowHandle variants (#4888) 2023-12-17 20:47:38 -05:00
Andreas Reich ba56dd2901 Document wgpu & wgpu-core features (#4886) 2023-12-17 22:10:38 +00:00
daxpeddaandAndreas Reich 2053358d89 Add wgpu crate features for backends (#4815)
* Introduce `dx12` and `metal` crate features to `wgpu`

* Implement dummy `Context` to allow compilation with `--no-default-features`

* Address review

* Remove `dummy::Context` in favor of `hal::api::Empty`

* Add changelog entry

* Panic early in `Instance::new()` if no backend is enabled

Co-Authored-By: Andreas Reich <1220815+Wumpf@users.noreply.github.com>

---------

Co-authored-by: Andreas Reich <1220815+Wumpf@users.noreply.github.com>
2023-12-16 10:39:53 +01:00
Valaphee The MeerkatandAndreas Reich 6c4128b4e7 [wgpu] correct doc for resolve query set (#4849)
* Correct doc for resolve query set

* Add note about wgpu::QUERY_SIZE

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2023-12-09 22:56:09 +00:00
Andreas Reich d801c6111d Fix BufferMapRange not being Send/Sync (on native) (#4818)
* Make `BufferMappedRange` trait WasmNotSendSync

* make QueueWriteBuffer trait Debug

* add changelog

* fix pr numbers in changelog

* missing send/sync on web.rs on BufferMappedRange for fragile-send-sync-non-atomic-wasm + !atomics
2023-12-09 11:25:27 +00:00
Teodor Tanasoaia 0cbabcf229 Update multi-planar texture API (#4837) 2023-12-07 14:06:56 -05:00
Connor Fitzgerald 2c2145c3a6 Remove expose-ids Feature (#4841)
* Remove expose-ids feature

* Changelog
2023-12-06 17:09:10 -05:00
Douglas Dwyer 10253db555 Fix Javascript exception on repeated BufferSlice::get_mapped_range calls (#4726)
* Add reusable buffer mappings for WASM

* Run cargo fmt

* Update CHANGELOG.md

* Update web.rs

* Add documentation for WebBuffer struct
2023-12-06 21:24:09 +00:00
0f4df52b5a [wgpu-hal] Inline RayQuery Support (#3507)
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-06 21:12:41 +00:00
Valaphee The Meerkat a1fafe394f Remove DX11 backend (#4828) 2023-12-06 15:12:46 -05:00
Almar Klein 32c5a22293 Add feature float32-filterable (#4759) 2023-12-04 14:23:13 +01:00
LeonandConnor Fitzgerald 1823f8bbdf Fixes and changes to the documentation for increasing clarity (#4806)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-01 14:02:00 -05:00
teoxoy 6ff5f8e4ad improve features/limits docs 2023-11-29 19:55:18 +01:00
teoxoy da73522720 rename DeviceDescriptor.limits to DeviceDescriptor.required_limits 2023-11-29 19:55:18 +01:00
teoxoy 9be6c8890f rename DeviceDescriptor.features to DeviceDescriptor.required_features 2023-11-29 19:55:18 +01:00
ComfyFluffy c4ef520657 Add space to a comment inside make_spirv_raw (#4804) 2023-11-29 18:47:57 +00:00
Xiaopeng LiandConnor Fitzgerald a6503e59c9 Support nv12 texture format (#4573)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-11-28 16:11:26 +00:00
Connor Fitzgerald 4f24c31765 Fixes for Skybox and All Examples (#4780) 2023-11-27 11:40:37 +01:00
TÖRÖK Attila 2964eed6f9 Bump web-sys to 0.3.65 (#4777) 2023-11-26 17:54:29 -05:00
Nicolas Silva 350c9633fe Conditionally lift API logging from trace to info level (#4769)
* Conditionally lift API logging from trace to info level

Most of this logging used to be info level until I demoted it to trace. Unfortunately this gets in my way because:
 - Most of the logging I currently need is these API entry points, there is is a fair amount of more verbose logging in wgpu at higher levels than trace
 - Firefox disable all trace and debug logging for optimized builds, which means I miss the this API logging where I need most.

This patch lifts the api logging back to info level.

* Move the api logging behind the api_log macro
2023-11-24 19:14:38 +01:00
Nicolas Silva 7dad106039 Make the command_encoder_clear_buffer's size an Option<BufferAddress> (#4737)
* Make the size parameter of command_encoder_clear_buffer an Option<BufferAddress>

* Add a changelog entry
2023-11-22 11:42:34 +01:00
Connor Fitzgeraldandteoxoy 1df98d9888 Test And Normalize Vertex Behavior on All Backends (#4723)
Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2023-11-21 22:11:24 +00:00
6e21f7a929 Arcanization of wgpu core resources (#3626)
Arcanization of wgpu_core resources

---------

Co-authored-by: Elabajaba <Elabajaba@users.noreply.github.com>
Co-authored-by: Niklas Korz <niklas@niklaskorz.de>
Co-authored-by: grovesNL <josh@joshgroves.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: Mauro Gentile <Mauro.Gentile@ubisoft.com>
Co-authored-by: Sludge <96552222+SludgePhD@users.noreply.github.com>
2023-11-20 08:41:52 +01:00
daxpedda 8859310be2 Add more lints (#4598) 2023-11-17 15:59:56 -05:00
daxpedda bec6560e10 Add WasmNotSendSync (#4702) 2023-11-16 19:47:10 -05:00
daxpedda addb1e081f Safe surface creation (#4597) 2023-11-16 16:40:14 -05:00
Andreas ReichandTeodor Tanasoaia f7420511d0 rename/deprecate block_size -> block_copy_size, improve docs (#4647)
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-11-13 19:04:35 +00:00
Nicolas Silva 890825f395 Don't drop command buffers when submitting in wgpu_core (#4660)
Since wgpu's submit API consumes command buffers, they are dropped when submitting via wgpu but not when when using wgpu_core.
2023-11-09 19:00:23 +01:00
Brad Werth 4e65eca1e8 More complete implementation of "lose the device". (#4645)
* More complete implementation of "lose the device".

This provides a way for wgpu-core to specify a callback on "lose the
device". It ensures this callback is called at the appropriate times:
either after device.destroy has empty queues, or on demand from
device.lose.

A test has been added to device.rs.

* Updated CHANGELOG.md.

* Fix conversion to *const c_char.

* Use an allow lint to permit trivial_casts.

* rustfmt changes.
2023-11-08 22:22:18 +01:00
Connor Fitzgerald 7f72c9fc3b Fix GL Push Constant Layout (#4607)
* It verks!

* More tests

* Fixes

* Working multi-stage push constants

* Comments

* Add push constant partial update teste

* Docs

* Update Cargo.toml

* Comments
2023-11-06 07:58:26 -05:00
daxpedda 37fe6a5424 Mark some methods unsafe (#4596) 2023-10-29 23:59:48 -04:00
Kevin Reid e0341c52cf Document nonzero surface size requirement. (#4609) 2023-10-29 23:22:38 -04:00
Adrian Wu b6fa2c536c Fix typo in documentation of QueueWriteBufferView (#4590) 2023-10-27 16:34:37 +00:00
Alphyr 8998b9de87 Remove flume dependency of wgpu (#4585)
* Remove `flume` dependency of `wgpu`

* Add `Exclusive`
2023-10-27 11:23:39 -04:00
4c5a817071 Bump raw window handle to 0.6.0 (#4202)
Co-authored-by: junglie85 <junglie85@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-27 05:24:46 +00:00
Connor Fitzgerald e54289b08b Update Readme 2023-10-26 01:28:27 -04:00
Connor Fitzgerald 543f921639 GPU Test Framework (#3873) 2023-10-19 12:06:42 -04:00
ZoxcandConnor Fitzgerald 2b985e2fad Add WGL context creation and OpenGL support (#4248)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-18 18:40:33 +00:00
ff306d20e0 Add support for bgra8unorm-storage (#4228)
* Add `BGRA8UNORM_STORAGE` extension

* Leave a comment in the backends that don't support bgra8unorm-storage

* Pass the appropriate storage format to naga

* Check for bgra8unorm storage support in the vulkan backend

* Add a test

Co-authored-by: Jinlei Li <jinleili0@outlook.com>
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-10-13 10:07:11 +00:00
Nicolas SilvaandConnor Fitzgerald f95d1c55e3 Expose Instance flags (#4230)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-11 17:39:04 +00:00
Colin Edwards 0f7b530ea8 Add WinUI 3 SwapChainPanel support (#4191) 2023-10-11 13:36:30 -04:00
Teodor Tanasoaia 7d1005faad [WebGPU] validate polygon mode (#4196) 2023-10-04 12:27:27 +00:00
Teodor Tanasoaia fd02a12726 Make GLES optional on Windows & macOS (#4185) 2023-10-03 16:16:24 -04:00
Teodor Tanasoaia 422c636877 Add Rgb10a2Uint format (#4199) 2023-10-03 14:56:21 +02:00
Brad Werth 57f8757fad Add device destroy method (#4163)
Plus tests that ensure that an invalid device behaves correctly.
Mostly a stub implementation otherwise.
2023-09-27 14:34:23 +02:00