Skip to content

Commit dd220ea

Browse files
- Updated to zig 0.15.0
The library has syntax updated to the lastest zig version; however, because of the usingnamespace update, this might requires people who use emscripten to confirm the validity of the new implementation.
1 parent 96f3ce2 commit dd220ea

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/wgpu.zig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,62 +1273,62 @@ pub const CreateComputePipelineAsyncCallback = *const fn (
12731273
pipeline: ComputePipeline,
12741274
message: ?[*:0]const u8,
12751275
userdata: ?*anyopaque,
1276-
) callconv(.C) void;
1276+
) callconv(.c) void;
12771277

12781278
pub const CreateRenderPipelineAsyncCallback = *const fn (
12791279
status: CreatePipelineAsyncStatus,
12801280
pipeline: RenderPipeline,
12811281
message: ?[*:0]const u8,
12821282
userdata: ?*anyopaque,
1283-
) callconv(.C) void;
1283+
) callconv(.c) void;
12841284

12851285
pub const ErrorCallback = *const fn (
12861286
err_type: ErrorType,
12871287
message: ?[*:0]const u8,
12881288
userdata: ?*anyopaque,
1289-
) callconv(.C) void;
1289+
) callconv(.c) void;
12901290

12911291
pub const LoggingCallback = *const fn (
12921292
log_type: LoggingType,
12931293
message: ?[*:0]const u8,
12941294
userdata: ?*anyopaque,
1295-
) callconv(.C) void;
1295+
) callconv(.c) void;
12961296

12971297
pub const DeviceLostCallback = *const fn (
12981298
reason: DeviceLostReason,
12991299
message: ?[*:0]const u8,
13001300
userdata: ?*anyopaque,
1301-
) callconv(.C) void;
1301+
) callconv(.c) void;
13021302

13031303
pub const RequestAdapterCallback = *const fn (
13041304
status: RequestAdapterStatus,
13051305
adapter: Adapter,
13061306
message: ?[*:0]const u8,
13071307
userdata: ?*anyopaque,
1308-
) callconv(.C) void;
1308+
) callconv(.c) void;
13091309

13101310
pub const RequestDeviceCallback = *const fn (
13111311
status: RequestDeviceStatus,
13121312
device: Device,
13131313
message: ?[*:0]const u8,
13141314
userdata: ?*anyopaque,
1315-
) callconv(.C) void;
1315+
) callconv(.c) void;
13161316

13171317
pub const BufferMapCallback = *const fn (
13181318
status: BufferMapAsyncStatus,
13191319
userdata: ?*anyopaque,
1320-
) callconv(.C) void;
1320+
) callconv(.c) void;
13211321

13221322
pub const QueueWorkDoneCallback = *const fn (
13231323
status: QueueWorkDoneStatus,
13241324
userdata: ?*anyopaque,
1325-
) callconv(.C) void;
1325+
) callconv(.c) void;
13261326

13271327
pub const CompilationInfoCallback = *const fn (
13281328
status: CompilationInfoRequestStatus,
13291329
info: *const CompilationInfo,
13301330
userdata: ?*anyopaque,
1331-
) callconv(.C) void;
1331+
) callconv(.c) void;
13321332

13331333
pub const Adapter = *opaque {
13341334
pub fn createDevice(adapter: Adapter, descriptor: DeviceDescriptor) Device {
@@ -2238,7 +2238,7 @@ pub const Queue = *opaque {
22382238
queue: Queue,
22392239
callback: QueueWorkDoneCallback,
22402240
userdata: ?*anyopaque,
2241-
) callconv(.C) void,
2241+
) callconv(.c) void,
22422242
.{ .name = "wgpuQueueOnSubmittedWorkDone" },
22432243
);
22442244
oswd(queue, callback, userdata);
@@ -2249,7 +2249,7 @@ pub const Queue = *opaque {
22492249
signal_value: u64,
22502250
callback: QueueWorkDoneCallback,
22512251
userdata: ?*anyopaque,
2252-
) callconv(.C) void,
2252+
) callconv(.c) void,
22532253
.{ .name = "wgpuQueueOnSubmittedWorkDone" },
22542254
);
22552255
oswd(queue, signal_value, callback, userdata);

src/zgpu.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,14 +1855,14 @@ fn formatToShaderFormat(format: wgpu.TextureFormat) []const u8 {
18551855
};
18561856
}
18571857

1858-
usingnamespace if (emscripten) struct {
1859-
// Missing symbols
1860-
var wgpuDeviceTickWarnPrinted: bool = false;
1861-
pub export fn wgpuDeviceTick() void {
1858+
var wgpuDeviceTickWarnPrinted: bool = false;
1859+
1860+
pub fn wgpuDeviceTick() void {
1861+
if (emscripten) {
18621862
if (!wgpuDeviceTickWarnPrinted) {
18631863
std.log.warn("wgpuDeviceTick(): this fn should be avoided! RequestAnimationFrame() is advised for smooth rendering in browser.", .{});
18641864
wgpuDeviceTickWarnPrinted = true;
18651865
}
18661866
emscripten_sleep(1);
18671867
}
1868-
} else struct {};
1868+
}

0 commit comments

Comments
 (0)