Commit Graph
1055 Commits
Author SHA1 Message Date
Jan Procházka 5deaef3b67 Add VideoFrame to ExternalImageSource enum (#6170) 2024-08-27 18:05:45 +00:00
Marijn Suijten 690a3fb3fb [wgpu-hal] Upgrade glutin to 0.31 (#6150)
* [wgpu-hal] Upgrade `glutin` to `0.31`

`glutin 0.30` onwards completely refactored its internals to no longer
be reliant on `winit`, as they (by default) have no direct relation
except needing to perform _some_ operations (platform-specific) at
strategic times in window creation and event loop handling.  Most of
that is handled by a new `glutin-winit` introp crate, while the core
`glutin` crate now exclusively focuses on wrapping the various OpenGL
context APIs (CGL, EGL, WGL, ...).

This does result in a little more verbose handling to get the right
`GLDisplay`, `GLConfig`, `GLContext` and `GLSurface`, but gives much
more control and makes all intricacies more explicit.  Most of the
code was copied from `glutin 0.31`'s example crate, with the code for
transparency support removed.

Note that the example doesn't at all handle event loop events properly:
resizes and redraws are not listened to, and mobile-specific surface
events (`Resumed` and `Suspended`) are equally ignored.

* [wgpu-hal] Implement proper `Surface` availability semantics in `raw-gles` example
2024-08-27 13:05:47 -04:00
Jerzy Wilczek a9047c2af5 Change the DropGuard public API to a callback-based one. (#6164)
This patch also unifies the behavior of the the `DropGuard`-ish
constructs in the Vulkan-based implementation.
2024-08-27 16:44:34 +00:00
Imbris fccd2981d0 Ensure glow::Context is current when dropped (#6114)
Cleanup code in glow needs the context to be current (mainly for debug
message callbacks).

See https://docs.rs/glow/0.14.0/glow/trait.HasContext.html#safety
2024-08-27 12:15:41 -04:00
Daniel McNabandMarijn Suijten 685c2133f2 hal: cargo feature to allow using VK_GOOGLE_display_timing unsafely (#6149)
* Expose the raw swapchain from a vulkan `Surface`

* Allow setting the present timing information on hal Vulkan

* Fix clippy without the feature enabled

* CHANGELOG

* Revert inadvertently formatted Cargo.toml

* Move display timing to a feature

* Update the changelog

* Whitespace and doc wording tweaks

* Apply suggestions from code review

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

* Revert inadvertent formatting changes again

* Remove unused qualification

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

* Address review feedback

* Fix flow of sentence and follow intra-doc-link

* Add more docs to `set_next_present_time`, and rename

* Also rename `next_present_times`

* Apply suggestions from code review

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

---------

Co-authored-by: Marijn Suijten <marijns95@gmail.com>
2024-08-27 11:25:04 -04:00
Erich Gubler fac49ee97c chore: work around unused_qualifications from new prelude items in Rust 1.80
`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/).
However, we don't have an MSRV at 1.80 or higher yet. So, let's work
around it by importing these items fully. Since neither `clippy` nor
`rustc` lint against shadowed `prelude` items yet (see also a [proposed
`clippy` lint] for such), that lets us remove the explicit `std::mem::*`
imports later at our leisure.

[proposed `clippy` lint]: https://github.com/rust-lang/rust-clippy/issues/8439
2024-08-23 16:20:34 -04:00
Valaphee The Meerkat b4db97f97b Add HTMLImageElement/ImageData as external source for copying images (#5668)
* Add `HTMLImageElement` as external source for copying images

* Typo
2024-08-20 12:54:24 -04:00
Marijn Suijten a157c3cf4b [wgpu-hal] Migrate d3d12 backend over to windows-rs (#5956)
* windows-rs 0.58

* Clean up suspicious committed allocation workaround

* dx12: Flatten suballocation module
2024-08-20 11:48:37 -04:00
Kornel 222f1ea733 Reduce code size of error handling 2024-08-19 14:38:20 +01:00
Erich Gubler abc56417bb refactor(web): satisfy unused_qualifications (#6121) 2024-08-15 16:56:12 +00:00
Erich Gubler 23e7846400 refactor(hal): satisfy trivial_casts 2024-08-15 14:14:13 +01:00
Erich Gubler 89a64e911d refactor(hal): remove unneeded trivial_casts suppr. 2024-08-15 14:14:13 +01:00
teoxoy 2c31414517 add an Unexpected variant to DeviceError 2024-08-15 13:56:05 +01:00
teoxoy 24134e049f handle all vulkan error variants for each function explicitly 2024-08-15 13:56:05 +01:00
teoxoy e4c5b4760b introduce a new function that handles unexpected vulkan errors that can't be mapped to DeviceError::Lost 2024-08-15 13:56:05 +01:00
teoxoy 8b6450a9ce handle all variants of gpu_descriptor::AllocationError explicitly 2024-08-15 13:56:05 +01:00
teoxoy 7103520bd3 introduce a new function for hal usage errors 2024-08-15 13:56:05 +01:00
teoxoy a0c107f7c8 remove handling of error that is not documented to be returned by vkAllocateMemory 2024-08-15 13:56:05 +01:00
Fionn Langhans 273c2c4b1a Fixed spelling mistake in URL of d3d12 2024-08-14 23:16:58 +02:00
Andreas Reich 3181251577 Core adapter no longer uses any generics 2024-08-14 17:34:11 +02:00
Andreas Reich 04cadfb369 Core's Surface, Instance and Adapter use now dynamic hal types 2024-08-14 17:34:11 +02:00
Andreas Reich 5b9198fd43 introduce DynInstance 2024-08-14 17:34:11 +02:00
Andreas Reich 6f01cbff06 introduce DynAdapter 2024-08-14 17:34:11 +02:00
Andreas Reich 99ffc129eb remove unnecessary debug constraints from Api (handled by Dyn traits) 2024-08-14 17:34:11 +02:00
Andreas Reich 27944debb1 DynCommandEncoder acceleration structure building 2024-08-14 17:34:11 +02:00
Andreas Reich d87aa3635e DynCommandencoder end_encoding, reset_all 2024-08-14 17:34:11 +02:00
Andreas Reich 1a9170e57b DynDevice exit, counters, report 2024-08-14 17:34:11 +02:00
Andreas Reich 9e1f1487b4 DynDevice acceleration structure handling 2024-08-14 17:34:11 +02:00
Andreas Reich 522b98c582 DynDevice wait/capture/pipeline_cache_get_data 2024-08-14 17:34:11 +02:00
Andreas Reich dbf9aea0ba DynDevice fence 2024-08-14 17:34:11 +02:00
Andreas Reich 84c4811f81 DynDevice create/destroy query set 2024-08-14 17:34:11 +02:00
Andreas Reich 4d355bf30e DynDevice pipeline cache 2024-08-14 17:34:11 +02:00
Andreas Reich 3932f8b854 DynDevice create/destroy compute/render pipeline 2024-08-14 17:34:11 +02:00
Andreas Reich ad5c7fe50e DynDevice create/destroy ShaderModule 2024-08-14 17:34:11 +02:00
Andreas Reich 276753f963 DynDevice create/destroy bind group
bindgroup fixup
2024-08-14 17:34:11 +02:00
Andreas Reich 33f57e2305 DynDevice create/destroy pipeline layout 2024-08-14 17:34:11 +02:00
Andreas Reich 1da319f804 DynDevice create/destroy bind group layout 2024-08-14 17:34:11 +02:00
Andreas Reich 05a09338cd DynDevice create/destroy command encoder 2024-08-14 17:34:11 +02:00
Andreas Reich ea0df25d5e DynDevice create/destroy for texture/textureview/sampler 2024-08-14 17:34:11 +02:00
Andreas Reich b599d97243 DynDevice buffer operations 2024-08-14 17:34:11 +02:00
Andreas Reich 72f30a34f5 introduce DynQueue 2024-08-14 17:34:11 +02:00
Andreas Reich 4e5721350f introduce DynSurface 2024-08-14 17:34:11 +02:00
Andreas Reich 70f7641193 impl DynSurfaceTexture for all surface textures 2024-08-14 17:34:11 +02:00
Andreas Reich 1d19a205a5 impl DynFence for all fences 2024-08-14 17:34:11 +02:00
Andreas Reich 3faed2bf52 Device now has to implement DynResource 2024-08-14 17:34:11 +02:00
Andreas Reich df5cc12935 impl DynCommandBuffer 2024-08-14 17:34:11 +02:00
Andreas Reich a9cb7fc855 impl DynShaderModule for all backends 2024-08-14 17:34:11 +02:00
Andreas Reich b4c6741970 add most remaining dyn type traits 2024-08-14 17:34:11 +02:00
Andreas Reich add54f19d8 Introduce DynDevice 2024-08-14 17:34:11 +02:00
Andreas Reich b7e11c76df texture & buffer transitioning always uses DynCommandEncoder now
collateral: ComputePass uses DynCommandEncoder during recording
2024-08-14 17:34:11 +02:00