gpu: internalize TextureView types

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-30 00:03:54 -07:00 committed by Stephen Gutekanst
parent e9dcb49328
commit 0dae027602
4 changed files with 28 additions and 31 deletions

View file

@ -7,6 +7,28 @@ const mip_level_count_undefined = @import("main.zig").mip_level_count_undefined;
const array_layer_count_undefined = @import("main.zig").array_layer_count_undefined;
pub const TextureView = opaque {
pub const Dimension = enum(u32) {
dimension_undef = 0x00000000,
dimension_1d = 0x00000001,
dimension_2d = 0x00000002,
dimension_2d_array = 0x00000003,
dimension_cube = 0x00000004,
dimension_cube_array = 0x00000005,
dimension_3d = 0x00000006,
};
pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
format: TextureFormat = .undef,
dimension: Dimension = .dimension_undef,
base_mip_level: u32 = 0,
mip_level_count: u32 = mip_level_count_undefined,
base_array_layer: u32 = 0,
array_layer_count: u32 = array_layer_count_undefined,
aspect: TextureAspect = .all,
};
pub inline fn setLabel(texture_view: *TextureView, label: [*:0]const u8) void {
Impl.textureViewSetLabel(texture_view, label);
}
@ -19,25 +41,3 @@ pub const TextureView = opaque {
Impl.textureViewRelease(texture_view);
}
};
pub const TextureViewDimension = enum(u32) {
dimension_undef = 0x00000000,
dimension_1d = 0x00000001,
dimension_2d = 0x00000002,
dimension_2d_array = 0x00000003,
dimension_cube = 0x00000004,
dimension_cube_array = 0x00000005,
dimension_3d = 0x00000006,
};
pub const TextureViewDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
format: TextureFormat = .undef,
dimension: TextureViewDimension = .dimension_undef,
base_mip_level: u32 = 0,
mip_level_count: u32 = mip_level_count_undefined,
base_array_layer: u32 = 0,
array_layer_count: u32 = array_layer_count_undefined,
aspect: TextureAspect = .all,
};