[dawn][test] Use backend-specific adapter discovery options
dawn native is always compiled on Linux with OpenGL backend support
enabled. Dawn native's generic GPU enumeration mechanism
(i.e. dawn::native::Instance::DiscoverDefaultAdapters) always queries
all enabled backend adapters. On UNIX systems (non-macOS) with OpenGL
support, Dawn queries the GL driver even though Skia specifically
targets Dawn's Vulkan backend on them.
The OpenGL adapter query in addition to Vulkan queries can put the EGL
driver into a bad state on certain systems (e.g. NVIDIA on AMD). This is
now avoided by using an adapter query that only for the requested
backend and avoiding OpenGL in the Vulkan case.
This CL also fixes:
* A compilation error when the module-scope USE_OPENGL_BACKEND macro is
set to 1.
* A crash that occurs when an error callback is assigned on an
uninitialized wgpu::Device.
Change-Id: Id1af3d43afbabb87dbd705684234f7741ac6288d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/580217
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Arman Uguray <armansito@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
1 file changed