wgpu/wgpu-hal
Dmitry Sharshakov 70db03dc99
Use EGL surfaceless platform when windowing system is not found (#2339)
* Use EGL surfaceless platform when windowing system is not found

Falling back to egl::DEFAULT_DISPLAY usually results in X11 EGL platform being picked and then rejected because of unavailability on a head/GPU-less system. EGL_PLATFORM_SURFACELESS_MESA works with both radeonsi and llvmpipe/swrast when Xorg/Wayland sockets are being hidden from application. Needs to be tested in a truly GPU-less environment such as CI it is required to run in. Addresses #1551

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Set backend for capture by environment variables

Useful for testing surfaceless

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Check for EGL_MESA_platform_surfaceless extension before using surfaceless platform

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Format

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Unify types for GLES config tiers

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Remove red.png

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Enable GL backend for CI

* Bump outliers count for skybox_etc2 due to llvmpipe test (102)

* Add SURFACE_TYPE PBUFFER_BIT requirement to off-screen surface tier

* Re-nix GL Backend on CI

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-02-19 05:21:05 +00:00
..
examples feature = emscripten, compability fixes for wgpu-native (#2450) 2022-02-07 14:58:27 -05:00
src Use EGL surfaceless platform when windowing system is not found (#2339) 2022-02-19 05:21:05 +00:00
Cargo.toml Update dev deps (#2493) 2022-02-18 23:24:18 -05:00
README.md Address review notes 2021-06-17 14:18:30 -04:00

wgpu-hal is an explicit low-level GPU abstraction powering wgpu-core. It's a spiritual successor to gfx-hal, but with reduced scope, and oriented towards WebGPU implementation goals.

It has no overhead for validation or tracking, and the API translation overhead is kept to the bare minimum by the design of WebGPU. This API can be used for resource-demanding applications and engines.

Usage notes

All of the API is unsafe. Documenting the exact safety requirements for the state and function arguments is desired, but will likely be incomplete while the library is in early development.

The returned errors are only for cases that the user can't anticipate, such as running out-of-memory, or losing the device. For the counter-example, there is no error for mapping a buffer that's not mappable. As the buffer creator, the user should already know if they can map it.

The API accept iterators in order to avoid forcing the user to store data in particular containers. The implementation doesn't guarantee that any of the iterators are drained, unless stated otherwise by the function documentation. For this reason, we recommend that iterators don't do any mutating work.

Debugging

Most of the information in https://github.com/gfx-rs/wgpu/wiki/Debugging-wgpu-Applications still applies to this API, with an exception of API tracing/replay functionality, which is only available in wgpu-core.