gpu: add Adapter.Type

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-10 21:15:15 -07:00 committed by Stephen Gutekanst
parent 7d2ecdf197
commit af9c01d851
2 changed files with 16 additions and 8 deletions

View file

@ -1,13 +1,5 @@
typedef uint32_t WGPUFlags;
typedef enum WGPUAdapterType {
WGPUAdapterType_DiscreteGPU = 0x00000000,
WGPUAdapterType_IntegratedGPU = 0x00000001,
WGPUAdapterType_CPU = 0x00000002,
WGPUAdapterType_Unknown = 0x00000003,
WGPUAdapterType_Force32 = 0x7FFFFFFF
} WGPUAdapterType;
typedef enum WGPUAddressMode {
WGPUAddressMode_Repeat = 0x00000000,
WGPUAddressMode_MirrorRepeat = 0x00000001,

View file

@ -1 +1,17 @@
ptr: *anyopaque,
pub const Type = enum(u32) {
discrete_gpu,
integrated_gpu,
cpu,
unknown,
};
pub fn typeName(t: Type) []const u8 {
return switch (t) {
.discrete_gpu => "Discrete GPU",
.integrated_gpu => "Integrated GPU",
.cpu => "CPU",
.unknown => "Unknown",
};
}