mach: exit if no backend found for adapter

This commit is contained in:
Ali Chraghi 2022-09-03 13:49:06 +04:30 committed by Stephen Gutekanst
parent d96cc72859
commit d8af6740c5

View file

@ -104,6 +104,10 @@ pub const Platform = struct {
// Print which adapter we are going to use. // Print which adapter we are going to use.
var props: gpu.Adapter.Properties = undefined; var props: gpu.Adapter.Properties = undefined;
response.?.adapter.getProperties(&props); response.?.adapter.getProperties(&props);
if (props.backend_type == .nul) {
std.log.err("no backend found for {s} adapter", .{props.adapter_type.name()});
std.process.exit(1);
}
std.debug.print("mach: found {s} backend on {s} adapter: {s}, {s}\n", .{ std.debug.print("mach: found {s} backend on {s} adapter: {s}, {s}\n", .{
props.backend_type.name(), props.backend_type.name(),
props.adapter_type.name(), props.adapter_type.name(),