Add basic instrumentation options to the renderengine and globebrowsing module

Instrumentation is disabled on default, but can be enabled in CMake
This commit is contained in:
Alexander Bock
2019-07-19 09:55:41 +02:00
parent 2a30b499d8
commit fc28b98db9
16 changed files with 255 additions and 26 deletions
+9 -3
View File
@@ -162,15 +162,17 @@ void initAsyncTileDataReader(DefaultTileProvider& t, TileTextureInitData initDat
);
}
void initTexturesFromLoadedData(DefaultTileProvider& t) {
bool initTexturesFromLoadedData(DefaultTileProvider& t) {
if (t.asyncTextureDataProvider) {
std::optional<RawTile> tile = t.asyncTextureDataProvider->popFinishedRawTile();
if (tile) {
const cache::ProviderTileKey key = { tile->tileIndex, t.uniqueIdentifier };
ghoul_assert(!t.tileCache->exist(key), "Tile must not be existing in cache");
t.tileCache->createTileAndPut(key, std::move(tile.value()));
return true;
}
}
return false;
}
@@ -1073,7 +1075,7 @@ TileDepthTransform depthTransform(TileProvider& tp) {
void update(TileProvider& tp) {
int update(TileProvider& tp) {
switch (tp.type) {
case Type::DefaultTileProvider: {
DefaultTileProvider& t = static_cast<DefaultTileProvider&>(tp);
@@ -1082,7 +1084,7 @@ void update(TileProvider& tp) {
}
t.asyncTextureDataProvider->update();
initTexturesFromLoadedData(t);
bool hasUploaded = initTexturesFromLoadedData(t);
if (t.asyncTextureDataProvider->shouldBeDeleted()) {
t.asyncTextureDataProvider = nullptr;
@@ -1091,6 +1093,9 @@ void update(TileProvider& tp) {
tileTextureInitData(t.layerGroupID, t.padTiles, t.tilePixelSize)
);
}
if (hasUploaded) {
return 1;
}
break;
}
case Type::SingleImageTileProvider:
@@ -1132,6 +1137,7 @@ void update(TileProvider& tp) {
default:
throw ghoul::MissingCaseException();
}
return 0;
}