core: cleanup sysgpu feature flag logic

* `@import("mach").core.gpu` has been renamed to `@import("mach").gpu`
* `pub const SYSGPUInterface` now has a default value (i.e. you do not need to write it in your main.zig, if you were.)
* You can now check `if (comptime mach.use_sysgpu)` for any conditional code you might have that should only run with sysgpu.

This (old):

```
pub const mach_core_options = core.ComptimeOptions{
    .use_wgpu = false,
    .use_sysgpu = true,
};
```

Has been replaced by this:

```
pub const use_sysgpu = true;
```

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-04-19 20:48:33 -07:00
parent 6a2358baf8
commit 7a1efdaa69
32 changed files with 85 additions and 132 deletions

View file

@ -8,10 +8,9 @@ const renderer = @import("renderer.zig");
pub const App = @This();
pub const mach_core_options = core.ComptimeOptions{
.use_wgpu = false,
.use_sysgpu = true,
};
// Use experimental sysgpu graphics API
pub const use_sysgpu = true;
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
title_timer: core.Timer,