ifcviewer: move configureSurface into ViewportCore (#84-u)

The swapchain configuration path — WGPU_PRESENT_MODE handling,
mode-preference order (Mailbox / Immediate / FifoRelaxed / Fifo),
caps probe, cfg.alphaMode wiring, and the on-resize depth + MSAA +
HiZ texture reallocation + bind-group invalidation — all move to
ViewportCore. The only VW-side concern was a QString::fromLatin1 in
the advertised-modes log, which becomes a std::string concat with the
same output.

ViewportWindow's render() / resizeEvent / surface-outdated retry paths
call core_.configureSurface() now. createSurface() (which returns the
platform-specific WGPUSurface from the host) stays VW because Qt
platform discovery has to happen on the Qt side.
This commit is contained in:
Dion Moult
2026-06-06 18:52:49 +10:00
parent 346e6db217
commit 78ce993a11
4 changed files with 147 additions and 161 deletions
+10
View File
@@ -323,6 +323,16 @@ public:
void uploadInstanceChunk(const InstanceChunk& chunk);
void finalizeModel(std::uint32_t model_id);
// ---- Surface configuration (#84-u) ------------------------------------
//
// Configure the swapchain at the given physical size. Picks a present
// mode from caps + preference order (Mailbox → Immediate → FifoRelaxed
// → Fifo, overridable via WGPU_PRESENT_MODE), reconfigures the
// surface, then (re)allocates the depth + MSAA color + HiZ resolve
// textures and invalidates the HiZ + edge bind groups so they
// rebuild against the new depth view on next encode.
void configureSurface(int width_px, int height_px);
// ---- HiZ + framebuffer attachments (#84-r) ----------------------------
//
// Build the HiZ resolve pipeline (and shader module + BGL + uniform