From 1ad93c1fbbc02c56ccb21ef17bb607f1b1396096 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Wed, 9 Mar 2022 09:43:14 -0700 Subject: [PATCH] gpu: add AddressMode enum Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 7 ------- gpu/src/address_mode.zig | 5 +++++ gpu/src/main.zig | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 gpu/src/address_mode.zig diff --git a/gpu/src/TODO b/gpu/src/TODO index 62dcac43..d9287db2 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -27,13 +27,6 @@ typedef struct WGPUSamplerImpl* WGPUSampler; typedef struct WGPUTextureImpl* WGPUTexture; typedef struct WGPUTextureViewImpl* WGPUTextureView; -typedef enum WGPUAddressMode { - WGPUAddressMode_Repeat = 0x00000000, - WGPUAddressMode_MirrorRepeat = 0x00000001, - WGPUAddressMode_ClampToEdge = 0x00000002, - WGPUAddressMode_Force32 = 0x7FFFFFFF -} WGPUAddressMode; - typedef enum WGPUAlphaMode { WGPUAlphaMode_Premultiplied = 0x00000000, WGPUAlphaMode_Unpremultiplied = 0x00000001, diff --git a/gpu/src/address_mode.zig b/gpu/src/address_mode.zig new file mode 100644 index 00000000..3d210b6a --- /dev/null +++ b/gpu/src/address_mode.zig @@ -0,0 +1,5 @@ +const AddressMode = enum(u32) { + repeat = 0x00000000, + mirror_repeat = 0x00000001, + clamp_to_edge = 0x00000002, +}; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index fefe6697..c942759c 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -40,6 +40,7 @@ pub const FeatureName = @import("feature_name.zig").FeatureName; pub const TextureUsage = @import("texture_usage.zig").TextureUsage; pub const TextureFormat = @import("texture_format.zig").TextureFormat; pub const PresentMode = @import("present_mode.zig").PresentMode; +pub const AddressMode = @import("address_mode.zig").AddressMode; test "syntax" { _ = Interface;