[LYN-3265] Vegetation failed to display in the launcher because we hadn't deleted enough legacy code out of the system yet.

The actual bug was the "if (!m_engine)" early-out in CreateInstanceNode that needed to be removed, but all the rest of this legacy-based merged mesh code was ripe for removal as well.
This commit is contained in:
mbalfour
2021-04-23 14:56:29 -05:00
parent 01c04367e9
commit 9b8aed1852
4 changed files with 2 additions and 211 deletions
@@ -28,9 +28,6 @@
#include <Vegetation/Ebuses/InstanceSystemRequestBus.h>
#include <Vegetation/Ebuses/SystemConfigurationBus.h>
#include <StatObjBus.h>
#include <CrySystemBus.h>
namespace AZ
{
class Aabb;
@@ -39,10 +36,6 @@ namespace AZ
class EntityId;
}
struct IRenderNode;
struct ISystem;
struct I3DEngine;
//////////////////////////////////////////////////////////////////////////
namespace Vegetation
@@ -63,11 +56,6 @@ namespace Vegetation
// maximum number of instance management tasks that can be batch processed together
int m_maxInstanceTaskBatchSize = 100;
// merged mesh visual features
float m_mergedMeshesViewDistanceRatio = 100.0f;
float m_mergedMeshesLodRatio = 3.0f;
float m_mergedMeshesInstanceDistance = 4.5f;
};
/**
@@ -78,9 +66,7 @@ namespace Vegetation
, private InstanceSystemRequestBus::Handler
, private InstanceSystemStatsRequestBus::Handler
, private AZ::TickBus::Handler
, private InstanceStatObjEventBus::Handler
, private SystemConfigurationRequestBus::Handler
, private CrySystemEventBus::Handler
{
friend class EditorInstanceSystemComponent;
@@ -116,9 +102,6 @@ namespace Vegetation
void DestroyAllInstances() override;
void Cleanup() override;
void RegisterMergedMeshInstance(InstancePtr instance, IRenderNode* mergedMeshNode) override;
void ReleaseMergedMeshInstance(InstancePtr instance) override;
// InstanceSystemStatsRequestBus
AZ::u32 GetInstanceCount() const override;
AZ::u32 GetTotalTaskCount() const override;
@@ -128,19 +111,11 @@ namespace Vegetation
// AZ::TickBus
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
// InstanceStatObjEventBus
void ReleaseData() override;
//////////////////////////////////////////////////////////////////
// SystemConfigurationRequestBus
void UpdateSystemConfig(const AZ::ComponentConfig* config) override;
void GetSystemConfig(AZ::ComponentConfig* config) const override;
////////////////////////////////////////////////////////////////////////////
// CrySystemEvents
void OnCrySystemInitialized(ISystem& system, const SSystemInitParams& systemInitParams) override;
void OnCrySystemShutdown(ISystem& system) override;
////////////////////////////////////////////////////////////////
// vegetation instance id management
InstanceId CreateInstanceId();
@@ -155,9 +130,6 @@ namespace Vegetation
bool IsInstanceSkippable(const InstanceData& instanceData) const;
void CreateInstanceNode(const InstanceData& instanceData);
void CreateInstanceNodeBegin();
void CreateInstanceNodeEnd();
void ReleaseInstanceNode(InstanceId instanceId);
mutable AZStd::recursive_mutex m_instanceMapMutex;
@@ -192,15 +164,6 @@ namespace Vegetation
AZStd::map<DescriptorPtr, DescriptorDetails> m_uniqueDescriptors;
AZStd::map<DescriptorPtr, DescriptorDetails> m_uniqueDescriptorsToDelete;
//refresh events can queue the creation and deletion of the same node in the same frame
//this map is used to track which nodes remain after all tasks have executed for the frame
//registration will only be done on the final set each frame
AZStd::unordered_map<InstancePtr, IRenderNode*> m_instanceNodeToMergedMeshNodeRegistrationMap;
AZStd::unordered_set<IRenderNode*> m_mergedMeshNodeRegistrationSet;
ISystem* m_system = nullptr;
I3DEngine* m_engine = nullptr;
AZStd::atomic_int m_instanceCount{ 0 };
AZStd::atomic_int m_createTaskCount{ 0 };
AZStd::atomic_int m_destroyTaskCount{ 0 };