Skip to content

Commit 373e57f

Browse files
committed
build: switch from vulkan-zig-generated to vulkan-zig
Signed-off-by: Emi <emi@hexops.com>
1 parent 4ea4637 commit 373e57f

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

build.zig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,18 @@ pub fn build(b: *std.Build) !void {
180180
}
181181
if (want_sysgpu) {
182182
linkSysgpu(b, module);
183-
if (b.lazyDependency("vulkan_zig_generated", .{})) |dep| module.addImport("vulkan", dep.module("vulkan-zig-generated"));
183+
if (b.lazyDependency("vulkan_headers", .{})) |vulkan_headers| {
184+
if (b.lazyDependency("vulkan_zig", .{})) |vulkan_zig| {
185+
const registry = vulkan_headers.path("registry/vk.xml");
186+
const vk_gen = vulkan_zig.artifact("vulkan-zig-generator");
187+
const vk_generate_cmd = b.addRunArtifact(vk_gen);
188+
vk_generate_cmd.addFileArg(registry);
189+
const vulkan_mod = b.addModule("vulkan", .{
190+
.root_source_file = vk_generate_cmd.addOutputFileArg("vk.zig"),
191+
});
192+
module.addImport("vulkan", vulkan_mod);
193+
}
194+
}
184195
if (target.result.isDarwin()) {
185196
if (b.lazyDependency("mach_objc", .{
186197
.target = target,

build.zig.zon

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@
4242
.hash = "1220c30350b7b45f4623aeaf1c5b2c9ceda5d626de2ff5a3f2f54e4a68a80358426b",
4343
.lazy = true,
4444
},
45-
.vulkan_zig_generated = .{
46-
.url = "https://pkg.hexops.org/pkg/hexops/vulkan-zig-generated/4134f910302a71731d8d32c91cfc1bc914e6d26b.tar.gz",
47-
.hash = "12208333c8b3551908b66b8a421e7127bdf0c1806063836576283860eff99c99c521",
45+
.vulkan_zig = .{
46+
.url = "https://pkg.hexops.org/pkg/thirdparty/vulkan-zig/06dae6c9201863837a92064e2e7814aa71064067.tar.gz",
47+
.hash = "1220edeb3fc7dfc40e6fde705a108edce0a3cc76d165a7c9919d1fb037eccec43372",
48+
.lazy = true,
49+
},
50+
.vulkan_headers = .{
51+
.url = "https://pkg.hexops.org/pkg/thirdparty/vulkan-headers/19935fe710d147d48b2dd5f5071392346347450b.tar.gz",
52+
.hash = "1220a7e73d72a0d56bc2a65f9d8999a7c019e42260a0744c408d1cded111bc205e10",
4853
.lazy = true,
4954
},
5055
.linux_audio_headers = .{

0 commit comments

Comments
 (0)