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:
parent
aab99b5474
commit
356e4102cd
5 changed files with 71 additions and 40 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue