diff --git a/gpu/src/dawn.zig b/gpu/src/dawn.zig index e858e201..33438109 100644 --- a/gpu/src/dawn.zig +++ b/gpu/src/dawn.zig @@ -13,7 +13,6 @@ pub const EncoderInternalUsageDescriptor = extern struct { use_internal_usages: bool = false, }; -/// TODO: Can be chained in gpu.Instance.Descriptor pub const InstanceDescriptor = extern struct { chain: ChainedStruct = .{ .next = null, .s_type = .dawn_instance_descriptor }, additional_runtime_search_paths_count: u32 = 0, diff --git a/gpu/src/instance.zig b/gpu/src/instance.zig index f45d4b9b..c0d9dcd8 100644 --- a/gpu/src/instance.zig +++ b/gpu/src/instance.zig @@ -5,10 +5,16 @@ const Adapter = @import("adapter.zig").Adapter; const RequestAdapterOptions = @import("types.zig").RequestAdapterOptions; const RequestAdapterCallback = @import("callbacks.zig").RequestAdapterCallback; const Impl = @import("interface.zig").Impl; +const dawn = @import("dawn.zig"); pub const Instance = opaque { pub const Descriptor = extern struct { - next_in_chain: ?*const ChainedStruct = null, + pub const NextInChain = extern union { + generic: ?*const ChainedStruct, + dawn_instance_descriptor: *const dawn.InstanceDescriptor, + }; + + next_in_chain: NextInChain = .{ .generic = null }, }; pub inline fn createSurface(instance: *Instance, descriptor: *const Surface.Descriptor) *Surface {