Skip to content

Gui/Vulkan: rescale camera-dependent datum scenes on zoom - #117

Merged
brianmk merged 2 commits into
freecad-integratefrom
fix/vulkan-camera-dependent-replay
Sep 28, 2026
Merged

brianmk merged 2 commits into
freecad-integratefrom
fix/vulkan-camera-dependent-replay

Conversation

@brianmk

@brianmk brianmk commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Fixes the sketch/Body origin planes not rescaling while zooming under Vulkan (they only updated when a hover forced a re-record).

Cause. The retained-IR replay reuses the cached main draw list on a camera-only frame. That is only sound when every recorded command is camera-independent; the screen-constant-size origin planes/axes (SoShapeScale) and SoAutoZoomTranslation bake a view-volume-derived scale into the retained list, so a zoom replayed the previous camera's scale.

Fix.

  • FreeCAD: mark these nodes camera-dependent on the IR action (SoIRRenderAction::setCameraDependent) from their doAction().
  • coin: bump the submodule to the matching manager change (Vulkan: re-record camera-dependent scenes instead of replaying coin#66) that refuses the camera-only replay for such scenes.
  • Also reset the external GPU-timer query pool before vkCmdBeginRenderPass so the [RTDBG] gpuTiming renderPass= lines actually emit (follow-up to coin#65).

Verified (build-perf): box-only scene still replays on zoom (apply=0.00 ×7); datum/origin scene now re-records on zoom (apply>0), so the planes rescale; gpuTiming renderPass= lines appear.

The Vulkan retained-IR replay reuses the cached main draw list on a
camera-only frame, which is only sound when every recorded command is
camera-independent.  The screen-constant-size origin planes/axes
(SoShapeScale) and SoAutoZoomTranslation bake a view-volume-derived scale
into the retained list, so on a zoom the replay kept the previous camera's
scale until an unrelated change (e.g. a hover) forced a re-record.

Mark these nodes camera-dependent on the IR action
(SoIRRenderAction::setCameraDependent) and bump coin to the manager change
that refuses the camera-only replay for such scenes.  Verified: a box-only
scene still replays (apply=0.00) on zoom; a datum/origin scene re-records.
… pass

vkCmdResetQueryPool may not be recorded inside a render pass, so reset the
pool before vkCmdBeginRenderPass; the backend scopes then emit the
[RTDBG] gpuTiming renderPass=<ms> lines (otherwise inert).
@brianmk
brianmk merged commit f155a8d into freecad-integrate Sep 28, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant