From 7c17d09822e14c6f985d56380a9fe026ea95d745 Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Fri, 5 Jul 2024 17:14:41 +0200 Subject: [PATCH] Cross compatibility with older linux SDK. --- aster/global.h | 2 +- samples/01_triangle/triangle.cpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aster/global.h b/aster/global.h index 656d7a8..b20c552 100644 --- a/aster/global.h +++ b/aster/global.h @@ -30,7 +30,7 @@ #include -constexpr u32 ASTER_API_VERSION = vk::ApiVersion13; +constexpr u32 ASTER_API_VERSION = VK_API_VERSION_1_3; #define CODE_LOC " @ " __FILE__ ":" VULKAN_HPP_STRINGIFY(__LINE__) diff --git a/samples/01_triangle/triangle.cpp b/samples/01_triangle/triangle.cpp index 964323d..1024067 100644 --- a/samples/01_triangle/triangle.cpp +++ b/samples/01_triangle/triangle.cpp @@ -51,7 +51,7 @@ main(int, char **) INFO("Using {} as the primary device.", deviceToUse.m_DeviceProperties.deviceName.data()); - Features enabledDeviceFeatures = {.m_Vulkan13Features = {.dynamicRendering = vk::True}}; + Features enabledDeviceFeatures = {.m_Vulkan13Features = {.dynamicRendering = true}}; QueueAllocation queueAllocation = FindAppropriateQueueAllocation(&deviceToUse); Device device = {&context, &deviceToUse, &enabledDeviceFeatures, {queueAllocation}, "Primary Device"}; @@ -110,7 +110,7 @@ main(int, char **) { Frame *currentFrame = &frames[frameIndex]; - auto result = device.m_Device.waitForFences(1, ¤tFrame->m_FrameAvailableFence, vk::True, MaxValue); + auto result = device.m_Device.waitForFences(1, ¤tFrame->m_FrameAvailableFence, true, MaxValue); ERROR_IF(Failed(result), "Waiting for fence {} failed. Cause: {}", frameIndex, result) THEN_ABORT(result); @@ -322,7 +322,7 @@ CreatePipeline(const Device *device, const Swapchain *swapchain) }; vk::PipelineInputAssemblyStateCreateInfo inputAssemblyStateCreateInfo = { .topology = vk::PrimitiveTopology::eTriangleList, - .primitiveRestartEnable = vk::False, + .primitiveRestartEnable = false, }; vk::PipelineViewportStateCreateInfo viewportStateCreateInfo = { @@ -331,24 +331,24 @@ CreatePipeline(const Device *device, const Swapchain *swapchain) }; vk::PipelineRasterizationStateCreateInfo rasterizationStateCreateInfo = { - .depthClampEnable = vk::False, - .rasterizerDiscardEnable = vk::False, + .depthClampEnable = false, + .rasterizerDiscardEnable = false, .polygonMode = vk::PolygonMode::eFill, .cullMode = vk::CullModeFlagBits::eNone, .frontFace = vk::FrontFace::eCounterClockwise, - .depthBiasEnable = vk::False, + .depthBiasEnable = false, .lineWidth = 1.0, }; vk::PipelineMultisampleStateCreateInfo multisampleStateCreateInfo = { .rasterizationSamples = vk::SampleCountFlagBits::e1, - .sampleShadingEnable = vk::False, + .sampleShadingEnable = false, }; vk::PipelineDepthStencilStateCreateInfo depthStencilStateCreateInfo = { - .depthTestEnable = vk::False, - .depthWriteEnable = vk::False, + .depthTestEnable = false, + .depthWriteEnable = false, }; vk::PipelineColorBlendAttachmentState colorBlendAttachmentState = { - .blendEnable = vk::False, + .blendEnable = false, .srcColorBlendFactor = vk::BlendFactor::eSrcColor, .dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcColor, .colorBlendOp = vk::BlendOp::eAdd, @@ -359,7 +359,7 @@ CreatePipeline(const Device *device, const Swapchain *swapchain) vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA, }; vk::PipelineColorBlendStateCreateInfo colorBlendStateCreateInfo = { - .logicOpEnable = vk::False, + .logicOpEnable = false, .attachmentCount = 1, .pAttachments = &colorBlendAttachmentState, };