From 8c8534e60952ead7168a0652aa8fdc052257a961 Mon Sep 17 00:00:00 2001 From: Michal Ziulek Date: Mon, 11 Apr 2022 00:17:20 +0200 Subject: [PATCH] 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 --- gpu/src/BindGroup.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gpu/src/BindGroup.zig b/gpu/src/BindGroup.zig index 8f81356d..c0369873 100644 --- a/gpu/src/BindGroup.zig +++ b/gpu/src/BindGroup.zig @@ -30,11 +30,11 @@ pub inline fn setLabel(group: BindGroup, label: [:0]const u8) void { pub const Entry = struct { binding: u32, - buffer: ?Buffer, - offset: u64, + buffer: ?Buffer = null, + offset: u64 = 0, size: u64, - sampler: ?Sampler, - texture_view: ?TextureView, + sampler: ?Sampler = null, + texture_view: ?TextureView = null, }; pub const Descriptor = struct {