gpu: make Sampler an enum with methods
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
64d973faf7
commit
40306320f6
2 changed files with 17 additions and 13 deletions
|
|
@ -1,14 +1,18 @@
|
|||
ptr: *anyopaque,
|
||||
pub const Sampler = enum(usize) {
|
||||
_,
|
||||
|
||||
pub const AddressMode = enum(u32) {
|
||||
repeat = 0x00000000,
|
||||
mirror_repeat = 0x00000001,
|
||||
clamp_to_edge = 0x00000002,
|
||||
};
|
||||
pub const none: Sampler = @intToEnum(Sampler, 0);
|
||||
|
||||
pub const BindingType = enum(u32) {
|
||||
undef = 0x00000000,
|
||||
filtering = 0x00000001,
|
||||
non_filtering = 0x00000002,
|
||||
comparison = 0x00000003,
|
||||
pub const AddressMode = enum(u32) {
|
||||
repeat = 0x00000000,
|
||||
mirror_repeat = 0x00000001,
|
||||
clamp_to_edge = 0x00000002,
|
||||
};
|
||||
|
||||
pub const BindingType = enum(u32) {
|
||||
undef = 0x00000000,
|
||||
filtering = 0x00000001,
|
||||
non_filtering = 0x00000002,
|
||||
comparison = 0x00000003,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ pub const RenderBundle = @import("render_bundle.zig").RenderBundle;
|
|||
pub const RenderBundleEncoder = @import("render_bundle_encoder.zig").RenderBundleEncoder;
|
||||
pub const RenderPassEncoder = @import("render_pass_encoder.zig").RenderPassEncoder;
|
||||
pub const RenderPipeline = @import("render_pipeline.zig").RenderPipeline;
|
||||
pub const Sampler = @import("Sampler.zig");
|
||||
pub const Sampler = @import("sampler.zig").Sampler;
|
||||
pub const ShaderModule = @import("ShaderModule.zig");
|
||||
pub const Surface = @import("Surface.zig");
|
||||
pub const SwapChain = @import("SwapChain.zig");
|
||||
|
|
@ -55,7 +55,7 @@ test {
|
|||
refAllDecls(@import("render_bundle_encoder.zig"));
|
||||
refAllDecls(@import("render_pass_encoder.zig"));
|
||||
refAllDecls(@import("render_pipeline.zig"));
|
||||
refAllDecls(@import("Sampler.zig"));
|
||||
refAllDecls(@import("sampler.zig"));
|
||||
refAllDecls(@import("ShaderModule.zig"));
|
||||
refAllDecls(@import("Surface.zig"));
|
||||
refAllDecls(@import("SwapChain.zig"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue