zgpu

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

texture_view.zig (953B)


      1 const c = @import("c.zig").c;
      2 const ChainedStruct = @import("common.zig").ChainedStruct;
      3 const StringView = @import("common.zig").StringView;
      4 const Texture = @import("texture.zig").Texture;
      5 
      6 pub const TextureView = opaque {
      7     pub const Descriptor = extern struct {
      8         next: ?*const ChainedStruct = null,
      9         label: StringView,
     10         format: Texture.Format,
     11         dimension: Dimension,
     12         base_mip_level: u32,
     13         mip_level_count: u32,
     14         base_array_layer: u32,
     15         array_layer_count: u32,
     16         aspect: Texture.Aspect,
     17         usage: Texture.Usage,
     18     };
     19 
     20     pub const Dimension = enum(u32) {
     21         undefined = 0x00000000,
     22         @"1d" = 0x00000001,
     23         @"2d" = 0x00000002,
     24         @"2d_array" = 0x00000003,
     25         cube = 0x00000004,
     26         cube_array = 0x00000005,
     27         @"3d" = 0x00000006,
     28     };
     29 
     30     pub fn release(view: *TextureView) void {
     31         c.wgpuTextureViewRelease(@ptrCast(view));
     32     }
     33 };