mach: update callback context ordering

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-12 00:29:11 -07:00 committed by Stephen Gutekanst
parent 58600faa0d
commit 852d232335

View file

@ -6,7 +6,7 @@ const objc = @cImport({
@cInclude("objc/message.h"); @cInclude("objc/message.h");
}); });
pub inline fn printUnhandledErrorCallback(typ: gpu.ErrorType, message: [*:0]const u8, _: void) void { pub inline fn printUnhandledErrorCallback(_: void, typ: gpu.ErrorType, message: [*:0]const u8) void {
switch (typ) { switch (typ) {
.validation => std.debug.print("gpu: validation error: {s}\n", .{message}), .validation => std.debug.print("gpu: validation error: {s}\n", .{message}),
.out_of_memory => std.debug.print("gpu: out of memory: {s}\n", .{message}), .out_of_memory => std.debug.print("gpu: out of memory: {s}\n", .{message}),
@ -51,10 +51,10 @@ pub const RequestAdapterResponse = struct {
}; };
pub inline fn requestAdapterCallback( pub inline fn requestAdapterCallback(
context: *?RequestAdapterResponse,
status: gpu.RequestAdapterStatus, status: gpu.RequestAdapterStatus,
adapter: *gpu.Adapter, adapter: *gpu.Adapter,
message: ?[*:0]const u8, message: ?[*:0]const u8,
context: *?RequestAdapterResponse,
) void { ) void {
context.* = RequestAdapterResponse{ context.* = RequestAdapterResponse{
.status = status, .status = status,