From 9eb3785013ce9c238d743cb6a1015ed36ba78178 Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Thu, 13 Aug 2026 13:29:05 -0700 Subject: [PATCH] Drop the dead BGFX_CONFIG_MAX_FRAME_BUFFERS=256 overrides and stop clamping The pool floor added in #1715 and raised to 2048 in #1830 clamps any smaller value upward, so the three CI overrides have done nothing since June while reading as deliberate coverage of a 256-slot pool. Removing the flags is what makes the floor safe to relax, so both halves are here: build-win32.yml and nightly.yml run the validation sweep the larger pool exists for, so honoring their =256 would reintroduce the exhaustion #1830 fixed. With the flags gone, 2048 becomes a plain default rather than a floor, and an embedder that deliberately sets a smaller pool is no longer overridden without a diagnostic. build-win32-shader.yml builds only PrecompiledShaderTest, where the value never mattered. Verified by configuring Win32 x64 D3D11 both ways: with no flag bgfx still compiles with BGFX_CONFIG_MAX_FRAME_BUFFERS=2048, and -D ...=256 now reaches the compile line instead of being clamped up to 2048. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e327caab-46c0-4c04-a3c0-1577ad67f08c --- .github/workflows/build-win32-shader.yml | 1 - .github/workflows/build-win32.yml | 1 - Dependencies/CMakeLists.txt | 16 ++++------------ nightly.yml | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-win32-shader.yml b/.github/workflows/build-win32-shader.yml index 3a0ac37a2d..7a6d7b5a09 100644 --- a/.github/workflows/build-win32-shader.yml +++ b/.github/workflows/build-win32-shader.yml @@ -29,7 +29,6 @@ jobs: -A ${{ inputs.platform }} ^ -D BX_CONFIG_DEBUG=ON ^ -D GRAPHICS_API=D3D11 ^ - -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 ^ -D BABYLON_DEBUG_TRACE=ON ^ -D BABYLON_NATIVE_PLUGIN_NATIVEENGINE_COMPILESHADERS=OFF diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index 64198185b2..d260818aeb 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -65,7 +65,6 @@ jobs: ${{ steps.vars.outputs.js_define }} ^ -D BX_CONFIG_DEBUG=ON ^ -D GRAPHICS_API=${{ inputs.graphics-api }} ^ - -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 ^ -D BABYLON_DEBUG_TRACE=ON ^ -D BABYLON_NATIVE_PLUGIN_NATIVEDRACO=ON ^ -D BABYLON_NATIVE_PLUGIN_NATIVEMESHOPT=ON ^ diff --git a/Dependencies/CMakeLists.txt b/Dependencies/CMakeLists.txt index 457ad31e99..7191ac5224 100644 --- a/Dependencies/CMakeLists.txt +++ b/Dependencies/CMakeLists.txt @@ -58,18 +58,10 @@ target_compile_definitions(bgfx PUBLIC BGFX_PLATFORM_SUPPORTS_WGSL=0) # Expose the path so the OpenGL backends of our own targets can use it. set(BGFX_KHRONOS_INCLUDE_DIR "${bgfx.cmake_SOURCE_DIR}/bgfx/3rdparty/khronos" CACHE INTERNAL "") -# Canvas plugin allocates one bgfx framebuffer per JS Canvas object and per -# text-rendering operation; combined with V8 GC pacing this can exceed the -# default 128 limit during long playground sweeps. We enforce a floor of 2048: -# CI workflows pass -DBGFX_CONFIG_MAX_FRAME_BUFFERS, and any value below 2048 -# (including a smaller CI override) is clamped up so the pool never regresses -# below the size the Canvas sweeps need. -# -# 512 was sufficient only because the validation runner exited on the first -# failing test. With --keep-going a full validation sweep keeps allocating past -# that point and exhausts the pool around the FrameGraph tests, so the floor -# has to cover a complete uninterrupted run. -if(NOT BGFX_CONFIG_MAX_FRAME_BUFFERS OR BGFX_CONFIG_MAX_FRAME_BUFFERS LESS 2048) +# The Canvas polyfill holds a bgfx framebuffer per JS Canvas object and per +# text-rendering operation, releasing them only on GC finalize, so a long +# playground sweep exceeds bgfx's default of 128. +if(NOT BGFX_CONFIG_MAX_FRAME_BUFFERS) set(BGFX_CONFIG_MAX_FRAME_BUFFERS 2048) endif() target_compile_definitions(bgfx PRIVATE BGFX_CONFIG_MAX_FRAME_BUFFERS=${BGFX_CONFIG_MAX_FRAME_BUFFERS}) diff --git a/nightly.yml b/nightly.yml index b85eba28ae..95ba710357 100644 --- a/nightly.yml +++ b/nightly.yml @@ -21,7 +21,7 @@ jobs: - checkout: self - script: | - cmake -G "Visual Studio 17 2022" -B build -A x64 -D BX_CONFIG_DEBUG=ON -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 -D BABYLON_DEBUG_TRACE=ON + cmake -G "Visual Studio 17 2022" -B build -A x64 -D BX_CONFIG_DEBUG=ON -D BABYLON_DEBUG_TRACE=ON displayName: 'Generate solution' - script: |