GHOST: Add environment variable for enabling or disabling vsync

This PR proposes to add an environment variable for forcing vsync to
be on or off. My primary use case was to disable vsync for forcing
viewport rendering performance tests not to be capped at the display
refresh rate when #142984 is used for removing animation frame rate
limits.

I initially added the environment variable "GHOST_VSYNC_OFF", but
found "GHOST_VSYNC=0/1" to be more easily understandable.

Usage:
- GHOST_VSYNC=0 => Vsync is forced off
- GHOST_VSYNC=1 => Vsync is forced on

Pull Request: https://projects.blender.org/blender/blender/pulls/143049
This commit is contained in:
Christoph Neuhauser
2025-08-11 12:09:21 +02:00
committed by Clément Foucault
parent 2193096106
commit aafef977fb
9 changed files with 65 additions and 0 deletions

View File

@@ -866,6 +866,10 @@ static void print_help(bArgs *ba, bool all)
PRINT(" $BLENDER_CUSTOM_SPLASH Full path to an image that replaces the splash screen.\n");
PRINT(
" $BLENDER_CUSTOM_SPLASH_BANNER Full path to an image to overlay on the splash screen.\n");
PRINT(
" $GHOST_VSYNC Whether to disable (0) or enable (1) vsync. Otherwise left to the GHOST "
"backend. For the OpenGL backend, the passed value is used as the swap interval "
"(https://www.khronos.org/opengl/wiki/Swap_Interval).\n");
if (defs.with_opencolorio) {
PRINT(" $OCIO Path to override the OpenColorIO configuration file.\n");