LYN-2227 : Improve mesh initialization performance by not creating draw packet more than once (#1476)

* Move SetUseForwardPassIblSpecular to happen when acquiring a mesh, instead of immediately after so that we don't build the drawpacket twice for every mesh

* Update the MeshFeatureProcessor to use the booleans from the descriptor directly instead of having loose booleans in the MeshDataInstance

* m_excludeFromReflectionCubeMaps is not (and does not need to be) part of the descriptor, since setting is cheap and doesn't duplicate work that is done when acquiring the mesh
This commit is contained in:
Tommy Walton
2021-06-22 12:59:27 -07:00
committed by GitHub
parent 6fe448d991
commit be0fbaaddc
12 changed files with 70 additions and 70 deletions
@@ -187,7 +187,7 @@ namespace Blast
materials, GetEntityId(), &AZ::Render::MaterialComponentRequests::GetMaterialOverrides);
m_meshFeatureProcessor->ReleaseMesh(m_meshHandle);
m_meshHandle = m_meshFeatureProcessor->AcquireMesh(m_meshAssets[0], materials);
m_meshHandle = m_meshFeatureProcessor->AcquireMesh(AZ::Render::MeshHandleDescriptor{ m_meshAssets[0] }, materials);
m_meshFeatureProcessor->ConnectModelChangeEventHandler(m_meshHandle, m_changeEventHandler);
HandleModelChange(m_meshFeatureProcessor->GetModel(m_meshHandle));