Skip to content

gl: make shared OpenGL infrastructure profile-safe - #16

Open
tritao wants to merge 4 commits into
stack/shader-diagnosticsfrom
stack/compatibility-boundary
Open

gl: make shared OpenGL infrastructure profile-safe#16
tritao wants to merge 4 commits into
stack/shader-diagnosticsfrom
stack/compatibility-boundary

Conversation

@tritao

@tritao tritao commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make Coin's shared OpenGL infrastructure safe to execute on both compatibility and core-profile contexts.

  • Separate shared context/glue functionality from legacy fixed-function drawing assumptions.
  • Replace compatibility-only queries and state handling in shared code with profile-safe equivalents.
  • Keep low-level GL legality and profile differences inside the shared glue layer.
  • Preserve required OpenGL state during offscreen readback.
  • Make shared texture probing and context helpers safe on core profiles.
  • Add focused core-profile readback and shared-infrastructure coverage.

This layer does not remove LegacyGL scene traversal or exclude LegacyGL implementation units; those boundaries are introduced next.

Stack

Layer 5/18, based on PR #22.

@tritao
tritao force-pushed the stack/compatibility-boundary branch from 0f14f15 to f09c6b7 Compare August 7, 2026 23:57
@tritao tritao changed the title stack/compatibility boundary build: complete compatibility-profile boundaries Aug 8, 2026
@tritao
tritao force-pushed the stack/compatibility-boundary branch from f09c6b7 to 438c680 Compare August 8, 2026 00:17
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 438c680 to 9d5aa7b Compare August 8, 2026 00:42
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 9d5aa7b to 17f663a Compare August 8, 2026 01:07
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 17f663a to 5534301 Compare August 8, 2026 01:20
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 5534301 to 1898f72 Compare August 8, 2026 01:22
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 1898f72 to 00e03cf Compare August 8, 2026 01:24
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 00e03cf to 32b1cf7 Compare August 8, 2026 01:30
@tritao
tritao force-pushed the stack/compatibility-boundary branch 2 times, most recently from e850c17 to 0503981 Compare August 8, 2026 01:57
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 0503981 to 4b9f662 Compare August 8, 2026 02:04
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 4b9f662 to 9e20664 Compare August 8, 2026 02:32
@tritao
tritao marked this pull request as ready for review August 8, 2026 02:36
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 9e20664 to 654a702 Compare August 8, 2026 02:54
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 0af09b0 to 96e1679 Compare August 8, 2026 10:27
@tritao tritao changed the title build: isolate the legacy OpenGL boundary build: make shared GL core-safe and isolate LegacyGL Aug 8, 2026
@tritao
tritao force-pushed the stack/compatibility-boundary branch from eb617ed to 7a2272e Compare August 9, 2026 02:03
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 7a2272e to 4f38785 Compare August 9, 2026 02:35
@tritao
tritao force-pushed the stack/compatibility-boundary branch 3 times, most recently from 777ae7b to 293984a Compare August 9, 2026 11:37
@tritao
tritao force-pushed the stack/compatibility-boundary branch 2 times, most recently from b1748c3 to 0f0c8b0 Compare August 9, 2026 12:02
@tritao tritao changed the title build: make shared GL core-safe and isolate LegacyGL gl: make shared OpenGL infrastructure profile-safe Aug 9, 2026
@tritao
tritao force-pushed the stack/compatibility-boundary branch 2 times, most recently from 79e6932 to 626fb23 Compare August 9, 2026 14:55
@tritao
tritao force-pushed the stack/compatibility-boundary branch from 626fb23 to 8083b63 Compare August 9, 2026 15:10
@tritao
tritao force-pushed the stack/compatibility-boundary branch 2 times, most recently from a8f3ebf to bc0c4c3 Compare August 9, 2026 21:01
Comment on lines 82 to +85
- name: Build EGL binding test
run: cmake --build cmake_build_dir --target EGLBindingTest GLSLRuntimeTest --config Release -- -j4
run: cmake --build cmake_build_dir --target EGLBindingTest GLSLRuntimeTest OffscreenReadbackTest --config Release -- -j4
- name: Run core-profile OpenGL tests
run: ctest -C Release -R '^(EGLBindingTest|GLSLRuntimeTest)$' --output-on-failure
run: ctest -C Release -R '^(EGLBindingTest|GLSLRuntimeTest|OffscreenReadbackTest)$' --output-on-failure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm still unsure why we separate test runs in multiple passes and jobs instead of running all of them at once

Comment thread testsuite/CMakeLists.txt
Comment on lines +172 to +183
add_executable(OffscreenReadbackTest OffscreenReadbackTest.cpp)
target_link_libraries(OffscreenReadbackTest PRIVATE
CoinGLTestSupport CoinGLReadbackTestSupport CoinTestInternals Coin
${COIN_TARGET_LINK_LIBRARIES})
target_include_directories(OffscreenReadbackTest PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}/include
${COIN_TARGET_INCLUDE_DIRECTORIES})
add_test(NAME OffscreenReadbackTest COMMAND OffscreenReadbackTest)
set_tests_properties(OffscreenReadbackTest PROPERTIES
SKIP_RETURN_CODE 77 LABELS "gl-core")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we're starting to have a lot of redundancy here, you can make proper function to add gl tests 2 PRs up the stack

run: |
sudo apt-get -y update
sudo apt-get -y install freeglut3-dev
sudo apt-get -y install freeglut3-dev libglfw3-dev

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

technically it's installed automatically by the testsuite, but I prefer to install it on the system like this

Comment on lines +78 to +82
#else
(void)index;
(void)point;
(void)normal;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So if Coin is not build with legacy gl here, it's a noop? Is the class in a broken state temporarily with this PR?

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