zgpu

git clone git://git.electrosoup.com/zgpu
Log | Files | Refs | Submodules | README

sampler.zig (1087B)


      1 const c = @import("c.zig").c;
      2 const ChainedStruct = @import("common.zig").ChainedStruct;
      3 const CompareFunction = @import("common.zig").CompareFunction;
      4 const StringView = @import("common.zig").StringView;
      5 
      6 pub const AddressMode = enum(u32) {
      7     undefined = 0x00000000,
      8     clamp_to_edge = 0x00000001,
      9     repeat = 0x00000002,
     10     mirror_repeat = 0x00000003,
     11 };
     12 
     13 pub const FilterMode = enum(u32) {
     14     undefined = 0x00000000,
     15     nearest = 0x00000001,
     16     linear = 0x00000002,
     17 };
     18 
     19 pub const MipmapFilterMode = enum(u32) {
     20     undefined = 0x00000000,
     21     nearest = 0x00000001,
     22     linear = 0x00000002,
     23 };
     24 
     25 pub const Sampler = opaque {
     26     pub const Descriptor = extern struct {
     27         next: ?*ChainedStruct = null,
     28         label: StringView,
     29         address_mode_u: AddressMode,
     30         address_mode_v: AddressMode,
     31         address_mode_w: AddressMode,
     32         mag_filter: FilterMode,
     33         min_filter: FilterMode,
     34         mipmap_filter: MipmapFilterMode,
     35         lod_min_clamp: f32,
     36         lod_max_clamp: f32,
     37         compare: CompareFunction,
     38         max_anisotropy: u16,
     39     };
     40 };