Commit Graph
7154 Commits
Author SHA1 Message Date
Connor Fitzgerald 9ca3e936db Ord for Id (#5176) 2024-02-29 16:02:45 -05:00
Brad Werth e029858a18 Call device lost callback when it is replaced, or when the global is dropped. (#5168)
This fixes two cases where a DeviceLostClosureC might not be consumed
before it is dropped, which is a requirement:

1) When the closure is replaced, this ensures the to-be-dropped closure
is invoked.
2)  When the global is dropped, this ensures that the closure is invoked
before it is dropped.

The first of these two cases is tested in a new test,
DEVICE_LOST_REPLACED_CALLBACK. The second case has a stub,
always-skipped test, DROPPED_GLOBAL_THEN_DEVICE_LOST. The test is
always-skipped because there does not appear to be a way to drop the
global from within a test. Nor is there any other way to reach
Device.prepare_to_die without having first dropping the device.
2024-02-29 15:56:37 -05:00
Okko Hakola 446a3dcdbf [d3d12] Avoid panic on instance drop (#5134) 2024-02-29 15:53:31 -05:00
Connor Fitzgerald b8a8ff6e44 Versions v0.19.1 wgpu-hal-v0.19.1 wgpu-v0.19.1 2024-01-21 18:38:30 -05:00
Connor Fitzgerald 6e95491c9d Update changelog 2024-01-21 18:35:17 -05:00
i509VCBandConnor Fitzgerald ec48ee3ba6 Document Wayland specifics related to SurfaceTexture::present (#5093)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-01-21 18:20:39 -05:00
Lucas Kent f9454d1565 Error on missing web_sys_unstable_apis (#5104) 2024-01-21 18:20:21 -05:00
Imbris e1481b656a Make sure to unset current context in wgl Surface::configure/present (#5087) 2024-01-21 18:20:16 -05:00
Teodor Tanasoaia c094e625d0 [d3d12] use plane 1 for stencil only views (#5100)
* [d3d12] use plane 1 for stencil only views

* add test

* skip stencil only view creation on WebGL
2024-01-21 18:20:02 -05:00
Nick a0db2a2355 Make sure to copy all of the buffers into the resource array for dx12. (#5091)
* Make sure to copy all of the buffers into the resource array for dx12.

Fixes #5088. Even though we're telling DX12 that the maximum frame latency should be our non-padded value, the swap chain may request any of the buffers allocated to it.

* Up the maximum frame latency on the DX12 backend to allow a larger range.
2024-01-21 18:19:54 -05:00
Nicolas Silva ba74217c89 d3d12: Null check the out ComPtr of a few creation functions (#5096)
My understanding is that we shouldn't need to (The d3d12 docs aren't very specific about that), but we have evidence that these functions sometimes leave the resource pointer set to null without returning an error.
2024-01-21 18:19:45 -05:00
Connor Fitzgerald 484457d959 Fix wgpu-hal build wgpu-info-v0.19.0 v0.19.0 wgpu-hal-v0.19.0 wgpu-v0.19.0 wgpu-core-v0.19.0 2024-01-17 15:23:50 -05:00
Connor Fitzgerald 7eac4cec5b Fix naga release naga-v0.19.0 naga-cli-v0.19.0 2024-01-17 14:47:13 -05:00
Connor Fitzgerald 8b2098bd4e Release 0.19 (#5082) d3d12-v0.19.0 wgpu-types-v0.19.0 2024-01-17 14:42:11 -05:00
Andreas ReichandConnor Fitzgerald 4c18e283d1 polish changelog for upcoming release (#5078)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-01-17 18:24:43 +00:00
Andreas ReichandEmil Ernerfeldt b8f27c7284 Expose maximum_frame_latency (#4899)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-17 12:46:34 -05:00
Connor Fitzgerald 2e38187954 Re-export public dependencies (#5063) 2024-01-16 19:21:51 +00:00
dependabot[bot]andAndreas Reich 6c86b55764 Bump Swatinem/rust-cache from 2.7.1 to 2.7.3 (#5060)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-01-16 11:37:27 -05:00
John-John Tedro 90b078f037 Improve ergonomics of gfx_select! (#5069) 2024-01-16 11:15:56 +01:00
Nicolas Silva 445fa6019b d3d12: Propagate descriptor heap and handle allocation errors (#5065) 2024-01-15 15:43:30 +00:00
Andreas Reichanddaxpedda 1da093f7d6 Fix cases in which instance creation may not create any context (#5059)
* Fix cases in which instance creation may not create any context

* split condition steps on picking webgpu instance

* comment formulation fix on backend availability

Co-authored-by: daxpedda <daxpedda@gmail.com>

---------

Co-authored-by: daxpedda <daxpedda@gmail.com>
2024-01-15 12:16:23 +01:00
dependabot[bot] c5a0b0b7b4 Bump the patch-updates group with 12 updates (#5061)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-14 23:48:30 -05:00
Andreas Reich 7774f31021 Allow WebGPU & WebGL in same wasm and detect WebGPU availability (#5044)
* Rename backends: web -> webgpu, direct -> wgpu_core

* rename context objects for web & core

* allow webgpu & webgl features side-by-side

* make sure webgl ci doesn't use webgpu

* update any_backend_feature_enabled

* add panicing generate_report method for compatibility

* RequestDeviceErrorKind::Web rename, fixup various cfg attributes

* automatic webgpu support detection

* changelog entry

* fix emscripten

* fix weird cfg, fix comment typo

* remove try_generate_report again

* Make get_mapped_range_as_array_buffer WebGPU only again
2024-01-14 09:45:52 +00:00
Brad Werth f89bd3b978 Make DeviceLostClosure.from_c consume the closure before dropping it. (#5032)
This clarifies that the Rust and C-style callbacks/closures need to be
consumed (not called) before they are dropped. It also makes the from_c
function consume the param closure so that it can be dropped without
panicking.

It also relaxes the restriction that the callback/closure can only be
called once.
2024-01-14 02:53:40 -05:00
daxpedda 580340f2d3 Add cfg_aliases to wgpu-core and wgpu-hal (#5055) 2024-01-14 00:59:59 -05:00
Connor Fitzgerald 552f06da2f Fix DX12 Wait with Timeout (#5052) 2024-01-13 15:50:32 -05:00
Connor FitzgeraldandAndreas Reich ad625f433f Convert Tests to Use Async Poll (#5053)
* Convert Tests to Use Async Poll

* Update examples/src/repeated_compute/mod.rs

Co-authored-by: Andreas Reich <r_andreas2@web.de>

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-01-13 17:34:51 +00:00
Connor Fitzgerald 5fd7d228ad Add proper timeouts to CI/nextest (#5051) 2024-01-13 12:26:55 +01:00
Nicolas Silva 376d901d1e Triage suspected resources after triaging submissions (#5050) 2024-01-12 13:19:19 -05:00
Nicolas Silva 11c29c825f Prevent a few integer overflows (#5042)
* Prevent a few integer overflows

* Add a changelog entry

* use u64
2024-01-12 16:23:23 +01:00
Andreas Reich 4fd4a7142e Unify surface creation by introducing new SurfaceTarget enum (#4984) 2024-01-11 22:24:01 -05:00
Nicolas Silva bc65d84cdb Remove the Destroyed state from Storage (#4970)
* Remove the Destroyed state from Storage

It used to be how we handled destroying buffers and textures but we moved to different approach.

* Explicit check for destroyed textures/buffers in a few entry points

This used to be checked automatically when getting the resource from the registry, but has to be done manually now that we track we track the destroyed state in the resources.
2024-01-11 10:45:12 +00:00
Nicolas Silva b30c0c2e00 Remove the free_resources tracker (#5037) 2024-01-11 09:41:09 +00:00
Nicolas Silva c90f43bc2a Move the trace recording of destroy events out of triage_resources (#5036) 2024-01-11 00:48:25 -05:00
Connor Fitzgerald 2512b2dae1 Pin rust-cache-version (#5040) 2024-01-11 01:57:51 +00:00
dependabot[bot] 8c1658f28f Bump the patch-updates group with 11 updates (#5039)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 19:38:11 -05:00
Connor Fitzgerald cf01592016 Dependabot Improvements (#5035) 2024-01-10 17:57:03 -05:00
Connor Fitzgerald f7695b360b Add test -> check Dependency (#5033) 2024-01-10 17:56:46 -05:00
Nicolas Silva f27bb443c1 Don't crash if a texture is destroyed before queue submission (#5028) 2024-01-10 14:36:02 +01:00
dependabot[bot] c367adf3bf Bump getrandom from 0.2.11 to 0.2.12 (#5030)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 02:51:31 +00:00
Nicolas Silva 4400a58470 Fix a bounds check in remove_abandoned (#5024) 2024-01-09 11:24:18 -05:00
Nicolas Silva 37755b6985 Validate that a binding offset fits in the buffer 2024-01-09 16:07:47 +01:00
Nicolas Silva 58fe7eac48 Don't case the dynamic offsets count to u8 (#5026) 2024-01-09 15:41:39 +01:00
Nicolas Silva 1bc71eb8b2 Validate max_vertex_buffers in render bundles. (#5025) 2024-01-09 15:41:24 +01:00
Jim Blandy 8af6975d5e Prefer Arc::into_inner over Arc::try_unwrap. (#5018) 2024-01-08 19:24:33 -05:00
Jim Blandy a24bdbaa25 [wgpu-core] Minor doc fixes for initialization tracking. (#5017) 2024-01-08 16:46:57 -05:00
Connor Fitzgerald a01ff0741c Re-Enable Mac CI (#5015) 2024-01-08 16:12:57 -05:00
Nicolas Silva c6eea50b04 Track the actual size of the buffer for memory init (#5014) 2024-01-08 17:24:09 +01:00
Patryk Wychowaniec e7c7017d2e [naga wgsl-in] Fix parsing break ifs
Closes https://github.com/gfx-rs/wgpu/issues/4982.
2024-01-08 10:50:38 +01:00
Connor Fitzgerald a2dced12b3 Disable naga-cli's docs 2024-01-08 08:48:13 +01:00