Some small improvements

This commit is contained in:
Alexander Bock
2020-08-13 14:02:02 +02:00
parent 760c34660f
commit a6ca95347c
3 changed files with 14 additions and 4 deletions

View File

@@ -48,8 +48,7 @@ struct ProviderTileKey {
unsigned int providerID;
bool operator==(const ProviderTileKey& r) const {
return (providerID == r.providerID) &&
(tileIndex == r.tileIndex);
return (providerID == r.providerID) && (tileIndex == r.tileIndex);
}
};

View File

@@ -275,6 +275,8 @@ tilesAndSettingsUnsorted(const LayerGroup& layerGroup, const TileIndex& tileInde
}
BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager& lm) {
ZoneScoped
using ChunkTileSettingsPair = std::pair<ChunkTile, const LayerRenderSettings*>;
BoundingHeights boundingHeights { 0.f, 0.f, false, true };
@@ -337,6 +339,8 @@ BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager&
}
bool colorAvailableForChunk(const Chunk& chunk, const LayerManager& lm) {
ZoneScoped
using ChunkTileSettingsPair = std::pair<ChunkTile, const LayerRenderSettings*>;
const LayerGroup& colormaps = lm.layerGroup(layergroupid::GroupID::ColorLayers);
std::vector<ChunkTileSettingsPair> chunkTileSettingPairs = tilesAndSettingsUnsorted(
@@ -359,6 +363,8 @@ std::array<glm::dvec4, 8> boundingCornersForChunk(const Chunk& chunk,
const Ellipsoid& ellipsoid,
const BoundingHeights& heights)
{
ZoneScoped
// assume worst case
const double patchCenterRadius = ellipsoid.maximumRadius();
@@ -2490,6 +2496,7 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data) {
// children and then again it self to be processed after the children finish).
// In addition, this didn't even improve performance --- 2018-10-04
if (isLeaf(cn)) {
ZoneScopedN("leaf")
updateChunk(cn, data);
if (cn.status == Chunk::Status::WantSplit) {
@@ -2503,6 +2510,7 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data) {
return cn.status == Chunk::Status::WantMerge;
}
else {
ZoneScopedN("!leaf")
char requestedMergeMask = 0;
for (int i = 0; i < 4; ++i) {
if (updateChunkTree(*cn.children[i], data)) {
@@ -2528,6 +2536,8 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data) {
}
void RenderableGlobe::updateChunk(Chunk& chunk, const RenderData& data) const {
ZoneScoped
const BoundingHeights& heights = boundingHeightsForChunk(chunk, _layerManager);
chunk.heightTileOK = heights.tileOK;
chunk.colorTileOK = colorAvailableForChunk(chunk, _layerManager);

View File

@@ -923,16 +923,17 @@ Tile tile(TileProvider& tp, const TileIndex& tileIndex) {
return Tile{ nullptr, std::nullopt, Tile::Status::OutOfRange };
}
const cache::ProviderTileKey key = { tileIndex, t.uniqueIdentifier };
const Tile tile = t.tileCache->get(key);
Tile tile = t.tileCache->get(key);
if (!tile.texture) {
TracyMessage("Enqueuing tile", 32);
t.asyncTextureDataProvider->enqueueTileIO(tileIndex);
}
return tile;
}
else {
return Tile{ nullptr, std::nullopt, Tile::Status::Unavailable };
return Tile { nullptr, std::nullopt, Tile::Status::Unavailable };
}
}
case Type::SingleImageTileProvider: {