{gpu,gpu-dawn}: add X11 linkage back; update to latest WebGPU API

This commit is contained in:
Ali Chraghi 2023-01-14 19:20:41 +03:30 committed by Stephen Gutekanst
parent 8a15fcd694
commit 9f6020e545
5 changed files with 20 additions and 5 deletions

View file

@ -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");

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,