Repository navigation
cvcGL: VolumeNode turns VTK's FinishEveryRender off (no glFinish per still volume render) - #1327
Merged
Merged
Conversation
…s it VTK's GPU volume ray caster ends every render with glFinish() for a timer only an auto-adjusting render uses; in terrain_lab that wait was about 25 ms of a 45 ms frame. cvcpkg's VTK (cy-pca/cvcpkg#625: vtk 9.5.0+cvc.5, written for upstream) adds an opt-in vtkGPUVolumeRayCastMapper::FinishEveryRender, and vtkSmartVolumeMapper's, forwarded to its GPU mapper. VolumeNode's mapper and scene_views' twin turn it off: a still render queues its ray cast and returns; an interactive render still waits, as it adjusts its sample distance by its time. No process-wide state. A compile check (check_cxx_source_compiles against VTK::RenderingVolumeOpenGL2) defines CVC_VTK_HAS_FINISH_EVERY_RENDER, so libcvc still builds, and renders as before, against an unpatched VTK. cvcgl_volume_finish: the VolumeNode's mapper has it off, and the pixels are byte-identical with it off and on (only with the define; otherwise it checks that the volume draws).
…red against the patched VTK
…igure
The check linked a whole VTK program, so a link that failed for another
reason (a wasm one, say) would have turned the property off silently; a
static-library try_compile compiles the header's declaration and links
nothing. Its cached answer is also dropped before each configure: VTK's
version stays 9.5.0 across cvcpkg's revisions, so a build directory
configured against vtk 9.5.0+cvc.3 would otherwise keep "no" after the
prefix gets cvc.5.
Checked by reconfiguring a build against the patched VTK ("has
FinishEveryRender") and one against the catalog's ("no FinishEveryRender").
transfix
enabled auto-merge (squash)
November 16, 2026 22:28
master fails to build arisrvx's python_engine.cpp: #1302 (bridged users) added room(), bridge_presence(), bridge_absent(), bridge_post() and listen_chat() calling server_link() with no argument, written against the process-wide server link that the P0a cleanup replaced with the module's own state, server_link(PyObject *self). Each of the five now names its module argument self and passes it, as the other server ops (lent(), publish(), ...) already do. Found in #1324's pycvc-linux / cp312 job (run 43956686020), which builds the PR merged with master.
The realize suite runs every node type's checks in one process. In a Linux Debug job (Xvfb, llvmpipe) it took 250.6 s, 50 s under the 300 s a test without a TIMEOUT gets; on a slower runner (#1309's Debug job, where PhConvoy and Ewave also ran about 1.3x longer) it timed out on all three attempts. As cvcgl_ewave, cvcgl_wake and cvcgl_volren_node have, it gets a budget of its own with headroom, so only a real hang fails it.
…y-render: master's arisrvx build
…-render: realize's Debug timeout
…-finish-every-render # Conflicts: # docs/roadmap/RENDER_PERF_ROADMAP.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VolumeNode now turns off VTK's
FinishEveryRender(a new opt-in VTK property, below), wherever the VTK it builds against has it. There is no process-wide state.Why
VTK's GPU volume ray caster ends every render with
glFinish(). That lets its timer measure the GPU's work, but only an auto-adjusting render (an interactive one) uses that time. Every still render pays for the wait anyway: the CPU waits for the whole frame queued so far, so the CPU's and the GPU's times add instead of overlapping.The first fix, in #1324, swapped glad's
glFinishpointer. That is process-wide state, so Joe asked for the fix to go into VTK instead, and it was reverted there.cy-pca/cvcpkg#625 patches cvcpkg's VTK (vtk 9.5.0+cvc.5); the patch is written to go upstream:
vtkGPUVolumeRayCastMapper::FinishEveryRender, plus the same property onvtkSmartVolumeMapper, forwarded to its GPU mapper.Changes
src/cvcGL/CMakeLists.txt:check_cxx_source_compilesagainstVTK::RenderingVolumeOpenGL2definesCVC_VTK_HAS_FINISH_EVERY_RENDERwhenvtkSmartVolumeMapperhasFinishEveryRenderOff(). libcvc still builds against an unpatched VTK and renders as before. The check only compiles (a static-librarytry_compile), so a link failing for another reason cannot turn it off, and it runs again at every configure, because VTK's version stays 9.5.0 across cvcpkg's revisions. Configure printscvcGL: VTK has FinishEveryRender; VolumeNode turns it offorcvcGL: VTK has no FinishEveryRender; volume renders keep VTK's glFinish.scene_views' twin mapper: both callFinishEveryRenderOff()under that define.cvcgl_volume_finish:Measured
Setup:
cvcpkg build vtk --localinto a copy of the deps prefix.arigl run): whole framerender()AriRuntime::frame()arigl snapshot's path): whole framerender()255194a985ec7f24) in all eight runs, on and off.AriRuntime::frame()grows. Probably GL calls there now wait for part of the GPU work that the volume'sglFinishused to wait for. Not profiled.Tests
Against the patched VTK, all pass:
Against the published, unpatched VTK (libcvc's usual prefix), the branch builds, configure prints
cvcGL: VTK has no FinishEveryRender; volume renders keep VTK's glFinish, and cvcgl_volume_finish passes on its fallback (the volume draws).VTK version
libcvc does not pin VTK: CI runs
cvcpkg install vtk, which takes the catalog's latest. cy-pca/cvcpkg#625 is merged and vtk 9.5.0+cvc.5 is being published, so CI picks it up with no change here. Until then CI builds against cvc.3/cvc.4 and runscvcgl_volume_finishon its fallback. A local prefix needscvcpkg install vtkagain to get cvc.5.