Graphics/[SpriteChain|Submesh]Renderer: Fix material pass not breaking batching

This commit is contained in:
Jérôme Leclercq
2021-12-01 10:40:47 +01:00
parent b256ddd06b
commit e1a378e733
6 changed files with 59 additions and 18 deletions

View File

@@ -22,6 +22,14 @@ namespace Nz
return it->second;
}
inline std::size_t RenderQueueRegistry::FetchMaterialPassIndex(const MaterialPass* materialPass) const
{
auto it = m_materialPassRegistry.find(materialPass);
assert(it != m_materialPassRegistry.end());
return it->second;
}
inline std::size_t RenderQueueRegistry::FetchPipelineIndex(const RenderPipeline* pipeline) const
{
auto it = m_pipelineRegistry.find(pipeline);
@@ -51,6 +59,11 @@ namespace Nz
m_renderLayerRegistry.try_emplace(renderLayer, m_renderLayerRegistry.size());
}
inline void RenderQueueRegistry::RegisterMaterialPass(const MaterialPass* materialPass)
{
m_materialPassRegistry.try_emplace(materialPass, m_materialPassRegistry.size());
}
inline void RenderQueueRegistry::RegisterPipeline(const RenderPipeline* pipeline)
{
m_pipelineRegistry.try_emplace(pipeline, m_pipelineRegistry.size());