gpu: make Device.setLoggingCallback friendlier

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-31 13:30:51 -07:00 committed by Stephen Gutekanst
parent 6f2f7056b7
commit 29cd383f0e
6 changed files with 22 additions and 15 deletions

View file

@ -100,10 +100,10 @@ pub const Buffer = opaque {
) void {
const Helper = struct {
pub fn callback(status: MapAsyncStatus, userdata: ?*anyopaque) callconv(.C) void {
callback(status, if (Context == void) {} orelse @ptrCast(Context, userdata));
callback(status, if (Context == void) {} else @ptrCast(Context, userdata));
}
};
Impl.bufferMapAsync(buffer, mode, offset, size, Helper.callback, if (Context == void) null orelse context);
Impl.bufferMapAsync(buffer, mode, offset, size, Helper.callback, if (Context == void) null else context);
}
pub inline fn setLabel(buffer: *Buffer, label: [*:0]const u8) void {