[Optimization] (MG_Backend/DirectVulkan): optimize CreatePipeline hot path with VkPipelineCache

This commit is contained in:
2026-05-12 00:27:52 +08:00
parent 9e0e03d4c0
commit 60199c0323
2 changed files with 16 additions and 3 deletions
@@ -38,8 +38,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
const VkPipelineVertexInputStateCreateInfo* vertexInputState = nullptr;
};
explicit PipelineFactory(VkDevice device, const VulkanRendererConfig& config):
m_device(device), m_config(config) {}
explicit PipelineFactory(VkDevice device, const VulkanRendererConfig& config);
~PipelineFactory();
PipelineFactory(const PipelineFactory&) = delete;
@@ -52,6 +51,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
VkDevice m_device = VK_NULL_HANDLE;
const VulkanRendererConfig& m_config;
VkPipelineCache m_pipelineCache = VK_NULL_HANDLE;
UnorderedMap<HashType, VkPipeline> m_cache;
static inline XXH64_state_t* m_hashState = XXH64_createState();
};