Squash improve-ide-compat into main

Fixes GH-5

- cppcheck replaced with clang-tidy
- clang-tidy lint warnings fixed
- Reworked build tools from scratch to make IDE setup easier
- Added 1.5 IDE setup guides
This commit is contained in:
2023-11-10 21:30:55 +01:00
parent 189d19fd4a
commit ae4e265a90
66 changed files with 2017 additions and 1498 deletions

View File

@@ -5,17 +5,16 @@
#include "vulkan_descriptor_set.h"
#include "vulkan_render_pass.h"
namespace progressia {
namespace desktop {
namespace progressia::desktop {
Pipeline::Pipeline(Vulkan &vulkan) : vulkan(vulkan) {
Pipeline::Pipeline(Vulkan &vulkan) : layout(), vk(), vulkan(vulkan) {
auto &adapter = vulkan.getAdapter();
// Shaders
auto vertShader = createShaderModule(adapter.loadVertexShader());
auto fragShader = createShaderModule(adapter.loadFragmentShader());
auto *vertShader = createShaderModule(adapter.loadVertexShader());
auto *fragShader = createShaderModule(adapter.loadFragmentShader());
VkPipelineShaderStageCreateInfo vertShaderStageInfo{};
vertShaderStageInfo.sType =
@@ -81,13 +80,13 @@ Pipeline::Pipeline(Vulkan &vulkan) : vulkan(vulkan) {
rasterizer.depthClampEnable = VK_FALSE;
rasterizer.rasterizerDiscardEnable = VK_FALSE;
rasterizer.polygonMode = VK_POLYGON_MODE_FILL;
rasterizer.lineWidth = 1.0f;
rasterizer.lineWidth = 1.0F;
rasterizer.cullMode = VK_CULL_MODE_BACK_BIT;
rasterizer.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
rasterizer.depthBiasEnable = VK_FALSE;
rasterizer.depthBiasConstantFactor = 0.0f; // Optional
rasterizer.depthBiasClamp = 0.0f; // Optional
rasterizer.depthBiasSlopeFactor = 0.0f; // Optional
rasterizer.depthBiasConstantFactor = 0.0F; // Optional
rasterizer.depthBiasClamp = 0.0F; // Optional
rasterizer.depthBiasSlopeFactor = 0.0F; // Optional
// Multisampling (disabled)
@@ -96,7 +95,7 @@ Pipeline::Pipeline(Vulkan &vulkan) : vulkan(vulkan) {
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
multisampling.sampleShadingEnable = VK_FALSE;
multisampling.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
multisampling.minSampleShading = 1.0f; // Optional
multisampling.minSampleShading = 1.0F; // Optional
multisampling.pSampleMask = nullptr; // Optional
multisampling.alphaToCoverageEnable = VK_FALSE; // Optional
multisampling.alphaToOneEnable = VK_FALSE; // Optional
@@ -138,10 +137,10 @@ Pipeline::Pipeline(Vulkan &vulkan) : vulkan(vulkan) {
colorBlending.logicOp = VK_LOGIC_OP_COPY; // Optional
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f; // Optional
colorBlending.blendConstants[1] = 0.0f; // Optional
colorBlending.blendConstants[2] = 0.0f; // Optional
colorBlending.blendConstants[3] = 0.0f; // Optional
colorBlending.blendConstants[0] = 0.0F; // Optional
colorBlending.blendConstants[1] = 0.0F; // Optional
colorBlending.blendConstants[2] = 0.0F; // Optional
colorBlending.blendConstants[3] = 0.0F; // Optional
// Pipeline
@@ -202,7 +201,7 @@ VkShaderModule Pipeline::createShaderModule(const std::vector<char> &bytecode) {
// Important - the buffer must be aligned properly. std::vector does that.
createInfo.pCode = reinterpret_cast<const uint32_t *>(bytecode.data());
VkShaderModule shaderModule;
VkShaderModule shaderModule = nullptr;
vulkan.handleVkResult("Could not load shader",
vkCreateShaderModule(vulkan.getDevice(), &createInfo,
nullptr, &shaderModule));
@@ -219,5 +218,4 @@ VkPipeline Pipeline::getVk() { return vk; }
VkPipelineLayout Pipeline::getLayout() { return layout; }
} // namespace desktop
} // namespace progressia
} // namespace progressia::desktop