diff --git a/build.zig.zon b/build.zig.zon index d8f40f47..716d99e6 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -28,8 +28,8 @@ .hash = "1220db6845ce34743ae2a1ab0222efc942496adde2736c20e3443d4fde4ef64b11b9", }, .mach_gpu = .{ - .url = "https://pkg.machengine.org/mach-gpu/f60434e10a9e8d0b6dc5419960267188c960f5ec.tar.gz", - .hash = "122058c8775820ff0b1f6feb7373364abe1182f5f72ca4d0830d13d861c08a246179", + .url = "https://pkg.machengine.org/mach-gpu/528dad0823dafeae5d474c88cc658b091bf2e605.tar.gz", + .hash = "1220fe2e555ca66741539bc0f97769b2513c5e609c968d27eb8997f577a1d195f048", }, .mach_glfw = .{ .url = "https://pkg.machengine.org/mach-glfw/26e8af73d7d4fbdac3ff60492c44294fc0d139b7.tar.gz", diff --git a/examples/core-custom-entrypoint/main.zig b/examples/core-custom-entrypoint/main.zig index f795b772..07805b19 100644 --- a/examples/core-custom-entrypoint/main.zig +++ b/examples/core-custom-entrypoint/main.zig @@ -9,8 +9,6 @@ pub const modules = .{ Game, }; -pub const GPUInterface = mach.core.wgpu.dawn.Interface; - pub fn main() !void { // Initialize mach.Core try mach.core.initModule(); diff --git a/examples/custom-renderer/main.zig b/examples/custom-renderer/main.zig index d9773352..07c27a5d 100644 --- a/examples/custom-renderer/main.zig +++ b/examples/custom-renderer/main.zig @@ -11,8 +11,6 @@ pub const modules = .{ Game, }; -pub const GPUInterface = mach.core.wgpu.dawn.Interface; - // TODO: move this to a mach "entrypoint" zig module pub fn main() !void { // Initialize mach core diff --git a/src/core/platform/glfw/Core.zig b/src/core/platform/glfw/Core.zig index afac09d2..3ac53a53 100644 --- a/src/core/platform/glfw/Core.zig +++ b/src/core/platform/glfw/Core.zig @@ -136,7 +136,10 @@ pub fn init( input: *Frequency, options: Options, ) !void { - if (!@import("builtin").is_test and mach_core.options.use_wgpu) _ = mach_core.wgpu.Export(@import("root").GPUInterface); + if (!@import("builtin").is_test and mach_core.options.use_wgpu) _ = mach_core.wgpu.Export(blk: { + if (@hasDecl(@import("root"), "GPUInterface")) break :blk @import("root").GPUInterface; + break :blk mach_core.wgpu.dawn.Interface; + }); if (!@import("builtin").is_test and mach_core.options.use_sysgpu) _ = mach_core.sysgpu.sysgpu.Export(@import("root").SYSGPUInterface); const backend_type = try detectBackendType(allocator); diff --git a/src/core/platform/x11/Core.zig b/src/core/platform/x11/Core.zig index c418b239..cada992b 100644 --- a/src/core/platform/x11/Core.zig +++ b/src/core/platform/x11/Core.zig @@ -299,7 +299,10 @@ pub fn init( input: *Frequency, options: Options, ) !void { - if (!@import("builtin").is_test and mach_core.options.use_wgpu) _ = mach_core.wgpu.Export(@import("root").GPUInterface); + if (!@import("builtin").is_test and mach_core.options.use_wgpu) _ = mach_core.wgpu.Export(blk: { + if (@hasDecl(@import("root"), "GPUInterface")) break :blk @import("root").GPUInterface; + break :blk mach_core.wgpu.dawn.Interface; + }); if (!@import("builtin").is_test and mach_core.options.use_sysgpu) _ = mach_core.sysgpu.sysgpu.Export(@import("root").SYSGPUInterface); const libx11 = try LibX11.load();