d3d12: Gallium d3d12 backend performance is slow
System information
- System: Kernel: 5.10.16.3-microsoft-standard-WSL2 x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: N/A dm: N/A Distro: Ubuntu 21.04 (Hirsute Hippo)
- CPU: Info: Quad Core model: Intel Core i7-7820HQ bits: 64 type: MT MCP arch: Kaby Lake rev: 9 L2 cache: 8 MiB flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 46463 Speed: 2904 MHz min/max: N/A Core speeds (MHz): 1: 2904 2: 2904 3: 2904 4: 2904 5: 2904 6: 2904 7: 2904 8: 2904
- Graphics: Device-1: Microsoft driver: dxgkrnl v: N/A bus ID: 91a5:00:00.0 chip ID: 1414:008e Device-2: Microsoft driver: dxgkrnl v: N/A bus ID: b60b:00:00.0 chip ID: 1414:008e Display: wayland server: Microsoft Corporation X.org 1.20.11 driver: loaded: dxgkrnl note: n/a (using device driver) resolution: 1920x1080~60Hz s-dpi: 96 OpenGL: renderer: D3D12 (NVIDIA Quadro M1200) v: 3.3 Mesa 21.0.3 - kisak-mesa PPA compat-v: 3.1 direct render: Yes
The NVIDIA driver that I've used is 470.14 which supports the GPU acceleration for WSL2. The windows insider build is 21370.
Describe the issue
Using WSL2 on Windows, the D3D12 backend performs worse compared to software rendering backend. I've compiled https://github.com/mapbox/mapbox-gl-native glfw demo app. At this location: --lat="52.495300" --lon="13.356200" --zoom="10.768600" --bearing "-0.000000", with D3D12 backend, I've got around 8 FPS for a window size 1024x768. When I use LIBGL_ALWAYS_SOFTWARE=1 to select the llvmpipe backend, the FPS is at around 30. I've also tried the "Valley" benchmark demo from https://benchmark.unigine.com/. it runs only at 2-3 FPS for full screen resolution ( 1920x1080 ). The demo on native windows runs normally at 40-60FPS.
Please also refer to this discussion that I've created in WSLg project's discussion forum: https://github.com/microsoft/wslg/discussions/146
Regression
Since the D3D12 backend is quite new, I don't think it's a regression.