diff --git a/libs/gpu-dawn/sdk.zig b/libs/gpu-dawn/sdk.zig index 9418ae23..a1a0672f 100644 --- a/libs/gpu-dawn/sdk.zig +++ b/libs/gpu-dawn/sdk.zig @@ -277,6 +277,9 @@ pub fn Sdk(comptime deps: anytype) type { step.addIncludePath(include_dir); step.addIncludePath(sdkPath("/src/dawn")); + if (isLinuxDesktopLike(step.target_info.target.os.tag)) { + step.linkSystemLibraryName("X11"); + } if (options.metal.?) { step.linkFramework("Metal"); step.linkFramework("CoreGraphics"); diff --git a/libs/gpu/src/adapter.zig b/libs/gpu/src/adapter.zig index 20ac86c1..6067de8a 100644 --- a/libs/gpu/src/adapter.zig +++ b/libs/gpu/src/adapter.zig @@ -1,5 +1,6 @@ const std = @import("std"); const testing = std.testing; +const dawn = @import("dawn.zig"); const ChainedStructOut = @import("types.zig").ChainedStructOut; const Device = @import("device.zig").Device; const FeatureName = @import("types.zig").FeatureName; @@ -27,7 +28,12 @@ pub const Adapter = opaque { }; pub const Properties = extern struct { - next_in_chain: ?*ChainedStructOut = null, + pub const NextInChain = extern union { + generic: ?*const ChainedStructOut, + dawn_adapter_properties_power_preference: *const dawn.AdapterPropertiesPowerPreference, + }; + + next_in_chain: NextInChain = .{ .generic = null }, vendor_id: u32, vendor_name: [*:0]const u8, architecture: [*:0]const u8, diff --git a/libs/gpu/src/buffer.zig b/libs/gpu/src/buffer.zig index 0f5de96a..0d5539af 100644 --- a/libs/gpu/src/buffer.zig +++ b/libs/gpu/src/buffer.zig @@ -1,5 +1,6 @@ const std = @import("std"); const ChainedStruct = @import("types.zig").ChainedStruct; +const dawn = @import("dawn.zig"); const MapModeFlags = @import("types.zig").MapModeFlags; const Impl = @import("interface.zig").Impl; @@ -64,7 +65,12 @@ pub const Buffer = opaque { }; pub const Descriptor = extern struct { - next_in_chain: ?*const ChainedStruct = null, + pub const NextInChain = extern union { + generic: ?*const ChainedStruct, + dawn_buffer_descriptor_error_info_from_wire_client: *const dawn.BufferDescriptorErrorInfoFromWireClient, + }; + + next_in_chain: NextInChain = .{ .generic = null }, label: ?[*:0]const u8 = null, usage: UsageFlags, size: u64, diff --git a/libs/gpu/src/dawn.zig b/libs/gpu/src/dawn.zig index 3f364d3b..e690119a 100644 --- a/libs/gpu/src/dawn.zig +++ b/libs/gpu/src/dawn.zig @@ -60,7 +60,7 @@ pub const TogglesDeviceDescriptor = extern struct { } }; -const AdapterPropertiesPowerPreference = extern struct { +pub const AdapterPropertiesPowerPreference = extern struct { chain: ChainedStructOut = .{ .next = null, .s_type = .dawn_adapter_properties_power_preference, @@ -68,7 +68,7 @@ const AdapterPropertiesPowerPreference = extern struct { power_preference: PowerPreference = .undefined, }; -const BufferDescriptorErrorInfoFromWireClient = extern struct { +pub const BufferDescriptorErrorInfoFromWireClient = extern struct { chain: ChainedStruct = .{ .next = null, .s_type = .dawn_buffer_descriptor_error_info_from_wire_client, diff --git a/libs/gpu/src/types.zig b/libs/gpu/src/types.zig index a70ca249..9a917fa6 100644 --- a/libs/gpu/src/types.zig +++ b/libs/gpu/src/types.zig @@ -533,7 +533,7 @@ pub const Limits = extern struct { min_uniform_buffer_offset_alignment: u32 = limit_u32_undef, min_storage_buffer_offset_alignment: u32 = limit_u32_undef, max_vertex_buffers: u32 = limit_u32_undef, - max_buffer_size: u32 = limit_u32_undef, + max_buffer_size: u64 = limit_u64_undef, max_vertex_attributes: u32 = limit_u32_undef, max_vertex_buffer_array_stride: u32 = limit_u32_undef, max_inter_stage_shader_components: u32 = limit_u32_undef,