forked from 1b-agent/opencadstudio-upstream
Add GPU backend probe with automatic fallback for older GPUs
Older GPUs without usable DirectX 12 Feature Level 12_0 or working Vulkan support (e.g. legacy Intel iGPUs and other old parts), and old GLES drivers whose shader compiler rejects iced's own shaders, crash at startup or on the first drawing viewport: StagingBelt aborts in Buffer::get_mapped_range (panic=abort, silent exit) on the DX12 path, and shader compilation fails inside iced's gradient pipeline on the GLES path. Selecting a working backend via WGPU_BACKEND before iced boots avoids both classes. - Probe each candidate backend (Windows: dx12,vulkan,gl; Linux: vulkan,gl) in an isolated --gpu-probe child: device request, staging-style mapped upload, render pipeline creation (its fragment shader reads a private vec4 array, catching old-Mesa compile failures), offscreen render and readback. First fully-passing backend wins; explicit --backend / WGPU_BACKEND / --safe-mode always win, and Windows keeps preferring DX12/Vulkan (#55). - Software adapters (WARP/llvmpipe/SwiftShader) are the last resort before a best-effort GL attempt: slow but alive. - The crash sentinel names the attempted backend so only implicated backends are skipped next launch. - Winning probes report adapter limits; GPUs without shader storage buffers get the packed compatibility renderer automatically, with a startup command-line notice so the switch is never silent.
This commit is contained in:
1 parent
472bb9883d
commit
2b38f798c0
7 files changed
+1105
-15
No files matched your search
+1030
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user