Skip to content

Update bgfx.cmake to converged bgfx (539e1feb); drop platform.h include#1774

Open
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:update-bgfx-cmake-converge
Open

Update bgfx.cmake to converged bgfx (539e1feb); drop platform.h include#1774
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:update-bgfx-cmake-converge

Conversation

@bkaradzic-microsoft

@bkaradzic-microsoft bkaradzic-microsoft commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Bumps the bgfx.cmake pin to 9c64597, which vendors the converged BabylonJS/bgfx @ 539e1feb and carries the CMake fixes that bring bimg's CMake build in line with its GENie build:

  • image_decode_wic.cpp is now globbed (WIC decoder),
  • the ETC2 encoder dir was renamed to etcpak,
  • AVIF decode (dav1d codec) is wired up.

Because the converged bgfx drops include/bgfx/platform.h (upstream #3761 — its declarations now live in the generated bgfx.h), this removes the now-redundant #include <bgfx/platform.h> from the seven BN consumers that carried it (each already includes <bgfx/bgfx.h> directly above). That in turn removes the need for the BGFX_IDL_CPP compile shim.

Also disables two unused bgfx config features to save binary size:

  • BGFX_CONFIG_VIDEO=0 — video decoding is unused by Babylon Native.
  • BGFX_CONFIG_C99_API=0 — BN uses the C++ API only.

Changes

  • CMakeLists.txt: bgfx.cmake pin 68762dd9c64597
  • Dependencies/CMakeLists.txt: add BGFX_CONFIG_VIDEO=0 and BGFX_CONFIG_C99_API=0
  • Remove #include <bgfx/platform.h> from 7 files (BgfxCallback.h, DeviceContext.h, DeviceImpl.h, NativeEngine.h, TestUtils.cpp, NativeCamera Apple/Android CameraDevice)

Validation

  • Playground Release builds clean (Win32 D3D11).
  • Full headless validation suite: ran=295 passed=295 failed=0 missingRef=0, exit 0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s bgfx.cmake dependency pin to a converged bgfx revision and adjusts Babylon Native sources/build settings to match upstream header/layout changes.

Changes:

  • Bump bgfx.cmake pin to a newer commit that vendors converged BabylonJS/bgfx.
  • Remove redundant #include <bgfx/platform.h> from all in-repo consumers (now covered by generated bgfx.h).
  • Disable bgfx video decoding support via BGFX_CONFIG_VIDEO=0 in the bgfx build.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CMakeLists.txt Updates the bgfx.cmake FetchContent pin to the newer commit.
Dependencies/CMakeLists.txt Adds BGFX_CONFIG_VIDEO=0 compile definition for the bgfx target.
Core/Graphics/InternalInclude/Babylon/Graphics/BgfxCallback.h Drops bgfx/platform.h include (now redundant with bgfx.h).
Core/Graphics/InternalInclude/Babylon/Graphics/DeviceContext.h Drops bgfx/platform.h include (now redundant with bgfx.h).
Core/Graphics/Source/DeviceImpl.h Drops bgfx/platform.h include (now redundant with bgfx.h).
Plugins/NativeEngine/Source/NativeEngine.h Drops bgfx/platform.h include (now redundant with bgfx.h).
Plugins/TestUtils/Source/TestUtils.cpp Drops bgfx/platform.h include (now redundant with bgfx.h).
Plugins/NativeCamera/Source/Apple/CameraDevice.mm Drops bgfx/platform.h include (now redundant with bgfx.h).
Plugins/NativeCamera/Source/Android/CameraDevice.cpp Drops bgfx/platform.h include (now redundant with bgfx.h).

Bumps the bgfx.cmake pin to 9c64597 (BabylonJS/bgfx.cmake), which vendors
the converged BabylonJS/bgfx at 539e1feb and carries the CMake fixes for
bimg (WIC image_decode_wic, etcpak rename, AVIF/dav1d wiring) so they match
the GENie build.

The converged bgfx removes include/bgfx/platform.h (upstream #3761); its
declarations now live in the generated bgfx.h. Remove the now-redundant
#include <bgfx/platform.h> from the BN consumers that carried it (each
already includes <bgfx/bgfx.h> directly above), which also drops the need
for the BGFX_IDL_CPP compile shim.

Also disable two unused bgfx config features to save binary size:
  * BGFX_CONFIG_VIDEO=0    - video decoding is unused by Babylon Native.
  * BGFX_CONFIG_C99_API=0  - BN uses the C++ API only.

Validated: Playground Release builds clean; full headless validation suite
passes 295/295 (exit 0) on Win32 D3D11.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bkaradzic-microsoft bkaradzic-microsoft force-pushed the update-bgfx-cmake-converge branch from e42b022 to 8479681 Compare July 9, 2026 01:38
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.

4 participants