mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
* 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>
Structure
For the simplest examples without using any helping code (see framework.rs here), check out:
hellofor printing adapter informationhello-trianglefor graphics and presentationhello-computefor pure computing
Notably, capture example shows rendering without a surface/window. It reads back the contents and saves them to a file.
All the examples use WGSL shaders unless specified otherwise.
All framework-based examples render to the window and are reftested against the screenshot in the directory.
Feature matrix
| Feature | boids | bunnymark | cube | mipmap | msaa-line | shadow | skybox | texture-arrays | water | conservative-raster |
|---|---|---|---|---|---|---|---|---|---|---|
| vertex attributes | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | |||
| instancing | ⭐ | |||||||||
| lines and points | ⭐ | ⭐ | ||||||||
| dynamic buffer offsets | ⭐ | ⭐ | ||||||||
| implicit layout | ⭐ | |||||||||
| sampled color textures | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ⭐ | ||
| storage textures | ⭐ | |||||||||
| binding array | ⭐ | |||||||||
| comparison samplers | ⭐ | |||||||||
| subresource views | ⭐ | ⭐ | ||||||||
| cubemaps | ⭐ | |||||||||
| multisampling | ⭐ | |||||||||
| off-screen rendering | ⭐ | ⭐ | ⭐ | |||||||
| stencil testing | ||||||||||
| depth testing | ⭐ | ⭐ | ⭐ | |||||||
| depth biasing | ⭐ | |||||||||
| read-only depth | ⭐ | |||||||||
| blending | ⭐ | ⭐ | ⭐ | |||||||
| render bundles | ⭐ | ⭐ | ||||||||
| compute passes | ⭐ | |||||||||
| error scopes | ⭐ | |||||||||
| optional extensions | ⭐ | |||||||||
| - SPIR-V shaders | ⭐ | |||||||||
| - binding indexing | ⭐ | |||||||||
| - push constants | ⭐ | |||||||||
| - depth clamping | ⭐ | |||||||||
| - compressed textures | ⭐ | |||||||||
| - polygon mode | ⭐ | |||||||||
| - queries | ⭐ | |||||||||
| - conservative rasterization | ⭐ | |||||||||
| integrations | ||||||||||
| - staging belt | ⭐ | |||||||||
| - typed arena | ||||||||||
| - obj loading | ⭐ |
Hacking
You can record an API trace any of the framework-based examples by starting them as:
mkdir -p trace && WGPU_TRACE=trace cargo run --features trace --example <example-name>