Skip to content

Commit 3c89073

Browse files
committed
Create U32Bool
1 parent fb9e8d3 commit 3c89073

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/wgpu.zig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ pub const BindGroupDescriptor = extern struct {
734734
pub const BufferBindingLayout = extern struct {
735735
next_in_chain: ?*const ChainedStruct = null,
736736
binding_type: BufferBindingType = .uniform,
737-
has_dynamic_offset: u32 = 0,
737+
has_dynamic_offset: U32Bool = .false,
738738
min_binding_size: u64 = 0,
739739
};
740740

@@ -774,12 +774,17 @@ pub const BindGroupLayoutDescriptor = extern struct {
774774
entries: ?[*]const BindGroupLayoutEntry,
775775
};
776776

777+
pub const U32Bool = enum(u32) {
778+
false = 0,
779+
true = 1,
780+
};
781+
777782
pub const BufferDescriptor = extern struct {
778783
next_in_chain: ?*const ChainedStruct = null,
779784
label: ?[*:0]const u8 = null,
780785
usage: BufferUsage,
781786
size: u64,
782-
mapped_at_creation: u32 = 0,
787+
mapped_at_creation: U32Bool = .false,
783788
};
784789

785790
pub const CommandEncoderDescriptor = extern struct {
@@ -1153,11 +1158,11 @@ pub const RenderPassDepthStencilAttachment = extern struct {
11531158
depth_load_op: LoadOp = .undef,
11541159
depth_store_op: StoreOp = .undef,
11551160
depth_clear_value: f32 = 0.0,
1156-
depth_read_only: u32 = 0,
1161+
depth_read_only: U32Bool = .false,
11571162
stencil_load_op: LoadOp = .undef,
11581163
stencil_store_op: StoreOp = .undef,
11591164
stencil_clear_value: u32 = 0,
1160-
stencil_read_only: u32 = 0,
1165+
stencil_read_only: U32Bool = .false,
11611166
};
11621167

11631168
pub const RenderPassDescriptor = extern struct {

src/zgpu.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ pub const GraphicsContext = struct {
426426
const buffer_handle = gctx.createBuffer(.{
427427
.usage = .{ .copy_src = true, .map_write = true },
428428
.size = uniforms_buffer_size,
429-
.mapped_at_creation = true,
429+
.mapped_at_creation = .true,
430430
});
431431

432432
// Add new (mapped) staging buffer to the buffer list.

0 commit comments

Comments
 (0)