#pragma once #include #include #include #include namespace mbgl { enum class RenderSegmentStrategy : uint8_t { Retained, Continuous }; inline const char* renderSegmentStrategyText(RenderSegmentStrategy strategy) noexcept { return strategy == RenderSegmentStrategy::Retained ? "RETAINED" : "CONTINUOUS"; } struct RenderSegmentDefinition { RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous; std::optional startLayerId; bool operator==(const RenderSegmentDefinition&) const = default; }; struct RenderSegmentPlan { uint32_t schemaVersion = 1; std::vector segments; bool operator==(const RenderSegmentPlan&) const = default; }; struct StyleLayerDiagnostics { int32_t layerIndex = -1; std::string layerId; std::string layerType; bool visible = false; std::optional sourceId; std::optional sourceLayer; bool operator==(const StyleLayerDiagnostics&) const = default; }; struct RenderSegmentCacheDiagnostics { std::string cacheState{"disabled"}; uint64_t contentRevision = 0; uint64_t build = 0; uint64_t reuse = 0; uint64_t invalidation = 0; std::string lastInvalidationReason{"none"}; uint64_t textureCreate = 0; uint64_t compositeCreate = 0; uint64_t resourceRelease = 0; }; struct RenderSegmentDiagnosticsEntry { uint32_t segmentIndex = 0; RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous; std::optional configuredStartLayerId; int32_t beginIndex = -1; int32_t endExclusive = -1; std::optional resolvedStartLayerId; std::optional resolvedEndLayerId; std::vector layers; std::optional cache; }; struct RenderSegmentDiagnostics { uint32_t schemaVersion = 1; bool enabled = true; bool configured = false; bool valid = false; std::string configSource{"unconfigured/legacy"}; uint64_t configRevision = 0; uint64_t topologyRevision = 0; uint32_t styleLayerCount = 0; uint32_t segmentCount = 0; uint32_t retainedSegmentCount = 0; uint32_t continuousSegmentCount = 0; bool coverageComplete = false; bool fallback = false; std::string lastReason{"not-configured"}; bool fastPathEligible = false; bool fastPathActive = false; std::string fastPathFallbackReason{"no-prepared-tree"}; uint64_t fastPathHit = 0; uint64_t fastPathMiss = 0; uint64_t fullCpuFrame = 0; std::vector styleLayers; std::vector segments; }; struct ResolvedRenderSegment { uint32_t segmentIndex = 0; RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous; std::optional configuredStartLayerId; int32_t beginIndex = 0; int32_t endExclusive = 0; bool operator==(const ResolvedRenderSegment&) const = default; }; struct ResolvedRenderSegmentPlan { bool configured = false; bool valid = false; std::string configSource{"unconfigured/legacy"}; uint64_t configRevision = 0; std::string reason{"not-configured"}; int32_t layerCount = 0; std::vector segments; bool operator==(const ResolvedRenderSegmentPlan&) const = default; }; } // namespace mbgl