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> #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__) #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()); 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); QueueAllocation queueAllocation = FindAppropriateQueueAllocation(&deviceToUse);
Device device = {&context, &deviceToUse, &enabledDeviceFeatures, {queueAllocation}, "Primary Device"}; Device device = {&context, &deviceToUse, &enabledDeviceFeatures, {queueAllocation}, "Primary Device"};
@ -110,7 +110,7 @@ main(int, char **)
{ {
Frame *currentFrame = &frames[frameIndex]; 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) ERROR_IF(Failed(result), "Waiting for fence {} failed. Cause: {}", frameIndex, result)
THEN_ABORT(result); THEN_ABORT(result);
@ -322,7 +322,7 @@ CreatePipeline(const Device *device, const Swapchain *swapchain)
}; };
vk::PipelineInputAssemblyStateCreateInfo inputAssemblyStateCreateInfo = { vk::PipelineInputAssemblyStateCreateInfo inputAssemblyStateCreateInfo = {
.topology = vk::PrimitiveTopology::eTriangleList, .topology = vk::PrimitiveTopology::eTriangleList,
.primitiveRestartEnable = vk::False, .primitiveRestartEnable = false,
}; };
vk::PipelineViewportStateCreateInfo viewportStateCreateInfo = { vk::PipelineViewportStateCreateInfo viewportStateCreateInfo = {
@ -331,24 +331,24 @@ CreatePipeline(const Device *device, const Swapchain *swapchain)
}; };
vk::PipelineRasterizationStateCreateInfo rasterizationStateCreateInfo = { vk::PipelineRasterizationStateCreateInfo rasterizationStateCreateInfo = {
.depthClampEnable = vk::False, .depthClampEnable = false,
.rasterizerDiscardEnable = vk::False, .rasterizerDiscardEnable = false,
.polygonMode = vk::PolygonMode::eFill, .polygonMode = vk::PolygonMode::eFill,
.cullMode = vk::CullModeFlagBits::eNone, .cullMode = vk::CullModeFlagBits::eNone,
.frontFace = vk::FrontFace::eCounterClockwise, .frontFace = vk::FrontFace::eCounterClockwise,
.depthBiasEnable = vk::False, .depthBiasEnable = false,
.lineWidth = 1.0, .lineWidth = 1.0,
}; };
vk::PipelineMultisampleStateCreateInfo multisampleStateCreateInfo = { vk::PipelineMultisampleStateCreateInfo multisampleStateCreateInfo = {
.rasterizationSamples = vk::SampleCountFlagBits::e1, .rasterizationSamples = vk::SampleCountFlagBits::e1,
.sampleShadingEnable = vk::False, .sampleShadingEnable = false,
}; };
vk::PipelineDepthStencilStateCreateInfo depthStencilStateCreateInfo = { vk::PipelineDepthStencilStateCreateInfo depthStencilStateCreateInfo = {
.depthTestEnable = vk::False, .depthTestEnable = false,
.depthWriteEnable = vk::False, .depthWriteEnable = false,
}; };
vk::PipelineColorBlendAttachmentState colorBlendAttachmentState = { vk::PipelineColorBlendAttachmentState colorBlendAttachmentState = {
.blendEnable = vk::False, .blendEnable = false,
.srcColorBlendFactor = vk::BlendFactor::eSrcColor, .srcColorBlendFactor = vk::BlendFactor::eSrcColor,
.dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcColor, .dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcColor,
.colorBlendOp = vk::BlendOp::eAdd, .colorBlendOp = vk::BlendOp::eAdd,
@ -359,7 +359,7 @@ CreatePipeline(const Device *device, const Swapchain *swapchain)
vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA, vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA,
}; };
vk::PipelineColorBlendStateCreateInfo colorBlendStateCreateInfo = { vk::PipelineColorBlendStateCreateInfo colorBlendStateCreateInfo = {
.logicOpEnable = vk::False, .logicOpEnable = false,
.attachmentCount = 1, .attachmentCount = 1,
.pAttachments = &colorBlendAttachmentState, .pAttachments = &colorBlendAttachmentState,
}; };