Add more Tracy markers in different renderables

This commit is contained in:
Alexander Bock
2020-08-18 12:58:40 +02:00
parent c4db2a8ff9
commit 88b6fdd9fe
23 changed files with 87 additions and 12 deletions
@@ -150,6 +150,8 @@ namespace {
namespace openspace {
void AtmosphereDeferredcaster::initialize() {
ZoneScoped
if (!_atmosphereCalculated) {
preCalculateAtmosphereParam();
}
@@ -159,6 +161,8 @@ void AtmosphereDeferredcaster::initialize() {
}
void AtmosphereDeferredcaster::deinitialize() {
ZoneScoped
_transmittanceProgramObject = nullptr;
_irradianceProgramObject = nullptr;
_irradianceSupTermsProgramObject = nullptr;
@@ -30,6 +30,7 @@
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scene.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/misc/profiling.h>
namespace {
constexpr openspace::properties::Property::PropertyInfo IntensityInfo = {
@@ -115,6 +116,8 @@ SceneGraphLightSource::SceneGraphLightSource(const ghoul::Dictionary& dictionary
}
bool SceneGraphLightSource::initialize() {
ZoneScoped
_sceneGraphNode =
global::renderEngine.scene()->sceneGraphNode(_sceneGraphNodeReference);
return _sceneGraphNode != nullptr;
+3
View File
@@ -33,6 +33,7 @@
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/dictionary.h>
#include <ghoul/misc/invariants.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/misc/templatefactory.h>
#include <fstream>
@@ -118,6 +119,8 @@ void ModelGeometry::changeRenderMode(GLenum mode) {
}
bool ModelGeometry::initialize(Renderable* parent) {
ZoneScoped
float maximumDistanceSquared = 0;
for (const Vertex& v : _vertices) {
maximumDistanceSquared = glm::max(
@@ -40,6 +40,7 @@
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/crc32.h>
#include <ghoul/misc/defer.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/misc/templatefactory.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
@@ -604,6 +605,8 @@ bool RenderableLabels::isReady() const {
}
void RenderableLabels::initialize() {
ZoneScoped
bool success = true;// loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading objects labels data.");
+6 -1
View File
@@ -37,8 +37,9 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/misc/invariants.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/invariants.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
@@ -294,12 +295,16 @@ bool RenderableModel::isReady() const {
}
void RenderableModel::initialize() {
ZoneScoped
for (const std::unique_ptr<LightSource>& ls : _lightSources) {
ls->initialize();
}
}
void RenderableModel::initializeGL() {
ZoneScoped
_program = BaseModule::ProgramObjectManager.request(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
@@ -282,6 +282,8 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
}
void RenderableTrail::initializeGL() {
ZoneScoped
#ifdef __APPLE__
_programObject = BaseModule::ProgramObjectManager.request(
ProgramName,
+3
View File
@@ -31,6 +31,7 @@
#include <ghoul/fmt.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/profiling.h>
#include <string>
namespace {
@@ -444,6 +445,8 @@ FixedRotation::FixedRotation(const ghoul::Dictionary& dictionary)
}
bool FixedRotation::initialize() {
ZoneScoped
// We need to do this in the initialize and not the constructor as the scene graph
// nodes referenced in the dictionary might not exist yet at construction time. At
// initialization time, however, we know that they already have been created
@@ -34,6 +34,7 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/misc/templatefactory.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
@@ -235,6 +236,8 @@ bool RenderablePoints::isReady() const {
}
void RenderablePoints::initialize() {
ZoneScoped
bool success = loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading data");
@@ -242,6 +245,8 @@ void RenderablePoints::initialize() {
}
void RenderablePoints::initializeGL() {
ZoneScoped
// OBS: The ProgramObject name is later used to release the program as well, so the
// name parameter to requestProgramObject and the first parameter to
// buildRenderProgram has to be the same or an assertion will be thrown at the
@@ -27,6 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/textureunit.h>
#include <ghoul/opengl/texture.h>
@@ -49,6 +50,8 @@ GalaxyRaycaster::GalaxyRaycaster(ghoul::opengl::Texture& texture)
{}
void GalaxyRaycaster::initialize() {
ZoneScoped
_boundingBox.initialize();
}
@@ -40,6 +40,7 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
@@ -353,6 +354,8 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
}
void RenderableGalaxy::initialize() {
ZoneScoped
// Aspect is currently hardcoded to cubic voxels.
_aspect = static_cast<glm::vec3>(_volumeDimensions);
_aspect /= std::max(std::max(_aspect.x, _aspect.y), _aspect.z);
@@ -409,6 +412,8 @@ void RenderableGalaxy::initialize() {
}
void RenderableGalaxy::initializeGL() {
ZoneScoped
_texture = std::make_unique<ghoul::opengl::Texture>(
_volumeDimensions,
ghoul::opengl::Texture::Format::RGBA,
@@ -44,6 +44,8 @@ namespace openspace::globebrowsing::luascriptfunctions {
* Adds a layer to the specified globe.
*/
int addLayer(lua_State* L) {
ZoneScoped
ghoul::lua::checkArgumentsAndThrow(L, 3, "lua::addLayer");
// String arguments
@@ -31,6 +31,7 @@
#include <openspace/engine/moduleengine.h>
#include <openspace/engine/globals.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/opengl/ghoul_gl.h>
namespace openspace::globebrowsing {
@@ -45,6 +46,8 @@ AsyncTileDataProvider::AsyncTileDataProvider(std::string name,
, _rawTileDataReader(std::move(rawTileDataReader))
, _concurrentJobManager(LRUThreadPool<TileIndex::TileHashKey>(1, 10))
{
ZoneScoped
_globeBrowsingModule = global::moduleEngine.module<GlobeBrowsingModule>();
performReset(ResetRawTileDataReader::No);
}
@@ -187,6 +190,8 @@ bool AsyncTileDataProvider::shouldBeDeleted() {
}
void AsyncTileDataProvider::performReset(ResetRawTileDataReader resetRawTileDataReader) {
ZoneScoped
ghoul_assert(_enqueuedTileRequests.empty(), "No enqueued requests left");
// Reset raw tile data reader
@@ -39,6 +39,7 @@
#include <ghoul/font/fontrenderer.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/dictionary.h>
#include <ghoul/misc/profiling.h>
#include <ghoul/opengl/programobject.h>
#include <cstdlib>
#include <fstream>
@@ -322,6 +323,8 @@ GlobeLabelsComponent::GlobeLabelsComponent()
void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
globebrowsing::RenderableGlobe* globe)
{
ZoneScoped
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
+2
View File
@@ -374,6 +374,8 @@ Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict,
}
void Layer::initialize() {
ZoneScoped
if (_tileProvider) {
tileprovider::initialize(*_tileProvider);
}
+2
View File
@@ -114,6 +114,8 @@ int LayerGroup::update() {
}
Layer* LayerGroup::addLayer(const ghoul::Dictionary& layerDict) {
ZoneScoped
documentation::TestResult res = documentation::testSpecification(
Layer::Documentation(),
layerDict
@@ -33,6 +33,7 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/exception.h>
#include <ghoul/misc/profiling.h>
#ifdef _MSC_VER
#pragma warning (push)
@@ -423,6 +424,8 @@ RawTileDataReader::RawTileDataReader(std::string filePath,
, _initData(std::move(initData))
, _preprocess(preprocess)
{
ZoneScoped
initialize();
}
@@ -435,6 +438,8 @@ RawTileDataReader::~RawTileDataReader() {
}
void RawTileDataReader::initialize() {
ZoneScoped
if (_datasetFilePath.empty()) {
throw ghoul::RuntimeError("File path must not be empty");
}
@@ -443,6 +448,7 @@ void RawTileDataReader::initialize() {
std::string content = _datasetFilePath;
if (module.isWMSCachingEnabled()) {
ZoneScopedN("WMS Caching")
std::string c;
if (FileSys.fileExists(_datasetFilePath)) {
// Only replace the 'content' if the dataset is an XML file and we want to do
@@ -511,16 +517,19 @@ void RawTileDataReader::initialize() {
}
}
_dataset = static_cast<GDALDataset*>(GDALOpen(content.c_str(), GA_ReadOnly));
if (!_dataset) {
throw ghoul::RuntimeError("Failed to load dataset: " + _datasetFilePath);
{
ZoneScopedN("GDALOpen")
_dataset = static_cast<GDALDataset*>(GDALOpen(content.c_str(), GA_ReadOnly));
if (!_dataset) {
throw ghoul::RuntimeError("Failed to load dataset: " + _datasetFilePath);
}
}
// Assume all raster bands have the same data type
_rasterCount = _dataset->GetRasterCount();
// calculateTileDepthTransform
unsigned long long maximumValue = [t = _initData.glType]() {
unsigned long long maximumValue = [](GLenum t) {
switch (t) {
case GL_UNSIGNED_BYTE: return 1ULL << 8ULL;
case GL_UNSIGNED_SHORT: return 1ULL << 16ULL;
@@ -530,11 +539,9 @@ void RawTileDataReader::initialize() {
case GL_HALF_FLOAT: return 1ULL;
case GL_FLOAT: return 1ULL;
case GL_DOUBLE: return 1ULL;
default:
ghoul_assert(false, "Unknown data type");
throw ghoul::MissingCaseException();
default: throw ghoul::MissingCaseException();
}
}();
}(_initData.glType);
_depthTransform.scale = static_cast<float>(
@@ -554,7 +561,8 @@ void RawTileDataReader::initialize() {
}
double tileLevelDifference = calculateTileLevelDifference(
_dataset, _initData.dimensions.x
_dataset,
_initData.dimensions.x
);
const int numOverviews = _dataset->GetRasterBand(1)->GetOverviewCount();
@@ -198,6 +198,8 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary)
}
void RingsComponent::initialize() {
ZoneScoped
using ghoul::filesystem::File;
addProperty(_enabled);
@@ -257,6 +259,8 @@ bool RingsComponent::isReady() const {
}
void RingsComponent::initializeGL() {
ZoneScoped
compileShadowShader();
try {
@@ -227,6 +227,8 @@ bool ShadowComponent::isReady() const {
}
void ShadowComponent::initializeGL() {
ZoneScoped
createDepthTexture();
createShadowFBO();
}
@@ -824,6 +824,13 @@ bool initialize(TileProvider& tp) {
ghoul_assert(!tp.isInitialized, "TileProvider can only be initialized once.");
if (TileProvider::NumTileProviders > std::numeric_limits<uint16_t>::max()) {
LERRORC(
"TileProvider",
"Number of tile providers exceeds 65535. Something will break soon"
);
TileProvider::NumTileProviders = 0;
}
tp.uniqueIdentifier = TileProvider::NumTileProviders++;
if (TileProvider::NumTileProviders == std::numeric_limits<unsigned int>::max()) {
--TileProvider::NumTileProviders;
+1 -1
View File
@@ -76,7 +76,7 @@ struct TileProvider : public properties::PropertyOwner {
std::string name;
unsigned int uniqueIdentifier = 0;
uint16_t uniqueIdentifier = 0;
bool isInitialized = false;
};