Skip to content

submodules: bump coin for the annotation overlay restamp - #153

Closed
brianmk wants to merge 1 commit into
freecad-integratefrom
fix/vulkan-annotation-restamp
Closed

brianmk wants to merge 1 commit into
freecad-integratefrom
fix/vulkan-annotation-restamp

Conversation

@brianmk

@brianmk brianmk commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Picks up brianmk/coin e1ef24baf (in brianmk/coin#84): Vulkan: restamp annotation overlay commands on a camera-only replay.

The bug

Gui::So3DAnnotation — the node behind every PartDesign preview, datum label, placement indicator and transform draggger — records its subtree inline and then marks those commands SO_RENDERPASS_OVERLAY, while they stay in the retained main list. On a camera-only frame that list is replayed and the frame view is restamped into each command, but the restamp loop skipped every OVERLAY-pass command, on the assumption that overlay commands are the ones re-recorded each frame. The promoted annotation commands are not re-recorded, so they kept the previous camera's view matrix.

That matters because the backend does consume the per-command view matrix for overlay commands: SoVulkanRenderBackendWideLine.cpp expands an overlay command's wide lines on the CPU with command.viewMatrix (deliberately, so the NaviCube keeps its own camera — see the "edges/axes drift" comment there). A PartDesign preview's outline is a wide line set, so after a camera move its segments were expanded against the old camera and the preview was drawn where that camera had put it — the reported "draft preview isn't shown correctly, and doesn't update when moving the camera". Frames captured with the new presented-frame hook show exactly that (magenta preview geometry left behind at the previous pose).

Fix

Restamp by position instead of by pass: commands before mainCommandCount belong to the last main traversal (promoted annotations included) and get the current view whenever they still carry the previous one; the overlay/decoration commands appended after that region were recorded this frame and already have it. Sub-camera commands keep their own view. Measured with COIN_VULKAN_BACKEND_DEBUG=1 while a preview is open and the camera moves:

before: retained=17 retainedOverlay=8 staleOverlayBefore=8 staleOverlayAfter=8 restamped=9
after:  retained=17 retainedOverlay=8 staleOverlayBefore=8 staleOverlayAfter=0 restamped=17

retainedOverlay=8 are exactly the annotation-promoted preview commands; before the fix all 8 kept the old camera, after it none does.

Same failure mode in other tools (all go through So3DAnnotation)

  • PartDesign previews via PartGui::SoPreviewShape: Pad/Pocket (ViewProvider), Draft / Fillet / Chamfer / Thickness (ViewProviderDressUp), Pattern / Mirrored / MultiTransform (ViewProviderTransformed), Boolean, sketch-based features;
  • transform draggers / gizmos: Gizmo, SoTransformDragger, TaskTransform, ViewProviderDragger;
  • annotations/labels: ViewProviderDatum, SoDatumLabel, SoFCPlacementIndicatorKit, the viewer's own annotation.

Regression test

FreeCAD-DevTools fcprobe/vk_annotation_restamp_probe.py + .check.py (run with COIN_VULKAN_BACKEND_DEBUG=1): opens a Draft and a Fillet preview, moves the camera, and requires both that annotations were present (retainedOverlay > 0, so the check cannot pass vacuously) and that none was left stale (staleOverlayAfter == 0). It FAILS against the unfixed coin output (staleOverlayAfter=8) and passes with this bump.

Notes

Picks up brianmk/coin e1ef24baf: retained overlay commands promoted by
Gui::So3DAnnotation -- every PartDesign preview (Draft, Fillet/Chamfer,
Thickness, Pattern, Boolean), datum labels and the transform draggers -- were
replayed with the previous camera's view matrix after a camera move, so a
preview stayed where the old camera had put it until something forced a
re-record.

Fast-forward from the integration's 9dd90106, so it also carries the
retained-IR fixes that were already in the Vulkan stack's coin branch.
@brianmk
brianmk force-pushed the fix/vulkan-annotation-restamp branch from 71e1e24 to b33d4cd Compare October 11, 2026 22:53
@brianmk

brianmk commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #155: this PR's substance (coin -> 738926470, the annotation-overlay restamp) is already the coin pointer in chore/vulkan-audit-fixes; the child's coin commit 9dd901061 is an ancestor of 738926470 in brianmk/coin. Closing to keep one PR per concern - the branch can be deleted.

@brianmk brianmk closed this Oct 12, 2026
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