Apply just the changes from the MLT branch which aren't really part of that work (#3793)

This commit is contained in:
Tim Sylvester
2025-09-11 16:39:58 -07:00
committed by GitHub
parent 921251b973
commit bc025fca49
44 changed files with 181 additions and 123 deletions

View File

@@ -40,7 +40,7 @@ public:
const ImagePositions&,
const PatternLayerMap&,
std::size_t,
const CanonicalTileID&) {};
const CanonicalTileID&) {}
virtual void update(const FeatureStates&, const GeometryTileLayer&, const std::string&, const ImagePositions&) {}

View File

@@ -13,12 +13,14 @@ DebugBucket::DebugBucket(const OverscaledTileID& id,
const bool complete_,
std::optional<Timestamp> modified_,
std::optional<Timestamp> expires_,
MapDebugOptions debugMode_)
MapDebugOptions debugMode_,
std::string sourceName_)
: renderable(renderable_),
complete(complete_),
modified(std::move(modified_)),
expires(std::move(expires_)),
debugMode(debugMode_) {
debugMode(debugMode_),
sourceName(std::move(sourceName_)) {
auto addText = [&](const std::string& text, double left, double baseline, double scale) {
for (uint8_t c : text) {
if (c < 32 || c >= 127) continue;
@@ -53,7 +55,8 @@ DebugBucket::DebugBucket(const OverscaledTileID& id,
const std::string text = util::toString(id) + " - " +
(complete ? "complete"
: renderable ? "renderable"
: "pending");
: "pending") +
" " + sourceName;
addText(text, 50, baseline, 5);
baseline += 200;
}

View File

@@ -22,7 +22,8 @@ public:
bool complete,
std::optional<Timestamp> modified,
std::optional<Timestamp> expires,
MapDebugOptions);
MapDebugOptions,
std::string sourceName);
void upload(gfx::UploadPass&);
@@ -31,6 +32,7 @@ public:
const std::optional<Timestamp> modified;
const std::optional<Timestamp> expires;
const MapDebugOptions debugMode;
const std::string sourceName;
gfx::VertexVector<FillLayoutVertex> vertices;
gfx::IndexVector<gfx::Lines> indices;

View File

@@ -428,12 +428,13 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
}
// Prepare. Update all matrices and generate data that we should upload to the GPU.
for (const auto& entry : renderSources) {
for (const auto& [name, renderSource] : renderSources) {
MLN_TRACE_ZONE(prepare source);
if (entry.second->isEnabled()) {
entry.second->prepare({.transform = renderTreeParameters->transformParams,
if (renderSource->isEnabled()) {
renderSource->prepare({.transform = renderTreeParameters->transformParams,
.debugOptions = updateParameters->debugOptions,
.imageManager = *imageManager});
.imageManager = *imageManager,
.sourceName = name});
}
}

View File

@@ -43,6 +43,7 @@ public:
const TransformParameters& transform;
const MapDebugOptions& debugOptions;
const ImageManager& imageManager;
const std::string sourceName;
};
using RenderTiles = std::shared_ptr<const std::vector<std::reference_wrapper<const RenderTile>>>;

View File

@@ -120,8 +120,13 @@ void RenderTile::prepare(const SourcePrepareParameters& parameters) {
(!debugBucket || debugBucket->renderable != tile.isRenderable() || debugBucket->complete != tile.isComplete() ||
!(debugBucket->modified == tile.modified) || !(debugBucket->expires == tile.expires) ||
debugBucket->debugMode != parameters.debugOptions)) {
debugBucket = std::make_unique<DebugBucket>(
tile.id, tile.isRenderable(), tile.isComplete(), tile.modified, tile.expires, parameters.debugOptions);
debugBucket = std::make_unique<DebugBucket>(tile.id,
tile.isRenderable(),
tile.isComplete(),
tile.modified,
tile.expires,
parameters.debugOptions,
parameters.sourceName);
} else if (parameters.debugOptions == MapDebugOptions::NoDebug) {
debugBucket.reset();
}