gpu: improve compatibility with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-19 20:42:53 -07:00
parent 8ec53c7446
commit ca028ea038
6 changed files with 145 additions and 60 deletions

View file

@ -31,11 +31,18 @@ const Impl = @import("interface.zig").Impl;
const dawn = @import("dawn.zig");
pub const Device = opaque {
pub const LostCallback = fn (
reason: LostReason,
message: [*:0]const u8,
userdata: ?*anyopaque,
) callconv(.C) void;
pub const LostCallback = if (@import("builtin").zig_backend == .stage1)
fn (
reason: LostReason,
message: [*:0]const u8,
userdata: ?*anyopaque,
) callconv(.C) void
else
*const fn (
reason: LostReason,
message: [*:0]const u8,
userdata: ?*anyopaque,
) callconv(.C) void;
pub const LostReason = enum(u32) {
undef = 0x00000000,