Skip to content

Fixes and optimizations#611

Merged
johguenther merged 8 commits intodevelfrom
guj/fixes
Mar 18, 2026
Merged

Fixes and optimizations#611
johguenther merged 8 commits intodevelfrom
guj/fixes

Conversation

@johguenther
Copy link
Copy Markdown
Contributor

split from #603

  • Fix initialization of OpenGL on OSX
  • Optimized computation of Sobol dim2, +1% overall perf
  • Remove end caps of cone/cylinder curve

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several small fixes and performance/behavior tweaks across build configuration, sampling math, geometry behavior, and documentation.

Changes:

  • Fix macOS OpenGL initialization by using the correct Apple preprocessor macro in GLFW windows.
  • Optimize Sobol (dim2+) sampling by computing the first Sobol component algorithmically and shrinking the precomputed reverse matrices.
  • Remove end caps for OSP_DISJOINT cone/cylinder curves by setting Embree curve neighbor flags.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/superbuild/README.md Updates superbuild option docs to drop “beta” wording for GPU support.
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Removes explicit tutorial light setup for the mpiRaycast renderer.
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fixes macOS OpenGL context hint guard (__APPLE__).
modules/cpu/math/sobol.inl Shrinks Sobol_revMatrices to 3×32 to match the new sampling approach.
modules/cpu/math/sobol.ih Adds Sobol_revSample1() and rewires Sobol_revSample{2,3,4} to use it.
modules/cpu/geometry/SpheresShared.h Removes unused global_radius field from shared spheres struct.
modules/cpu/geometry/Curves.h Adds capData storage to back Embree flags buffer lifetime.
modules/cpu/geometry/Curves.cpp Disables caps for OSP_DISJOINT by populating Embree RTC_BUFFER_TYPE_FLAGS.
modules/cpu/CMakeLists.txt Updates CMake option text to drop “beta” wording for GPU module.
doc/api.md Documentation tweaks (VTK legacy indexing text, GPU section heading/known-issues list).
cmake/ospray_cmake_config/osprayConfig.cmake.in Adds /Zc:__cplusplus for consumers on newer MSVC.
cmake/compiler/msvc.cmake Adds /Zc:__cplusplus to OSPRay’s own MSVC compile flags.
apps/ospTestSuite/test_enums.cpp Adds a size check for OSPUnstructuredCellType.
apps/ospExamples/GLFWOSPRayWindow.cpp Fixes macOS OpenGL context hint guard (__APPLE__).
CHANGELOG.md Formats and notes bug fixes/perf improvements including macOS OpenGL init and disjoint curve caps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles a small set of fixes and optimizations: correcting Apple OpenGL initialization, speeding up Sobol (dim2) sampling, and adjusting curve rendering to remove unwanted end caps.

Changes:

  • Fix Apple-specific OpenGL context macro checks (__APPLE__) in GLFW windows.
  • Optimize Sobol reversed sampling by reducing matrix data and adding a fast dim1 computation.
  • Disable end caps for OSP_DISJOINT cone/cylinder curves via Embree flags; update related image baselines/docs.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 Updates baseline checksum for curve rendering change
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 Updates baseline checksum for curve rendering change
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 Updates baseline checksum for curve rendering change
scripts/superbuild/README.md Documentation tweak: GPU support wording (beta → non-beta)
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Removes explicit tutorial light setup
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fix Apple macro for OpenGL init
modules/cpu/math/sobol.inl Shrinks Sobol reversed matrices to support optimized sampling
modules/cpu/math/sobol.ih Adds fast Sobol dim1 computation; updates dim2-4 sampling logic
modules/cpu/geometry/SpheresShared.h Removes global_radius from shared sphere struct init
modules/cpu/geometry/Curves.h Adds storage for Embree curve flags (capData)
modules/cpu/geometry/Curves.cpp Disables caps for disjoint curves via Embree flags buffer
modules/cpu/CMakeLists.txt Removes “beta” wording for GPU module build option
doc/api.md Updates VTK wording and GPU section heading/content
cmake/ospray_cmake_config/osprayConfig.cmake.in Adds MSVC /Zc:__cplusplus as an interface option for consumers
cmake/compiler/msvc.cmake Adds MSVC /Zc:__cplusplus to common build flags
apps/ospTestSuite/test_enums.cpp Adds size check for OSPUnstructuredCellType
apps/ospExamples/GLFWOSPRayWindow.cpp Fix Apple macro for OpenGL init
CHANGELOG.md Records bug fixes and sampling improvements; formatting cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles a set of fixes/optimizations split out from #603, covering macOS OpenGL initialization, Sobol sequence performance, and geometry curve end-cap behavior, plus accompanying documentation/CMake updates.

Changes:

  • Fix macOS OpenGL context hinting by switching to __APPLE__ in GLFW window setup.
  • Optimize Sobol dim2 sampling and adjust associated lookup tables.
  • Disable end caps for OSP_DISJOINT cone/cylinder curves (Embree flags) and update image baselines/docs/changelog accordingly.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fix macOS preprocessor macro for OpenGL hints.
apps/ospExamples/GLFWOSPRayWindow.cpp Same macOS OpenGL initialization macro fix.
modules/cpu/math/sobol.ih New Sobol dim1 helper + updated rev-matrix indexing for perf.
modules/cpu/math/sobol.inl Shrink/restructure Sobol_revMatrices to match new sampling approach.
modules/cpu/geometry/Curves.h Add capData storage for Embree per-primitive curve flags.
modules/cpu/geometry/Curves.cpp Set Embree RTC_BUFFER_TYPE_FLAGS to disable caps for OSP_DISJOINT.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_{15,16,17}.png.md5 Update baselines for the curves rendering change.
modules/cpu/geometry/SpheresShared.h Remove unused global_radius field initialization.
cmake/compiler/msvc.cmake Add /Zc:__cplusplus for newer MSVC.
cmake/ospray_cmake_config/osprayConfig.cmake.in Propagate MSVC /Zc:__cplusplus to consumers via imported target options.
modules/cpu/CMakeLists.txt Remove “(beta)” wording from GPU module option description.
scripts/superbuild/README.md Update GPU support description (no longer labeled beta).
doc/api.md Update VTK cell array text and GPU section heading/unsupported list.
apps/ospTestSuite/test_enums.cpp Add a size check for OSPUnstructuredCellType (uint8-sized).
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Remove explicit light setup from MPI spheres tutorial.
CHANGELOG.md Record fixes/optimizations and reformat bullets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several fixes and small optimizations split out from #603, including an OSX OpenGL initialization fix, a Sobol (dim2) sampling optimization, and a geometry behavior change to remove end caps from disjoint cone/cylinder curves (with corresponding baseline updates).

Changes:

  • Fix macOS OpenGL context setup by using the correct __APPLE__ preprocessor guard.
  • Optimize Sobol sequence sampling by reducing stored direction matrices and adding a faster dim1 computation.
  • Disable Embree curve caps for OSP_DISJOINT curves and update image test baselines accordingly.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 Updates expected image hash after curve cap behavior change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 Updates expected image hash after curve cap behavior change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 Updates expected image hash after curve cap behavior change.
scripts/superbuild/README.md Removes “beta” wording for GPU support in superbuild docs.
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Removes explicit light setup in the MPI tutorial.
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fixes Apple macro guard for OpenGL version hints.
modules/cpu/math/sobol.inl Reduces Sobol rev-matrix table size (dims 2–4 only).
modules/cpu/math/sobol.ih Adds Sobol_revSample1() and updates rev-matrix usage/size.
modules/cpu/geometry/SpheresShared.h Removes unused global_radius field from shared spheres struct.
modules/cpu/geometry/Curves.h Adds capData storage for Embree curve flags.
modules/cpu/geometry/Curves.cpp Sets Embree RTC_BUFFER_TYPE_FLAGS to disable caps for OSP_DISJOINT.
modules/cpu/CMakeLists.txt Removes “(beta)” from the GPU module option description.
doc/api.md Updates unstructured-volume wording + removes “GPU (Beta)” labeling.
cmake/ospray_cmake_config/osprayConfig.cmake.in Adds MSVC /Zc:__cplusplus for consumers (but currently with invalid CMake syntax).
cmake/compiler/msvc.cmake Adds /Zc:__cplusplus to MSVC build flags for OSPRay itself.
apps/ospTestSuite/test_enums.cpp Adds a size assertion for OSPUnstructuredCellType.
apps/ospExamples/GLFWOSPRayWindow.cpp Fixes Apple macro guard for OpenGL version hints.
CHANGELOG.md Adds entries for the included fixes and reformats several sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 853 to +856
bool indexPrefixed false indicates that the `index` array is
compatible to VTK, where the indices of
each cell are prefixed with the number
of vertices
compatible to legacy vtkCellArray,
where the indices of each cell are
prefixed with the number of vertices
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several fixes and small optimizations across rendering, sampling, build configuration, and documentation.

Changes:

  • Fix macOS OpenGL context initialization by using the correct __APPLE__ preprocessor define.
  • Optimize Sobol sample generation (notably dim2) and update associated tables.
  • Remove end caps for OSP_DISJOINT cone/cylinder curves via Embree curve flags, updating image baselines accordingly.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fix macOS-specific OpenGL context initialization macro.
apps/ospExamples/GLFWOSPRayWindow.cpp Fix macOS-specific OpenGL context initialization macro.
modules/cpu/math/sobol.ih Introduce faster Sobol dim1 computation and adjust rev-matrix usage.
modules/cpu/math/sobol.inl Reduce/reshape Sobol reversed matrices table to match new sampling logic.
modules/cpu/geometry/Curves.h Add per-primitive curve flags storage for disabling caps.
modules/cpu/geometry/Curves.cpp Populate Embree RTC_BUFFER_TYPE_FLAGS for OSP_DISJOINT curves to disable caps.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 Update baseline hash after curve cap rendering change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 Update baseline hash after curve cap rendering change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 Update baseline hash after curve cap rendering change.
cmake/compiler/msvc.cmake Add /Zc:__cplusplus for newer MSVC to improve __cplusplus reporting.
cmake/ospray_cmake_config/osprayConfig.cmake.in Propagate /Zc:__cplusplus to consumers (but current append logic needs fixing).
modules/cpu/CMakeLists.txt Remove “beta” wording from the GPU module option description.
scripts/superbuild/README.md Remove “beta” wording from GPU support documentation.
doc/api.md Documentation clarifications (VTK legacy cell array wording; GPU section no longer “Beta”; remove unsupported GPU features list items).
apps/ospTestSuite/test_enums.cpp Add enum size assertion for OSPUnstructuredCellType.
modules/cpu/geometry/SpheresShared.h Remove unused global_radius field from shared spheres struct.
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Remove explicit light setup from the tutorial renderer configuration.
CHANGELOG.md Changelog formatting cleanup + note fixes included in this PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several fixes and small optimizations across rendering, sampling, build configuration, and documentation, split out from #603.

Changes:

  • Fix macOS OpenGL context initialization by correcting the Apple preprocessor guard in GLFW windows.
  • Optimize Sobol (rev) sampling for dim2+ and adjust related lookup tables.
  • Disable end caps for OSP_DISJOINT cone/cylinder curves via Embree curve flags and update image test baselines accordingly.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 Updates baseline hash for curves scene output change (caps removal).
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 Updates baseline hash for curves scene output change (caps removal).
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 Updates baseline hash for curves scene output change (caps removal).
scripts/superbuild/README.md Updates wording around GPU support (no longer labeled beta).
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Removes explicit light setup in the MPI distributed spheres tutorial.
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fixes Apple macro guard for correct OpenGL context hints on macOS.
modules/cpu/math/sobol.inl Shrinks Sobol rev-matrix table and aligns with updated sampling approach.
modules/cpu/math/sobol.ih Adds optimized computation for Sobol component 1 and updates rev-matrix usage.
modules/cpu/geometry/SpheresShared.h Removes unused shared-field initialization from ISPC shared spheres struct.
modules/cpu/geometry/Curves.h Adds persistent capData storage for Embree flags buffer.
modules/cpu/geometry/Curves.cpp Sets Embree curve flags for OSP_DISJOINT to disable end caps.
modules/cpu/CMakeLists.txt Updates GPU module option description (drops “beta”).
doc/api.md Updates VTK indexPrefixed wording and GPU section heading/known-issues list.
cmake/ospray_cmake_config/osprayConfig.cmake.in Attempts to add /Zc:__cplusplus for MSVC consumers via exported target.
cmake/compiler/msvc.cmake Adds /Zc:__cplusplus to MSVC build flags (>= 1914).
apps/ospTestSuite/test_enums.cpp Adds a test asserting OSPUnstructuredCellType is 1 byte.
apps/ospExamples/GLFWOSPRayWindow.cpp Fixes Apple macro guard for correct OpenGL context hints on macOS.
CHANGELOG.md Documents fixes/changes and reformats several entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

small cleanup for spheres
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several fixes/optimizations across rendering, sampling, build/CI, and documentation—most notably improving macOS OpenGL initialization, optimizing Sobol dim2 sampling, and removing unwanted end caps on disjoint curves.

Changes:

  • Fix macOS OpenGL context initialization by using the correct __APPLE__ preprocessor macro.
  • Optimize Sobol reversed sampling (dim2) by reducing lookup-table usage and adding a fast path for component 1.
  • Disable end caps for OSP_DISJOINT cone/cylinder curves via Embree curve flags; update baselines accordingly.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fix macOS-specific OpenGL hinting via __APPLE__.
apps/ospExamples/GLFWOSPRayWindow.cpp Same macOS OpenGL macro fix for example app window.
modules/cpu/math/sobol.inl Shrink Sobol_revMatrices table to remove dim1 data (perf-oriented).
modules/cpu/math/sobol.ih Add Sobol_revSample1() and adjust rev-sampling loops to use smaller tables.
modules/cpu/geometry/Curves.h Add capData storage for Embree per-primitive flags.
modules/cpu/geometry/Curves.cpp Set Embree RTC_BUFFER_TYPE_FLAGS for OSP_DISJOINT to disable caps.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 Update regression baseline hash due to curve end-cap change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 Update regression baseline hash due to curve end-cap change.
test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 Update regression baseline hash due to curve end-cap change.
cmake/compiler/msvc.cmake Enable /Zc:__cplusplus for MSVC >= 1914.
cmake/ospray_cmake_config/osprayConfig.cmake.in Export /Zc:__cplusplus to consumers via CMake config.
.github/workflows/ci.windows.yml Add a Windows “find_package(ospray)” tutorial build job.
apps/ospTestSuite/test_enums.cpp Add size assertion for OSPUnstructuredCellType to ensure it fits uint8.
modules/cpu/geometry/SpheresShared.h Remove unused global_radius field from shared spheres struct.
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Remove explicit light setup in tutorial.
modules/cpu/CMakeLists.txt Update GPU module option text (remove “beta”).
scripts/superbuild/README.md Update GPU support wording (remove “beta”).
doc/api.md Documentation tweaks (VTK legacy wording, GPU section heading, unsupported features list).
CHANGELOG.md Add/clarify entries for fixes and adjust formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR (split from #603) bundles several fixes/optimizations across rendering, sampling, build configuration, docs, and CI—most notably an OSX OpenGL init fix, a Sobol dim-2 sampling optimization, and disabling end caps for disjoint cone/cylinder curves.

Changes:

  • Fix macOS OpenGL context initialization by using the correct __APPLE__ macro in GLFW windows.
  • Optimize Sobol reverse sampling (dim2+) by reducing lookup-table usage and adding a faster component-1 computation.
  • Disable end caps for OSP_DISJOINT cone/cylinder curves via Embree curve flags; update docs/changelog/CI and Windows/MSVC build settings accordingly.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp Fix macOS OpenGL initialization macro guard.
apps/ospExamples/GLFWOSPRayWindow.cpp Same macOS OpenGL macro fix for examples window.
modules/cpu/math/sobol.ih New Sobol dim1 fast path and reduced rev-matrix usage for dim2–4.
modules/cpu/math/sobol.inl Shrink Sobol_revMatrices table to match new dim2–4 usage.
modules/cpu/geometry/Curves.h Add persistent capData storage for Embree flags buffer.
modules/cpu/geometry/Curves.cpp Disable caps for OSP_DISJOINT cone/cylinder curves using Embree flags buffer.
modules/cpu/geometry/SpheresShared.h Remove unused global_radius from shared struct.
modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp Remove explicit ambient/distant light setup.
cmake/compiler/msvc.cmake Add /Zc:__cplusplus for newer MSVC versions.
cmake/ospray_cmake_config/osprayConfig.cmake.in Propagate /Zc:__cplusplus to consumers via CMake package config.
.github/workflows/ci.windows.yml Add job to verify find_package(ospray) works against installed artifacts.
apps/ospTestSuite/test_enums.cpp Add assertion that OSPUnstructuredCellType is 1 byte.
doc/api.md Update VTK legacy cell array wording; rename GPU section; adjust GPU known-issues list.
scripts/superbuild/README.md Remove “beta” wording for GPU support option.
modules/cpu/CMakeLists.txt Remove “beta” wording for GPU module option.
CHANGELOG.md Formatting cleanup + add relevant bug-fix notes.
test_image_data/baseline/*.png.md5 Update baselines for curve scene changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@johguenther johguenther merged commit d5d60d4 into devel Mar 18, 2026
14 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.

2 participants