@@ -3,6 +3,7 @@ const assert = std.debug.assert;
3
3
const mem = std .mem ;
4
4
const Allocator = mem .Allocator ;
5
5
const c = @import ("vulkan.zig" );
6
+ const maxInt = std .math .maxInt ;
6
7
7
8
const WIDTH = 800 ;
8
9
const HEIGHT = 600 ;
@@ -573,8 +574,8 @@ fn chooseSwapPresentMode(availablePresentModes: []c.VkPresentModeKHR) c.VkPresen
573
574
return bestMode ;
574
575
}
575
576
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 )) {
578
579
return capabilities .currentExtent ;
579
580
} else {
580
581
var actualExtent = c.VkExtent2D {
@@ -1011,11 +1012,11 @@ fn checkValidationLayerSupport(allocator: *Allocator) !bool {
1011
1012
}
1012
1013
1013
1014
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 )));
1015
1016
try checkSuccess (c .vkResetFences (global_device , 1 , (* [1 ]c .VkFence )(& inFlightFences [currentFrame ])));
1016
1017
1017
1018
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 ));
1019
1020
1020
1021
var waitSemaphores = []c.VkSemaphore {imageAvailableSemaphores [currentFrame ]};
1021
1022
var waitStages = []c.VkPipelineStageFlags {c .VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT };
0 commit comments