gpu: implement Adapter type / backend type -> name conversion
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f849e03443
commit
5581584717
1 changed files with 22 additions and 0 deletions
|
|
@ -81,6 +81,15 @@ pub const Type = enum(u32) {
|
|||
unknown,
|
||||
};
|
||||
|
||||
pub fn typeName(t: Type) []const u8 {
|
||||
return switch (t) {
|
||||
.discrete_gpu => "Discrete GPU",
|
||||
.integrated_gpu => "Integrated GPU",
|
||||
.cpu => "CPU",
|
||||
.unknown => "Unknown",
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: docs
|
||||
pub const BackendType = enum(u32) {
|
||||
nul,
|
||||
|
|
@ -93,6 +102,19 @@ pub const BackendType = enum(u32) {
|
|||
opengles,
|
||||
};
|
||||
|
||||
pub fn backendTypeName(t: BackendType) []const u8 {
|
||||
return switch (t) {
|
||||
.nul => "Null",
|
||||
.webgpu => "WebGPU",
|
||||
.d3d11 => "D3D11",
|
||||
.d3d12 => "D3D12",
|
||||
.metal => "Metal",
|
||||
.vulkan => "Vulkan",
|
||||
.opengl => "OpenGL",
|
||||
.opengles => "OpenGLES",
|
||||
};
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = hasFeature;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue