gpu: add Buffer.Descriptor

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 14:16:53 -07:00 committed by Stephen Gutekanst
parent 775be75c90
commit 8f17a2f79b
2 changed files with 10 additions and 8 deletions

View file

@ -1,3 +1,5 @@
const BufferUsage = @import("enums.zig").BufferUsage;
const Buffer = @This();
/// The type erased pointer to the Buffer implementation
@ -33,10 +35,18 @@ pub inline fn setLabel(buf: Buffer, label: [:0]const u8) void {
buf.vtable.setLabel(buf.ptr, label);
}
pub const Descriptor = struct {
label: ?[*:0]const u8 = null,
usage: BufferUsage,
size: usize,
mapped_at_creation: bool,
};
test "syntax" {
_ = VTable;
_ = reference;
_ = release;
_ = destroy;
_ = setLabel;
_ = Descriptor;
}

View file

@ -40,14 +40,6 @@ typedef struct WGPUChainedStructOut {
typedef struct WGPUBufferDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUBufferUsageFlags usage;
uint64_t size;
bool mappedAtCreation;
} WGPUBufferDescriptor;
typedef struct WGPUCommandBufferDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;