Refactor asset handling
This commit is contained in:
@@ -18,9 +18,9 @@ namespace Copium
|
||||
VkRenderPass renderPass;
|
||||
if (metaFileClass.HasValue("framebuffer-uuid"))
|
||||
{
|
||||
Framebuffer& fb = AssetManager::LoadAsset<Framebuffer>(Uuid{metaFileClass.GetValue("framebuffer-uuid")});
|
||||
framebuffer = AssetRef<Framebuffer>(Uuid{metaFileClass.GetValue("framebuffer-uuid")});
|
||||
Framebuffer& fb = framebuffer.GetAsset();
|
||||
renderPass = fb.GetRenderPass();
|
||||
framebuffer = fb;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,10 +62,6 @@ namespace Copium
|
||||
{
|
||||
vkDestroyDescriptorSetLayout(Vulkan::GetDevice(), descriptorSetLayout, nullptr);
|
||||
}
|
||||
if (framebuffer != NULL_ASSET_HANDLE)
|
||||
{
|
||||
AssetManager::UnloadAsset(framebuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void Pipeline::Bind(const CommandBuffer& commandBuffer)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "copium/asset/Asset.h"
|
||||
#include "copium/asset/AssetRef.h"
|
||||
#include "copium/buffer/CommandBuffer.h"
|
||||
#include "copium/buffer/Framebuffer.h"
|
||||
#include "copium/pipeline/DescriptorSet.h"
|
||||
#include "copium/pipeline/PipelineCreator.h"
|
||||
#include "copium/util/Common.h"
|
||||
@@ -20,7 +22,7 @@ namespace Copium
|
||||
std::vector<VkDescriptorSet> boundDescriptorSets;
|
||||
VkPipelineLayout pipelineLayout;
|
||||
VkPipeline graphicsPipeline;
|
||||
AssetHandle framebuffer;
|
||||
AssetRef<Framebuffer> framebuffer;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user