From bb870b87d96735b3d7a94acada30e85145043e0c Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 24 Aug 2025 14:11:38 +1000 Subject: [PATCH] add flag for debug printf & front face gfx pipeline opt --- vulkan.d | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/vulkan.d b/vulkan.d index d02dc68..1f7fb53 100644 --- a/vulkan.d +++ b/vulkan.d @@ -33,7 +33,14 @@ struct DescSet } bool g_VLAYER_SUPPORT = false; -bool g_DEBUG_PRINTF = false; +version(VK_DEBUG_PRINTF) +{ + bool g_DEBUG_PRINTF = true; +} +else +{ + bool g_DEBUG_PRINTF = false; +} const FRAME_OVERLAP = 2; const MAX_SETS = 1000; @@ -142,6 +149,14 @@ enum ImageUsage : VkImageUsageFlagBits alias IU = ImageUsage; +enum FrontFace: VkFrontFace +{ + CCW = VK_FRONT_FACE_COUNTER_CLOCKWISE, + CW = VK_FRONT_FACE_CLOCKWISE, +} + +alias FF = FrontFace; + enum Format : VkFormat { UINT = VK_FORMAT_R32_UINT, @@ -246,6 +261,7 @@ struct GfxPipelineInfo Specialization frag_spec; bool self_dependency; PipelineLayout layout; + FrontFace front_face; } struct CompPipelineInfo @@ -1718,7 +1734,7 @@ CreateGraphicsPipeline(Vulkan* vk, Pipeline* pipeline_handle, GfxPipelineInfo* b cullMode: VK_CULL_MODE_BACK_BIT, polygonMode: VK_POLYGON_MODE_FILL, lineWidth: 1.0, - frontFace: VK_FRONT_FACE_COUNTER_CLOCKWISE, + frontFace: cast(VkFrontFace)build_info.front_face, }; VkPipelineMultisampleStateCreateInfo multisample_info = {