gpu: add type-safety for chaining ExternalTexture.BindingLayout
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
1f0b50ba13
commit
8826cfb7a0
2 changed files with 7 additions and 2 deletions
|
|
@ -6,11 +6,17 @@ const Texture = @import("texture.zig").Texture;
|
||||||
const TextureView = @import("texture_view.zig").TextureView;
|
const TextureView = @import("texture_view.zig").TextureView;
|
||||||
const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLayout;
|
const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLayout;
|
||||||
const StorageTextureAccess = @import("types.zig").StorageTextureAccess;
|
const StorageTextureAccess = @import("types.zig").StorageTextureAccess;
|
||||||
|
const ExternalTexture = @import("external_texture.zig").ExternalTexture;
|
||||||
const Impl = @import("interface.zig").Impl;
|
const Impl = @import("interface.zig").Impl;
|
||||||
|
|
||||||
pub const BindGroupLayout = opaque {
|
pub const BindGroupLayout = opaque {
|
||||||
pub const Entry = extern struct {
|
pub const Entry = extern struct {
|
||||||
next_in_chain: ?*const ChainedStruct = null,
|
pub const NextInChain = extern union {
|
||||||
|
generic: ?*const ChainedStruct,
|
||||||
|
external_texture_binding_layout: *const ExternalTexture.BindingLayout,
|
||||||
|
};
|
||||||
|
|
||||||
|
next_in_chain: NextInChain = .{ .generic = null },
|
||||||
binding: u32,
|
binding: u32,
|
||||||
visibility: ShaderStageFlags,
|
visibility: ShaderStageFlags,
|
||||||
buffer: Buffer.BindingLayout = .{},
|
buffer: Buffer.BindingLayout = .{},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ pub const ExternalTexture = opaque {
|
||||||
external_texture: *ExternalTexture,
|
external_texture: *ExternalTexture,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// TODO: Can be chained in gpu.BindGroupLayout.Entry
|
|
||||||
pub const BindingLayout = extern struct {
|
pub const BindingLayout = extern struct {
|
||||||
chain: ChainedStruct = .{ .next = null, .s_type = .external_texture_binding_layout },
|
chain: ChainedStruct = .{ .next = null, .s_type = .external_texture_binding_layout },
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue