Submit cached map-object draws by pointer instead of copying
MapObjectManager::AppendDrawRefs references each visible object's cached Render3DDraw (writing the per-frame light into the cache) rather than copying the whole command (two texture strings, shared_ptrs, matrices) every frame. main.cpp flattens owned draws and refs in submission order (FlattenDraws) and passes a pointer list to RenderSceneGPU/RenderScene. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b5a15871f4
commit
46880be537
@@ -205,7 +205,9 @@ public:
|
||||
SpeedTreeForest* GetForest() { return m_forest.get(); }
|
||||
const OutdoorMapInfo* GetOutdoorMap() const { return m_strMapName.empty() ? nullptr : &m_outdoorMap; }
|
||||
|
||||
void BuildDrawCommands(const float* viewMatrix, const float* projMatrix, const float* camPos, std::vector<Render3DDraw>& outDraws);
|
||||
// outRefs (optional) receives the cached map-object commands by pointer instead of copies in outDraws.
|
||||
void BuildDrawCommands(const float* viewMatrix, const float* projMatrix, const float* camPos, std::vector<Render3DDraw>& outDraws,
|
||||
std::vector<Render3DDrawRef>* outRefs = nullptr);
|
||||
|
||||
private:
|
||||
void LoadAtlas();
|
||||
|
||||
Reference in New Issue
Block a user