Repository navigation
Update bgfx.cmake to latest and drop the local SSE4.2 workaround - #1804
Closed
SergioRZMasson wants to merge 1 commit into
Closed
SergioRZMasson wants to merge 1 commit into
SergioRZMasson wants to merge 1 commit into
Conversation
Bumps bgfx.cmake from 6c55158 to 5c98749, which brings in: * BabylonJS/bgfx.cmake#135 - bx's SSE4.2 minspec is now applied to every x86 target instead of only x86_64, and Apple universal builds scope it per slice with -Xarch_. * BabylonJS/bgfx.cmake#136 - bgfx and bimg submodule updates. bx/include/bx/simd_t.h uses SSE4.1 intrinsics (_mm_round_ps, _mm_blendv_ps) whenever BX_CPU_X86 && __SSE2__, so every x86 target needs the SSE4.2 minspec bx's own scripts/toolchain.lua sets. Two configurations were missing it: * the x86_64 slice of Apple universal builds - CMAKE_SYSTEM_PROCESSOR only names one slice, so ios-cmake's SIMULATOR64COMBINED (which reports aarch64 while also building x86_64) built that slice without the flag; * 32-bit x86 - the Android NDK sets CMAKE_SYSTEM_PROCESSOR to i686 for the x86 ABI, which the old x86_64-only guard did not match. Both failed with "'__builtin_ia32_roundps' needs target feature sse4.1". With the minspec now applied PUBLIC on the bx target, and bgfx / bimg / bimg_decode / bimg_encode all linking bx PUBLIC, the local workaround in Dependencies/CMakeLists.txt is redundant and is removed. It was also narrower than the problem: it excluded ANDROID and only matched x86_64, so it never covered the Android x86 or Apple cases. Verified on a mirror of the packager pipeline (iOS SIMULATOR64COMBINED / Debug, Xcode 26.0.1): before the bgfx.cmake fix the build stopped at bimg/image.o with two sse4.1 errors after linking 12 static libraries; after it, BUILD SUCCEEDED with 70 static libraries built and 66 files installed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1c7db476-5b27-4766-a4c7-909a52864b42
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the bgfx.cmake FetchContent pin to a newer upstream commit that fixes SSE4.2 minspec propagation for all x86 targets (including Apple universal slice scoping and Android x86), and removes the now-redundant local -msse4.2 workaround previously applied in this repo.
Changes:
- Bump
bgfx.cmaketo commit5c98749de48e8609a62e5c1fd2cfffbbd970588e. - Remove the local SSE4.2 compile-options workaround block from
Dependencies/CMakeLists.txt.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
CMakeLists.txt |
Updates the bgfx.cmake FetchContent GIT_TAG to the upstream commit that includes the SSE minspec fix and submodule updates. |
Dependencies/CMakeLists.txt |
Drops the repo-local -msse4.2 workaround since the updated bgfx.cmake is expected to propagate the required x86 minspec via bx. |
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.
Bumps
bgfx.cmakefrom6c55158to5c98749,which brings in:
minspec is now applied to every x86 target instead of only x86_64, and Apple universal
builds scope it per slice with
-Xarch_.bimg submodule updates.
Why
bx/include/bx/simd_t.huses SSE4.1 intrinsics (_mm_round_ps,_mm_blendv_ps) wheneverBX_CPU_X86 && __SSE2__, so every x86 target needs the SSE4.2 minspec that bx's ownscripts/toolchain.luasets. Two configurations were missing it:CMAKE_SYSTEM_PROCESSORnames only oneslice, so ios-cmake's
SIMULATOR64COMBINED(which reportsaarch64while also buildingan x86_64 slice) compiled that slice without the flag;
CMAKE_SYSTEM_PROCESSORtoi686for thex86ABI,which the old
x86_64-only guard did not match.Both failed with:
Removed workaround
Dependencies/CMakeLists.txtcarried a local-msse4.2workaround. The minspec is nowapplied
PUBLICon thebxtarget, andbgfx/bimg/bimg_decode/bimg_encodealllink
bxPUBLIC, so it is redundant.It was also narrower than the problem it was working around —
NOT APPLE AND NOT ANDROIDplus an
x86_64-only processor match meant it never covered the Apple universal orAndroid x86 cases that were actually failing.
Verification
Reproduced and validated on a mirror of the NuGet packager pipeline (iOS
SIMULATOR64COMBINED/Debug, Xcode 26.0.1,macos-latest):needs target feature sse4.1errorsbimg→image.o(x86_64 slice)The bgfx.cmake change itself was verified across 25 platform configurations (macOS/iOS/watchOS
single and universal slices, Android
x86/x86_64/armeabi-v7a/arm64-v8a, Linuxx86_64/i686/aarch64, MSVCx64/ARM64/Win32, clang-cl, Emscripten) — seeBabylonJS/bgfx.cmake#135 for the full table.