Skip to content

VS: optional GLon12 DLL deployment and WARP selection - #8601

Open
danoli3 wants to merge 7 commits into
openframeworks:masterfrom
danoli3:vs-glon12
Open

danoli3 wants to merge 7 commits into
openframeworks:masterfrom
danoli3:vs-glon12

Conversation

@danoli3

@danoli3 danoli3 commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Screenshot 2026-10-25 at 4 06 18 pm

Visual Studio applications can opt into GLon12 and optionally select WARP through the vs, vs2019 and vs2026 property sheets.

  • OF_USE_GLON12 defaults to 0. Setting it to 1 defines OF_USE_GLON12=1 and copies libs/glon12/bin/vs/$(Platform)/*.dll next 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_WARP defaults to 0. With GLon12 enabled, setting it to 1 defines OF_USE_GLON12_WARP=1. The GLFW window header sets LIBGL_ALWAYS_SOFTWARE=true and GALLIUM_DRIVER=d3d12 before 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_WARP remains a compatible MSBuild property alias. An explicitly supplied OF_USE_GLON12_WARP takes precedence.

For example, set these properties in the project's Globals or Directory.Build.props:

<OF_USE_GLON12>1</OF_USE_GLON12>
<OF_USE_GLON12_WARP>1</OF_USE_GLON12_WARP>

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) into libs/glon12. Companion openframeworks/apothecary#678 packages the required SDK dxil.dll alongside opengl32.dll and libgallium_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.

…bin/vs/$(Platform) DLLs next to the exe after build, Debug and Release, x64 / ARM64 / ARM64EC; defines OF_USE_GLON12=1
@danoli3 danoli3 changed the title VS: OF_USE_GLON12=1 copies the GLon12 (Mesa OpenGL -> D3D12) DLLs next to the exe VS: optional GLon12 DLL deployment and WARP selection Oct 25, 2026
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.
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
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