Moving performance-related collection code from RenderEngine into new PerformanceManager code

This commit is contained in:
Alexander Bock
2016-06-06 03:19:44 +02:00
parent 55d484205a
commit 53c35c7531
8 changed files with 211 additions and 107 deletions
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __PERFORMANCEMEASUREMENT_H__
#define __PERFORMANCEMEASUREMENT_H__
#ifndef __PERFORMANCELAYOUT_H__
#define __PERFORMANCELAYOUT_H__
#include <cstdint>
@@ -60,14 +60,7 @@ struct PerformanceLayout {
FunctionPerformanceLayout functionEntries[MaxValues];
};
struct FunctionPerformanceHelper {
FunctionPerformanceHelper();
~FunctionPerformanceHelper();
};
} // namespace performance
} // namespace openspace
#endif // __PERFORMANCEMEASUREMENT_H__
#endif // __PERFORMANCELAYOUT_H__
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __PERFORMANCEMANAGER_H__
#define __PERFORMANCEMANAGER_H__
#include <vector>
namespace ghoul {
class SharedMemory;
}
namespace openspace {
class SceneGraphNode;
namespace performance {
class PerformanceManager {
public:
static const std::string PerformanceMeasurementSharedData;
PerformanceManager();
~PerformanceManager();
bool isMeasuringPerformance() const;
void storeScenePerformanceMeasurements(const std::vector<SceneGraphNode*>& sceneNodes);
private:
bool _doPerformanceMeasurements;
ghoul::SharedMemory* _performanceMemory;
};
} // namespace performance
} // namespace openspace
#endif // __PERFORMANCEMANAGER_H__
+4 -9
View File
@@ -31,6 +31,7 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/rendering/screenspacerenderable.h>
#include <openspace/performance/performancemanager.h>
namespace ghoul {
namespace fontrendering {
@@ -67,9 +68,6 @@ public:
Post
};
static const std::string PerformanceMeasurementSharedData;
static const std::string KeyFontMono;
static const std::string KeyFontLight;
@@ -101,8 +99,6 @@ public:
void setPerformanceMeasurements(bool performanceMeasurements);
bool doesPerformanceMeasurements() const;
void serialize(SyncBuffer* syncBuffer);
void deserialize(SyncBuffer* syncBuffer);
@@ -181,7 +177,7 @@ public:
private:
void setRenderer(std::unique_ptr<Renderer> renderer);
RendererImplementation rendererFromString(const std::string& method);
void storePerformanceMeasurements();
void renderInformation();
void renderScreenLog();
@@ -189,6 +185,8 @@ private:
Scene* _sceneGraph;
RaycasterManager* _raycasterManager;
std::unique_ptr<performance::PerformanceManager> _performanceManager;
std::unique_ptr<Renderer> _renderer;
RendererImplementation _rendererImplementation;
ghoul::Dictionary _rendererData;
@@ -199,9 +197,6 @@ private:
bool _showLog;
bool _takeScreenshot;
bool _doPerformanceMeasurements;
ghoul::SharedMemory* _performanceMemory;
float _globalBlackOutFactor;
float _fadeDuration;
float _currentFadeTime;