replace vk.Bool32 with enum

This commit is contained in:
Robin Voetter
2025-08-26 22:59:59 +02:00
parent 8322c9593f
commit 571c59180d
4 changed files with 46 additions and 26 deletions

View File

@@ -253,7 +253,7 @@ fn allocateQueues(instance: Instance, pdev: vk.PhysicalDevice, allocator: Alloca
graphics_family = family;
}
if (present_family == null and (try instance.getPhysicalDeviceSurfaceSupportKHR(pdev, family, surface)) == vk.TRUE) {
if (present_family == null and (try instance.getPhysicalDeviceSurfaceSupportKHR(pdev, family, surface)) == .true) {
present_family = family;
}
}

View File

@@ -60,7 +60,7 @@ pub const Swapchain = struct {
.pre_transform = caps.current_transform,
.composite_alpha = .{ .opaque_bit_khr = true },
.present_mode = present_mode,
.clipped = vk.TRUE,
.clipped = .true,
.old_swapchain = old_handle,
}, null) catch {
return error.SwapchainCreationFailed;
@@ -261,7 +261,7 @@ const SwapImage = struct {
}
fn waitForFence(self: SwapImage, gc: *const GraphicsContext) !void {
_ = try gc.dev.waitForFences(1, @ptrCast(&self.frame_fence), vk.TRUE, std.math.maxInt(u64));
_ = try gc.dev.waitForFences(1, @ptrCast(&self.frame_fence), .true, std.math.maxInt(u64));
}
};

View File

@@ -414,7 +414,7 @@ fn createPipeline(
const piasci = vk.PipelineInputAssemblyStateCreateInfo{
.topology = .triangle_list,
.primitive_restart_enable = vk.FALSE,
.primitive_restart_enable = .false,
};
const pvsci = vk.PipelineViewportStateCreateInfo{
@@ -425,12 +425,12 @@ fn createPipeline(
};
const prsci = vk.PipelineRasterizationStateCreateInfo{
.depth_clamp_enable = vk.FALSE,
.rasterizer_discard_enable = vk.FALSE,
.depth_clamp_enable = .false,
.rasterizer_discard_enable = .false,
.polygon_mode = .fill,
.cull_mode = .{ .back_bit = true },
.front_face = .clockwise,
.depth_bias_enable = vk.FALSE,
.depth_bias_enable = .false,
.depth_bias_constant_factor = 0,
.depth_bias_clamp = 0,
.depth_bias_slope_factor = 0,
@@ -439,14 +439,14 @@ fn createPipeline(
const pmsci = vk.PipelineMultisampleStateCreateInfo{
.rasterization_samples = .{ .@"1_bit" = true },
.sample_shading_enable = vk.FALSE,
.sample_shading_enable = .false,
.min_sample_shading = 1,
.alpha_to_coverage_enable = vk.FALSE,
.alpha_to_one_enable = vk.FALSE,
.alpha_to_coverage_enable = .false,
.alpha_to_one_enable = .false,
};
const pcbas = vk.PipelineColorBlendAttachmentState{
.blend_enable = vk.FALSE,
.blend_enable = .false,
.src_color_blend_factor = .one,
.dst_color_blend_factor = .zero,
.color_blend_op = .add,
@@ -457,7 +457,7 @@ fn createPipeline(
};
const pcbsci = vk.PipelineColorBlendStateCreateInfo{
.logic_op_enable = vk.FALSE,
.logic_op_enable = .false,
.logic_op = .copy,
.attachment_count = 1,
.p_attachments = @ptrCast(&pcbas),