ADD: Texture load multithreaded

This commit is contained in:
2025-11-04 21:10:39 +09:00
parent 266b54560e
commit dad6db971b
7 changed files with 391 additions and 77 deletions

View File

@@ -25,8 +25,20 @@ void RenderGraph::init(EngineContext *ctx)
void RenderGraph::clear()
{
_passes.clear();
_resources.reset();
_passes.clear();
_resources.reset();
}
void RenderGraph::shutdown()
{
// If a timestamp pool exists, ensure the GPU is not using it and destroy it.
if (_timestampPool != VK_NULL_HANDLE && _context && _context->getDevice())
{
// Be conservative here: make sure the graphics queue is idle before destroying.
vkQueueWaitIdle(_context->getDevice()->graphicsQueue());
vkDestroyQueryPool(_context->getDevice()->device(), _timestampPool, nullptr);
_timestampPool = VK_NULL_HANDLE;
}
}
RGImageHandle RenderGraph::import_image(const RGImportedImageDesc &desc)

View File

@@ -15,8 +15,11 @@ class EngineContext;
class RenderGraph
{
public:
void init(EngineContext* ctx);
void clear();
void init(EngineContext* ctx);
void clear();
// Destroy any GPU-side state owned by the graph (e.g. query pools).
// Call during engine shutdown before destroying the VkDevice.
void shutdown();
// Import externally owned images (swapchain, drawImage, g-buffers)
RGImageHandle import_image(const RGImportedImageDesc& desc);