Cross compatibility with older linux SDK.

This commit is contained in:
Anish Bhobe 2024-07-05 17:14:41 +02:00
parent 363259a52e
commit 7c17d09822
2 changed files with 12 additions and 12 deletions

View File

@ -30,7 +30,7 @@
#include <vulkan/vulkan.hpp>
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__)

View File

@ -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, &currentFrame->m_FrameAvailableFence, vk::True, MaxValue<u64>);
auto result = device.m_Device.waitForFences(1, &currentFrame->m_FrameAvailableFence, true, MaxValue<u64>);
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,
};