Skip to content

Vector Rendering Performance – Introduce viewport-aware geometry processing 5/7 - #92

Merged
pmeems merged 3 commits into
developmentfrom
phase5-viewport-aware-geometry
Nov 21, 2026
Merged

pmeems merged 3 commits into
developmentfrom
phase5-viewport-aware-geometry

Conversation

@pmeems

@pmeems pmeems commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

Large vector layers currently copy and prepare every feature before the first visible render, even when most features are outside the viewport.

Context

Phase 5 of the vector rendering performance plan adds OGR-backed spatial filtering at the Core/MapView boundary while preserving complete caller-prepared scenes.

Design

  • Filter automatically built layer scenes to the visible extent plus a 64-pixel margin.
  • Reuse a layer scene, its geometry, and its backend mesh identity while the viewport stays inside the processed extent.
  • Restore the source layer's previous OGR spatial filter and preserve cached full-layer extent and feature count metadata.
  • Add tests for intersection boundaries, invalid filters, small-pan reuse, off-screen exclusion, and diagnostics.

Dependencies

No new dependencies.

The shared Core architecture memory was updated with the verified viewport-filter and cache-coverage rules.

Validation

Debug/x64 CMake build succeeded. All 462 non-interactive CTest tests passed.

Larger pans or zoom-outs rebuild affected layer selections; incremental feature-level merging and tiling remain future work.

- Filter automatic MapView scenes through OGR spatial extents`n- Reuse padded scenes during small viewport changes`n- Cover filtering, cache reuse, and diagnostics with tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical exception-safety flaw can leave an interrupted viewport refresh marked current, causing subsequent scene requests to return an old selection that omits visible features.

3 open issues
What changed in this PR

Implements Phase 5 of the vector rendering performance plan by adding viewport-aware scene preparation to Core’s MapView, while preserving complete caller-prepared scenes.

Changes:

  • Selects features through an OGR spatial filter with a 64-pixel viewport margin.
  • Reuses cached geometry within that margin and rebuilds affected selections beyond it.
  • Adds filtering, cache-reuse, and diagnostics tests, plus architecture documentation.

Builds and tests were not run during this review; the PR reports a successful Debug/x64 build and 462 passing non-interactive tests.

File Description
tests/​MapWinGIS.Core.Tests/​VectorRenderSceneTests.cpp Tests boundary filtering and invalid extents.
tests/​MapWinGIS.Core.Tests/​PerformanceDiagnosticsTests.cpp Tests counts of features excluded by filtering.
tests/​MapWinGIS.Core.Tests/​MapViewTests.cpp Tests viewport selection, small-pan reuse, and prepared scenes.
src/​MapWinGIS.Core/​src/​vector/​VectorDataset.cpp Applies temporary spatial filters and preserves metadata caches.
src/​MapWinGIS.Core/​src/​rendering/​VectorRenderScene.cpp Validates filters and computes selected geometry bounds.
src/​MapWinGIS.Core/​src/​map/​MapView.cpp Tracks cache coverage and refreshes viewport selections.
src/​MapWinGIS.Core/​src/​internal/​VectorLayerAccess.h Adds an optional filter to geometry traversal.
src/​MapWinGIS.Core/​include/​mapwingis/​rendering/​VectorRenderScene.h Exposes spatial-filter options and documents their contract.
src/​MapWinGIS.Core/​include/​mapwingis/​map/​MapView.h Documents viewport caching and defines the margin.
docs/​ARCHITECTURE.md Describes filtered scenes and cache reuse.
.github/​plans/​Vector-Rendering-Performance-Improvement.md Records Phase 5 completion and limitations.
.ai/​memory/​architecture/​core-library.md Records filtering and metadata-preservation rules.

Review effort: Balanced

Comment thread src/MapWinGIS.Core/src/map/MapView.cpp Resolved
Comment thread docs/ARCHITECTURE.md Resolved
pmeems and others added 2 commits November 21, 2026 12:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Keep interrupted viewport scene refreshes marked stale for retry

- Cover restored filters, cursors, metadata caches, and unfiltered reads

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pmeems pmeems changed the title MapWinGIS6 – Vector Rendering Performance Improvement Plan – Phase 5 – Introduce viewport-aware geometry processing Vector Rendering Performance – Introduce viewport-aware geometry processing 5/7 Nov 21, 2026
@pmeems
pmeems enabled auto-merge (squash) November 21, 2026 11:28
@pmeems
pmeems merged commit fde63ca into development Nov 21, 2026
17 checks passed
@pmeems
pmeems deleted the phase5-viewport-aware-geometry branch November 21, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants