Commit bd8923c
fix(crash): Keep macOS GPU-spectrum PSK map on a raster viewport (#5623)
## Summary
Split from [#5595](#5595):
opening **PSK Reporter** on macOS in an `AETHER_GPU_SPECTRUM` build can
crash when the flat map attaches a `QOpenGLWidget` viewport.
The GUI thread re-enters `WaveformWidget::renderGpuFrame()` through a
backing-store repaint while `QAbstractScrollArea::setViewport()` is
attaching the map OpenGL viewport. The failure is in
`QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder()`.
This PR keeps the flat map on `QGraphicsView`'s **raster** viewport when
both `Q_OS_MAC` and `AETHER_GPU_SPECTRUM` are set. Other platforms and
non-GPU-spectrum builds still request `OpenGlIfAvailable`.
### What this trades
`AETHER_GPU_SPECTRUM` defaults ON and `macos-dmg.yml` ships it ON, so
this reaches every released macOS build. The OpenGL viewport was added
for a stated reason — moving the weather-radar mesh's many transformed
image samples off the GUI-thread raster paint engine
(`MapView.cpp:151-155`) — and macOS gives that up here: **flat-map
radar-playback smoothness is traded for not crashing.** Linux, Windows
and CPU-spectrum macOS are unchanged and keep the OpenGL viewport.
## Review follow-ups
A second commit addresses the review nits:
- **`flatControllerLoopRetainsEveryPaint()` now `QSKIP`s under the same
condition.** That case asserts the flat map owns a `QOpenGLWidget`;
under `Q_OS_MAC && AETHER_GPU_SPECTRUM` it owns none. It passes today
only because the registered target does not define `AETHER_GPU_SPECTRUM`
— so it would have failed for anyone compiling the map sources the way
the app is compiled, reading as a regression rather than as the intended
raster path.
- **`MapView`'s ctor now states why the raster path keeps Qt's default
`MinimalViewportUpdate`** rather than the `SmartViewportUpdate` that
`fallBackToRasterViewport()` installs: that path is undoing the
`FullViewportUpdate` set for a failed OpenGL viewport, so Smart is a
correction there rather than a tuned optimum, and a viewport that was
never Full has nothing to correct.
## Constitution principle honored
Principle XI — Fixes Are Demonstrated: the crash was observed on a
GPU-spectrum macOS build while exercising PSK Reporter during #5595;
this isolates the viewport change reviewers asked to keep out of the
menu PR.
## Test plan
- [x] Local RelWithDebInfo build with GPU spectrum enabled (`cmake
--build build -j22 --target AetherSDR`)
- [x] Open PSK Reporter on macOS GPU-spectrum build with a live
panadapter/WAVE scope — must not crash — *@jensenpat, live retest on the
GPU-spectrum test Mac: no crash, flat map came up and stayed usable*
- [x] Pan/zoom the flat map; city lights / weather radar overlays still
draw — *@K5PTB ran `weather_radar_loading_test` on macOS arm64 with
`AETHER_GPU_SPECTRUM` added, i.e. the raster branch this PR selects: 32
passed / 5 skipped, covering radar playback, rolling history, export and
progressive zoom*
- [x] Linux/Windows (or macOS without `AETHER_GPU_SPECTRUM`) still use
the OpenGL viewport path — *preprocessed with the real `AetherSDR`
target flags and `AETHER_GPU_SPECTRUM` defined; the function reduces to
`return MapView::ViewportMode::OpenGlIfAvailable;`, isolating `Q_OS_MAC`
as the discriminator*
- [ ] Toggle the PSK map to **Globe** projection on a macOS GPU-spectrum
build with a live panadapter — `GlobeMapView` is a `QOpenGLWidget` and,
after this change, the only GL surface the app can still realize in that
configuration. Pre-existing behavior, not a regression from this PR.
## Checklist
- [x] Commits are signed
- [x] No new flat-key `AppSettings` calls
- [x] Clean-room — Qt viewport selection only
---------
Co-authored-by: Jeremy [KK7GWY] <kk7gwy@aethersdr.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 996b367 commit bd8923c
3 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
59 | 75 | | |
60 | | - | |
61 | | - | |
| 76 | + | |
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
764 | 775 | | |
765 | 776 | | |
766 | 777 | | |
| |||
0 commit comments