gpu: pretranslate @cImport to workaround self-hosted compiler bug
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
80e127b5ae
commit
51932241c1
2 changed files with 2887 additions and 4 deletions
|
|
@ -1,9 +1,18 @@
|
|||
const gpu = @import("main.zig");
|
||||
|
||||
const c = @cImport({
|
||||
@cInclude("dawn/webgpu.h");
|
||||
@cInclude("mach_dawn.h");
|
||||
});
|
||||
const c = if (@import("builtin").zig_backend == .stage1)
|
||||
@cImport({
|
||||
@cInclude("dawn/webgpu.h");
|
||||
@cInclude("mach_dawn.h");
|
||||
})
|
||||
else
|
||||
// HACK: workaround https://github.com/ziglang/zig/issues/12483
|
||||
//
|
||||
// cd gpu/src/
|
||||
// echo '#include <dawn/webgpu.h>' > tmp.c
|
||||
// echo '#include "mach_dawn.h"' >> tmp.c
|
||||
// zig translate-c tmp.c -I ../zig-cache/mach/gpu-dawn/release-777728f/include/ > dawn_webgpu_h.zig
|
||||
@import("dawn_webgpu_h.zig");
|
||||
|
||||
var procs: c.DawnProcTable = undefined;
|
||||
|
||||
|
|
|
|||
2874
gpu/src/dawn_webgpu_h.zig
Normal file
2874
gpu/src/dawn_webgpu_h.zig
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue