fix: alot of stuff changed. Mostly bugfixxes / architechture changes
This commit is contained in:
@@ -5,19 +5,31 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "volk.h"
|
||||
#include "destrum/Graphics/Util.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
|
||||
Pipeline::Pipeline(GfxDevice& device, const std::string& vertPath, const std::string& fragPath,
|
||||
const PipelineConfigInfo& configInfo): m_device(device) {
|
||||
CreateGraphicsPipeline(vertPath, fragPath, configInfo);
|
||||
try {
|
||||
CreateGraphicsPipeline(vertPath, fragPath, configInfo);
|
||||
} catch (...) {
|
||||
if (m_device.getDevice() != VK_NULL_HANDLE) {
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_vertShaderModule, nullptr);
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_fragShaderModule, nullptr);
|
||||
vkDestroyPipeline(m_device.getDevice(), m_graphicsPipeline, nullptr);
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Pipeline::~Pipeline() {
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_vertShaderModule, nullptr);
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_fragShaderModule, nullptr);
|
||||
vkDestroyPipeline(m_device.getDevice(), m_graphicsPipeline, nullptr);
|
||||
if (m_device.getDevice() != VK_NULL_HANDLE) {
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_vertShaderModule, nullptr);
|
||||
vkDestroyShaderModule(m_device.getDevice(), m_fragShaderModule, nullptr);
|
||||
vkDestroyPipeline(m_device.getDevice(), m_graphicsPipeline, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void Pipeline::bind(VkCommandBuffer buffer) const {
|
||||
|
||||
Reference in New Issue
Block a user