Repository navigation
Conversation
…bin/vs/$(Platform) DLLs next to the exe after build, Debug and Release, x64 / ARM64 / ARM64EC; defines OF_USE_GLON12=1
OF_GLON12_WARP=1 (with OF_USE_GLON12=1) defines OF_USE_GLON12_WARP. ofAppGLFWWindow.h then sets LIBGL_ALWAYS_SOFTWARE=true and GALLIUM_DRIVER=d3d12 at static init, before GLFW creates the first context, unless the user already set them. It is in the header because openframeworksLib is built without the app's define. GALLIUM_DRIVER is needed: LIBGL_ALWAYS_SOFTWARE alone makes Mesa look for llvmpipe / softpipe, which GLon12 doesn't build, and context creation fails. Tested on Windows 11 ARM64 (Parallels), x64 Release: no env vars -> D3D12 (Microsoft Basic Render Driver), GL 4.6, all bench scenes with no GL errors; LIBGL_ALWAYS_SOFTWARE=false still selects the GPU adapter.
… Modular libraries
ofGLFWWindowSettings::glon12Warp = true runs GLon12 on WARP (software D3D12), the runtime version of OF_USE_GLON12_WARP=1. Set on the first window, it sets LIBGL_ALWAYS_SOFTWARE=true and GALLIUM_DRIVER=d3d12 before GLFW starts, unless the environment already has them. Later windows log a warning, Mesa picks the adapter once per process. Off by default. glon12Example: 8,000 instanced boxes with an overlay of GL_RENDERER / GL_VERSION and whether it is GLon12 on the GPU, GLon12 on WARP or the system driver. main.cpp takes --warp and sets settings.glon12Warp; w restarts the app in the other mode. Builds on every platform, the GLon12 parts are Windows / GLFW only. Tested on Windows 11 ARM64 (Parallels), x64 Release, project from projectGenerator PR 678 (-DOF_USE_GLON12=1, property + define written, DLLs copied): --warp -> D3D12 (Microsoft Basic Render Driver), GL 4.6, renders, 28 fps default -> D3D12 (Parallels Display Adapter), GL 4.2 (then the known Parallels D3D12 crash) w -> relaunches without --warp
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.
Visual Studio applications can opt into GLon12 and optionally select WARP through the
vs,vs2019andvs2026property sheets.OF_USE_GLON12defaults to0. Setting it to1definesOF_USE_GLON12=1and copieslibs/glon12/bin/vs/$(Platform)/*.dllnext to the executable after Debug or Release builds. Missing DLLs produce a build error identifying the expected folder. The copy target applies to applications.OF_USE_GLON12_WARPdefaults to0. With GLon12 enabled, setting it to1definesOF_USE_GLON12_WARP=1. The GLFW window header setsLIBGL_ALWAYS_SOFTWARE=trueandGALLIUM_DRIVER=d3d12before context creation, preserving either variable when it already exists. Keeping this initializer in the header supports application-specific defines with a prebuilt openFrameworks library.OF_GLON12_WARPremains a compatible MSBuild property alias. An explicitly suppliedOF_USE_GLON12_WARPtakes precedence.For example, set these properties in the project's Globals or
Directory.Build.props:The equivalent command-line options are
/p:OF_USE_GLON12=1 /p:OF_USE_GLON12_WARP=1. Defining both preprocessor macros directly also enables the header initializer.Download GLon12 from Apothecary
latest-modular(oF_glon12_vs_{64,arm64,arm64ec}.zip) intolibs/glon12. Companion openframeworks/apothecary#678 packages the required SDKdxil.dllalongsideopengl32.dllandlibgallium_wgl.dll; this PR's wildcard copy includes it automatically once the updated package is published.Validation: 40 compiled startup flag/environment cases and 24 actual MSBuild property/alias evaluations passed across the three property sheets; XML parsing and diff checks passed. The reported Windows WARP tests pass GL 2.1, 3.2, 3.3, 4.1 and 4.6, including compute, with zero GL errors. These local checks do not establish a complete native Windows build. The Parallels hardware first-draw crash and ARM64EC pre-context crash remain unresolved; neither is claimed fixed here.
ProjectGenerator integration: openframeworks/projectGenerator branch
vs-glon12.