gpu: translate Adapter.Properties

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-14 23:42:26 -07:00 committed by Stephen Gutekanst
parent 14ff1f684b
commit 425eb81019
2 changed files with 13 additions and 12 deletions

View file

@ -1,15 +1,3 @@
typedef struct WGPUAdapterProperties {
WGPUChainedStructOut * nextInChain;
uint32_t vendorID;
char const * vendorName;
char const * architecture;
uint32_t deviceID;
char const * name;
char const * driverDescription;
WGPUAdapterType adapterType;
WGPUBackendType backendType;
} WGPUAdapterProperties;
typedef struct WGPUBindGroupEntry {
WGPUChainedStruct const * nextInChain;
uint32_t binding;

View file

@ -1,4 +1,5 @@
const testing = @import("std").testing;
const ChainedStructOut = @import("types.zig").ChainedStructOut;
ptr: *anyopaque,
@ -18,6 +19,18 @@ pub const Type = enum(u32) {
}
};
pub const Properties = extern struct {
next_in_chain: *ChainedStructOut,
vendor_id: u32,
vendor_name: [*:0]const u8,
architecture: [*:0]const u8,
device_id: u32,
name: [*:0]const u8,
driver_description: [*:0]const u8,
adapter_type: Type,
backend_type: Type,
};
test "Adapter.Type name" {
try testing.expectEqualStrings("Discrete GPU", Type.discrete_gpu.name());
}