Skip to content

Vulkan: export the renderer capability and cut the fork's debug dev tools - #74

Merged
brianmk merged 1 commit into
coin-Integratefrom
chore/vulkan-upstream-hardening
Sep 30, 2026
Merged

brianmk merged 1 commit into
coin-Integratefrom
chore/vulkan-upstream-hardening

Conversation

@brianmk

@brianmk brianmk commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Upstream-readiness pass over the retained-IR / Vulkan backend.

Public capability

  • basic.h.cmake.in now exports COIN_HAVE_VULKAN_RENDERER (mirroring COIN_HAVE_LEGACY_GL_RENDERER); the public Vulkan headers gate on it instead of the private COIN_BUILD_VULKAN_RENDERER build flag, so an installed Coin tells consumers what it was built with. basic.h.in (non-CMake) defines it to 0.

Build hygiene

  • Removed the build-wide -DNOMINMAX; the Windows min/max macros are suppressed locally via SoVulkanPlatform.h only in the TUs that include <vulkan/vulkan.h>.
  • C++17 is no longer global: the Vulkan sources compile through a dedicated vulkanrendering object library with cxx_std_17; core/legacy-GL and every other target stay at Coin's default standard. Verified: rendering = gnu++11, vulkanrendering = gnu++17.

ABI

  • SoNode::IRRender is now appended at the end of the vtable instead of being inserted between the other action methods (which shifted every later slot). Adding a virtual is still an ABI break (all consumers — Pivy, FreeCAD, third-party nodes — must recompile, and SOVERSION should be bumped for a release).
  • Removed the dead SoVulkanRenderManager::getBackend() that returned a pointer to the internal SoVulkanRenderBackend (no callers), tightening the public/internal boundary.
  • Removed the dead SoDrawList::restrikeLighting shim.

Error handling

  • SoVulkanResult.h's SoVulkan::Result is an unrelated internal status type; there is no central VK_CHECK. Audit found no assert()/abort() failure paths (only static_assert + runtime checks), and the frame-path VkResult returns that were ignored (beginFrame / waitForInFlightFrames vkWaitForFences/vkResetFences, and vkCreateImageView) are now checked and logged.

Debug consolidation

  • Renderer env vars renamed FC_VULKAN_* -> COIN_VULKAN_*; debug output routed through SoVulkanDebug::post(); the ad-hoc FC_VULKAN_CLIP_DEBUG per-command tracing removed.

Testing

  • build-coin (standalone, C++11 default) and build-freecad (bundled) both build clean.

Prepare the retained-IR / Vulkan backend for upstream:

- Export the renderer capability from the generated public header:
  basic.h.cmake.in now defines COIN_HAVE_VULKAN_RENDERER alongside
  COIN_HAVE_LEGACY_GL_RENDERER, and the public Vulkan headers
  (SoVulkanRenderManager.h, SoVulkanRenderTarget.h, SoVulkanImageCopy.h) gate
  their declarations on it instead of the private COIN_BUILD_VULKAN_RENDERER
  build flag.  An installed Coin now tells consumers what it was built with.
- Drop the build-wide -DNOMINMAX; suppress the Windows min/max macros locally
  in the translation units that pull in <vulkan/vulkan.h> (SoVulkanPlatform.h).
- Scope C++17 to a dedicated vulkanrendering object library instead of raising
  CMAKE_CXX_STANDARD for the whole build; the core and legacy-GL paths stay at
  Coin's default standard.
- ABI: append SoNode::IRRender to the end of the vtable rather than inserting
  it between the other action methods (which shifted every later slot), and
  remove the dead SoVulkanRenderManager::getBackend() that leaked the internal
  SoVulkanRenderBackend type.
- Remove the dead SoDrawList::restrikeLighting compatibility shim.
- Check the previously-ignored VkResult returns on the frame path
  (beginFrame / waitForInFlightFrames) and surface vkCreateImageView failures.

Also consolidate the fork's debugging: rename the renderer env vars
FC_VULKAN_* -> COIN_VULKAN_*, route output through SoVulkanDebug::post(), and
drop the ad-hoc FC_VULKAN_CLIP_DEBUG tracing from the per-command path.
@brianmk brianmk changed the title Vulkan: export the renderer capability and cut the fork's debug ballast Vulkan: export the renderer capability and cut the fork's debug dev tools Sep 30, 2026
@brianmk
brianmk merged commit c1970d0 into coin-Integrate Sep 30, 2026
6 checks passed
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.

1 participant