gpu: make requestAdapter callback-based, add waitForAdapter helper

Same rationale as 2c3e13ff4b90886d7f03adb3103abc9dee70b407

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-15 11:02:51 -07:00 committed by Stephen Gutekanst
parent aab99b5474
commit 356e4102cd
5 changed files with 71 additions and 40 deletions

View file

@ -73,7 +73,7 @@ pub fn setup(allocator: std.mem.Allocator) !Setup {
try discoverAdapters(instance, window, backend_type);
// Request an adapter.
const backend_adapter = switch (nosuspend gpu_interface.requestAdapter(&.{
const backend_adapter = switch (gpu_interface.waitForAdapter(&.{
.power_preference = .high_performance,
})) {
.adapter => |v| v,