gpu: make ctx parameters in callbacks always first

This matches the order of context parameters always being first in the Zig stdlib
with e.g. sorting and similar places where a context parameter exists.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-12 00:14:32 -07:00 committed by Stephen Gutekanst
parent 7f8c279cbc
commit 58600faa0d
7 changed files with 22 additions and 22 deletions

View file

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