gpu: make Buffer.bufferMapAsync friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
13058274b0
commit
2b4ba59cc8
2 changed files with 18 additions and 5 deletions
|
|
@ -82,8 +82,8 @@ pub const Adapter = opaque {
|
|||
) callconv(.Inline) void,
|
||||
context: Context,
|
||||
) void {
|
||||
const c_callback = struct {
|
||||
pub fn callback(status: RequestDeviceStatus, device: *Device, message: ?[*:0]const u8, userdata: ?*anyopaque) void {
|
||||
const Helper = struct {
|
||||
pub fn callback(status: RequestDeviceStatus, device: *Device, message: ?[*:0]const u8, userdata: ?*anyopaque) callconv(.C) void {
|
||||
callback(
|
||||
status,
|
||||
device,
|
||||
|
|
@ -92,7 +92,7 @@ pub const Adapter = opaque {
|
|||
);
|
||||
}
|
||||
};
|
||||
Impl.adapterRequestDevice(adapter, descriptor, c_callback, if (Context == void) null orelse context);
|
||||
Impl.adapterRequestDevice(adapter, descriptor, Helper.callback, if (Context == void) null orelse context);
|
||||
}
|
||||
|
||||
pub inline fn reference(adapter: *Adapter) void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue