Skip to content

Commit f3d52ce

Browse files
committed
update to latest zig
1 parent 9a252d6 commit f3d52ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.zig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const assert = std.debug.assert;
33
const mem = std.mem;
44
const Allocator = mem.Allocator;
55
const c = @import("vulkan.zig");
6+
const maxInt = std.math.maxInt;
67

78
const WIDTH = 800;
89
const HEIGHT = 600;
@@ -573,8 +574,8 @@ fn chooseSwapPresentMode(availablePresentModes: []c.VkPresentModeKHR) c.VkPresen
573574
return bestMode;
574575
}
575576

576-
fn chooseSwapExtent(capabilities: *const c.VkSurfaceCapabilitiesKHR) c.VkExtent2D {
577-
if (capabilities.currentExtent.width != @maxValue(u32)) {
577+
fn chooseSwapExtent(capabilities: c.VkSurfaceCapabilitiesKHR) c.VkExtent2D {
578+
if (capabilities.currentExtent.width != maxInt(u32)) {
578579
return capabilities.currentExtent;
579580
} else {
580581
var actualExtent = c.VkExtent2D{
@@ -1011,11 +1012,11 @@ fn checkValidationLayerSupport(allocator: *Allocator) !bool {
10111012
}
10121013

10131014
fn drawFrame() !void {
1014-
try checkSuccess(c.vkWaitForFences(global_device, 1, (*[1]c.VkFence)(&inFlightFences[currentFrame]), c.VK_TRUE, @maxValue(u64)));
1015+
try checkSuccess(c.vkWaitForFences(global_device, 1, (*[1]c.VkFence)(&inFlightFences[currentFrame]), c.VK_TRUE, maxInt(u64)));
10151016
try checkSuccess(c.vkResetFences(global_device, 1, (*[1]c.VkFence)(&inFlightFences[currentFrame])));
10161017

10171018
var imageIndex: u32 = undefined;
1018-
try checkSuccess(c.vkAcquireNextImageKHR(global_device, swapChain, @maxValue(u64), imageAvailableSemaphores[currentFrame], null, &imageIndex));
1019+
try checkSuccess(c.vkAcquireNextImageKHR(global_device, swapChain, maxInt(u64), imageAvailableSemaphores[currentFrame], null, &imageIndex));
10191020

10201021
var waitSemaphores = []c.VkSemaphore{imageAvailableSemaphores[currentFrame]};
10211022
var waitStages = []c.VkPipelineStageFlags{c.VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT};

0 commit comments

Comments
 (0)