[Feat] (MG_Backend/DirectVulkan): vertex input state factory

This commit is contained in:
2026-02-17 10:24:01 +08:00
parent 206d8ab36a
commit 324498ccac
8 changed files with 250 additions and 0 deletions
@@ -7,6 +7,7 @@
// End of Source File Header
#include "VulkanRenderer.h"
#include "VertexInputStateFactory.h"
#include "VertexInputStateBuilder.h"
#include "MG_State/GLState/ProgramState/ProgramObject.h"
@@ -201,6 +202,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
RecreateSwapchain();
m_programFactory = MakeUnique<ProgramFactory>(m_device, m_config);
m_vertexInputStateFactory = MakeUnique<VertexInputStateFactory>(m_config);
PrepareDemoPipeline();
CreateFrameContexts();
@@ -216,6 +218,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
VK_VERIFY(vkDeviceWaitIdle(m_device));
m_programFactory.reset();
m_vertexInputStateFactory.reset();
m_indexBuffer.Destroy();
m_frameContext.Destroy(m_device, m_commandPool);
@@ -450,6 +453,10 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return;
}
if (payload.vertexArray && m_vertexInputStateFactory) {
(void)m_vertexInputStateFactory->GetOrCreateVertexInputState(*payload.vertexArray);
}
EnsureFrameRecordingStarted();
auto& frame = m_frameContext.GetCurrent();
if (!frame.isCommandRecording || !m_isMainRenderPassActive) {