GPU Cleanup
This commit is contained in:
@@ -67,7 +67,7 @@ namespace Nuake
|
||||
m_Logs.push_back(newLog);
|
||||
}
|
||||
|
||||
std::vector<LogEntry> Logger::GetLogs()
|
||||
std::vector<LogEntry>& Logger::GetLogs()
|
||||
{
|
||||
return m_Logs;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Nuake
|
||||
|
||||
public:
|
||||
static void Log(const std::string& log, const std::string& logger = "main", LOG_TYPE type = VERBOSE);
|
||||
static std::vector<LogEntry> GetLogs();
|
||||
static std::vector<LogEntry>& GetLogs();
|
||||
static void ClearLogs();
|
||||
static size_t GetLogCount() { return m_Logs.size(); }
|
||||
};
|
||||
|
||||
@@ -241,8 +241,8 @@ VulkanImage::VulkanImage(void* inData, ImageFormat inFormat, Vector2 inSize) : V
|
||||
);
|
||||
|
||||
AddGPUCleanUpFunc([=]() {
|
||||
//vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr);
|
||||
//vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation);
|
||||
vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr);
|
||||
vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -318,14 +318,14 @@ VulkanImage::VulkanImage(void* inData, size_t inSize) :
|
||||
});
|
||||
|
||||
AddGPUCleanUpFunc([=]() {
|
||||
//vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr);
|
||||
//vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation);
|
||||
vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr);
|
||||
vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation);
|
||||
});
|
||||
}
|
||||
|
||||
VulkanImage::~VulkanImage()
|
||||
{
|
||||
//Logger::Log("Deleting VulkanImage", "vulkan", VERBOSE);
|
||||
Logger::Log("Deleting VulkanImage", "vulkan", VERBOSE);
|
||||
GPUResources::Get().QueueDeletion(GetGPUCleanUpStack());
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
|
||||
bool NKUseValidationLayer = true;
|
||||
bool NKUseValidationLayer = false;
|
||||
|
||||
using namespace Nuake;
|
||||
|
||||
|
||||
@@ -23,6 +23,17 @@ namespace Nuake
|
||||
}
|
||||
}
|
||||
|
||||
LightComponent::~LightComponent()
|
||||
{
|
||||
for (int i = 0; i < CSM_AMOUNT; i++)
|
||||
{
|
||||
if (m_ShadowMaps[i])
|
||||
{
|
||||
GPUResources::Get().RemoveTexture(m_ShadowMaps[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LightComponent::SetCastShadows(bool toggle)
|
||||
{
|
||||
CastShadows = toggle;
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace Nuake
|
||||
BindComponentField<&LightComponent::CastShadows>("CastShadows", "CastShadows");
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
// All lights
|
||||
int32_t Type = Point;
|
||||
@@ -72,7 +73,7 @@ namespace Nuake
|
||||
public:
|
||||
|
||||
LightComponent();
|
||||
~LightComponent() = default;
|
||||
~LightComponent();
|
||||
|
||||
std::vector<UUID> LightMapIDs = std::vector<UUID>();
|
||||
void SetCastShadows(bool toggle);
|
||||
|
||||
Reference in New Issue
Block a user