mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 04:31:08 -06:00
Some small improvements
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user