gpu: add type-safety for chaining dawn.TextureInternalUsageDescriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
e4ee5e221b
commit
8462427524
2 changed files with 8 additions and 3 deletions
|
|
@ -32,7 +32,6 @@ pub const InstanceDescriptor = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
/// TODO: Can be chained in gpu.Texture.Descriptor
|
||||
pub const TextureInternalUsageDescriptor = extern struct {
|
||||
chain: ChainedStruct = .{ .next = null, .s_type = .dawn_texture_internal_usage_descriptor },
|
||||
internal_usage: Texture.UsageFlags = Texture.UsageFlags.none,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ const TextureView = @import("texture_view.zig").TextureView;
|
|||
const Extent3D = @import("types.zig").Extent3D;
|
||||
const Impl = @import("interface.zig").Impl;
|
||||
const types = @import("types.zig");
|
||||
const dawn = @import("dawn.zig");
|
||||
|
||||
pub const Texture = opaque {
|
||||
pub const Aspect = enum(u32) {
|
||||
|
|
@ -174,7 +175,12 @@ pub const Texture = opaque {
|
|||
};
|
||||
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
pub const NextInChain = extern union {
|
||||
generic: ?*const ChainedStruct,
|
||||
dawn_texture_internal_usage_descriptor: *const dawn.TextureInternalUsageDescriptor,
|
||||
};
|
||||
|
||||
next_in_chain: NextInChain = .{ .generic = null },
|
||||
label: ?[*:0]const u8 = null,
|
||||
usage: UsageFlags,
|
||||
dimension: Dimension = .dimension_2d,
|
||||
|
|
@ -187,7 +193,7 @@ pub const Texture = opaque {
|
|||
|
||||
/// Provides a slightly friendlier Zig API to initialize this structure.
|
||||
pub inline fn init(v: struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
next_in_chain: NextInChain = .{ .generic = null },
|
||||
label: ?[*:0]const u8 = null,
|
||||
usage: UsageFlags,
|
||||
dimension: Dimension = .dimension_2d,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue