gpu: add BindingGroupLayout.Entry

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 16:15:09 -07:00 committed by Stephen Gutekanst
parent c0ddbbb514
commit 3393813ebc
2 changed files with 16 additions and 10 deletions

View file

@ -1,3 +1,9 @@
const Buffer = @import("Buffer.zig");
const Sampler = @import("Sampler.zig");
const Texture = @import("Texture.zig");
const StorageTextureBindingLayout = @import("structs.zig").StorageTextureBindingLayout;
const ShaderStage = @import("enums.zig").ShaderStage;
const BindGroupLayout = @This();
/// The type erased pointer to the BindGroupLayout implementation
@ -23,9 +29,19 @@ pub inline fn setLabel(group: BindGroupLayout, label: [:0]const u8) void {
group.vtable.setLabel(group.ptr, label);
}
pub const Entry = struct {
binding: u32,
visibility: ShaderStage,
buffer: Buffer.BindingLayout,
sampler: Sampler.BindingLayout,
texture: Texture.BindingLayout,
storage_texture: StorageTextureBindingLayout,
};
test "syntax" {
_ = VTable;
_ = reference;
_ = release;
_ = setLabel;
_ = Entry;
}

View file

@ -204,16 +204,6 @@ typedef struct WGPUCopyTextureForBrowserOptions {
WGPUAlphaMode dstAlphaMode;
} WGPUCopyTextureForBrowserOptions;
typedef struct WGPUBindGroupLayoutEntry {
WGPUChainedStruct const * nextInChain;
uint32_t binding;
WGPUShaderStageFlags visibility;
WGPUBufferBindingLayout buffer;
WGPUSamplerBindingLayout sampler;
WGPUTextureBindingLayout texture;
WGPUStorageTextureBindingLayout storageTexture;
} WGPUBindGroupLayoutEntry;
typedef struct WGPUCompilationInfo {
WGPUChainedStruct const * nextInChain;
uint32_t messageCount;