gpu: Default values for BindGroup.Entry (#214)

simplifies creating BindGroup - all resources are null by default and the user sets only the one needed.

Helps hexops/mach#182
This commit is contained in:
Michal Ziulek 2022-04-11 00:17:20 +02:00 committed by GitHub
parent 9ed6f6ca8b
commit 8c8534e609
Failed to generate hash of commit

View file

@ -30,11 +30,11 @@ pub inline fn setLabel(group: BindGroup, label: [:0]const u8) void {
pub const Entry = struct { pub const Entry = struct {
binding: u32, binding: u32,
buffer: ?Buffer, buffer: ?Buffer = null,
offset: u64, offset: u64 = 0,
size: u64, size: u64,
sampler: ?Sampler, sampler: ?Sampler = null,
texture_view: ?TextureView, texture_view: ?TextureView = null,
}; };
pub const Descriptor = struct { pub const Descriptor = struct {