gpu: note how to use @tagName with enums
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
b6d36ed714
commit
2d815daca2
1 changed files with 6 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
const std = @import("std");
|
||||||
|
|
||||||
pub const Feature = enum(u32) {
|
pub const Feature = enum(u32) {
|
||||||
depth24_unorm_stencil8 = 0x00000002,
|
depth24_unorm_stencil8 = 0x00000002,
|
||||||
depth32_float_stencil8 = 0x00000003,
|
depth32_float_stencil8 = 0x00000003,
|
||||||
|
|
@ -14,14 +16,16 @@ pub const Feature = enum(u32) {
|
||||||
dawn_native = 0x000003ec,
|
dawn_native = 0x000003ec,
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: add featureName stringer method
|
|
||||||
|
|
||||||
const AddressMode = enum(u32) {
|
const AddressMode = enum(u32) {
|
||||||
repeat = 0x00000000,
|
repeat = 0x00000000,
|
||||||
mirror_repeat = 0x00000001,
|
mirror_repeat = 0x00000001,
|
||||||
clamp_to_edge = 0x00000002,
|
clamp_to_edge = 0x00000002,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
test "name" {
|
||||||
|
try std.testing.expect(std.mem.eql(u8, @tagName(Feature.timestamp_query), "timestamp_query"));
|
||||||
|
}
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
_ = Feature;
|
_ = Feature;
|
||||||
_ = AddressMode;
|
_ = AddressMode;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue