From ad907bf637412768e7f2e6fb76bc5e5b59ac5f1f Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:32:14 -0700 Subject: [PATCH] gpu: add Sampler.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/src/Sampler.zig | 19 +++++++++++++++++++ gpu/src/TODO | 15 --------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/gpu/src/Sampler.zig b/gpu/src/Sampler.zig index d3b8d8e3..9780140c 100644 --- a/gpu/src/Sampler.zig +++ b/gpu/src/Sampler.zig @@ -1,3 +1,7 @@ +const AddressMode = @import("enums.zig").AddressMode; +const FilterMode = @import("enums.zig").FilterMode; +const CompareFunction = @Import("data.zig").CompareFunction; + const Sampler = @This(); /// The type erased pointer to the Sampler implementation @@ -34,10 +38,25 @@ pub const BindingLayout = struct { type: BindingType, }; +pub const Descriptor = struct { + label: ?[*:0]const u8 = null, + address_mode_u: AddressMode, + address_mode_v: AddressMode, + address_mode_w: AddressMode, + mag_filter: FilterMode, + min_filter: FilterMode, + mipmap_filter: FilterMode, + lod_min_clamp: f32, + load_max_clamp: f32, + compare: CompareFunction, + max_anisotropy: u16, +}; + test "syntax" { _ = VTable; _ = reference; _ = release; _ = BindingType; _ = BindingLayout; + _ = Descriptor; } diff --git a/gpu/src/TODO b/gpu/src/TODO index 2455d226..cfa8ca22 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,21 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPUSamplerDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUAddressMode addressModeU; - WGPUAddressMode addressModeV; - WGPUAddressMode addressModeW; - WGPUFilterMode magFilter; - WGPUFilterMode minFilter; - WGPUFilterMode mipmapFilter; - float lodMinClamp; - float lodMaxClamp; - WGPUCompareFunction compare; - uint16_t maxAnisotropy; -} WGPUSamplerDescriptor; - typedef struct WGPUTextureViewDescriptor { WGPUChainedStruct const * nextInChain; char const * label;