gpu: make Texture an enum with methods
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
2a65690ffc
commit
05f153009d
2 changed files with 158 additions and 154 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
ptr: *anyopaque,
|
pub const Texture = enum(usize) {
|
||||||
|
_,
|
||||||
|
|
||||||
|
pub const none: Texture = @intToEnum(Texture, 0);
|
||||||
|
|
||||||
pub const Aspect = enum(u32) {
|
pub const Aspect = enum(u32) {
|
||||||
all = 0x00000000,
|
all = 0x00000000,
|
||||||
|
|
@ -154,3 +157,4 @@ pub const Usage = packed struct {
|
||||||
return @truncate(u6, @bitCast(u32, a)) == @truncate(u6, @bitCast(u32, b));
|
return @truncate(u6, @bitCast(u32, a)) == @truncate(u6, @bitCast(u32, b));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ pub const Sampler = @import("sampler.zig").Sampler;
|
||||||
pub const ShaderModule = @import("shader_module.zig").ShaderModule;
|
pub const ShaderModule = @import("shader_module.zig").ShaderModule;
|
||||||
pub const Surface = @import("surface.zig").Surface;
|
pub const Surface = @import("surface.zig").Surface;
|
||||||
pub const SwapChain = @import("swap_chain.zig").SwapChain;
|
pub const SwapChain = @import("swap_chain.zig").SwapChain;
|
||||||
pub const Texture = @import("Texture.zig");
|
pub const Texture = @import("texture.zig").Texture;
|
||||||
pub const TextureView = @import("TextureView.zig");
|
pub const TextureView = @import("TextureView.zig");
|
||||||
|
|
||||||
pub const AlphaMode = @import("types.zig").AlphaMode;
|
pub const AlphaMode = @import("types.zig").AlphaMode;
|
||||||
|
|
@ -59,7 +59,7 @@ test {
|
||||||
refAllDecls(@import("shader_module.zig"));
|
refAllDecls(@import("shader_module.zig"));
|
||||||
refAllDecls(@import("surface.zig"));
|
refAllDecls(@import("surface.zig"));
|
||||||
refAllDecls(@import("swap_chain.zig"));
|
refAllDecls(@import("swap_chain.zig"));
|
||||||
refAllDecls(@import("Texture.zig"));
|
refAllDecls(@import("texture.zig"));
|
||||||
refAllDecls(@import("TextureView.zig"));
|
refAllDecls(@import("TextureView.zig"));
|
||||||
refAllDecls(@import("types.zig"));
|
refAllDecls(@import("types.zig"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue