ADD: Texture Cache

This commit is contained in:
2025-11-03 14:37:52 +09:00
parent fbc937974d
commit cb495e3f4b
7 changed files with 177 additions and 92 deletions

View File

@@ -4,6 +4,7 @@
#include <unordered_set>
#include "frame_resources.h"
#include "texture_cache.h"
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "core/engine_context.h"
@@ -240,6 +241,10 @@ void GeometryPass::draw_geometry(VkCommandBuffer cmd,
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, r.material->pipeline->layout, 1, 1,
&r.material->materialSet, 0, nullptr);
if (ctxLocal->textures)
{
ctxLocal->textures->markSetUsed(r.material->materialSet, ctxLocal->frameIndex);
}
}
if (r.indexBuffer != lastIndexBuffer)
{

View File

@@ -2,6 +2,8 @@
#include <algorithm>
#include <unordered_set>
#include "texture_cache.h"
#include "vk_scene.h"
#include "vk_swapchain.h"
#include "core/engine_context.h"
@@ -133,6 +135,10 @@ void TransparentPass::draw_transparent(VkCommandBuffer cmd,
}
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, r.material->pipeline->layout, 1, 1,
&r.material->materialSet, 0, nullptr);
if (ctxLocal->textures)
{
ctxLocal->textures->markSetUsed(r.material->materialSet, ctxLocal->frameIndex);
}
}
if (r.indexBuffer != lastIndexBuffer)
{