Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FetchContent_Declare(base-n
EXCLUDE_FROM_ALL)
FetchContent_Declare(bgfx.cmake
GIT_REPOSITORY https://github.com/BabylonJS/bgfx.cmake.git
GIT_TAG 3b67f0c0c5505a22f6e88640519b5b473c938ad9
GIT_TAG 8f7e4455933085fc719913138c78ef61242709e3
EXCLUDE_FROM_ALL)
FetchContent_Declare(CMakeExtensions
GIT_REPOSITORY https://github.com/BabylonJS/CMakeExtensions.git
Expand Down
15 changes: 0 additions & 15 deletions Dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,6 @@ if(NOT BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP AND TARGET bimg_decode)
target_compile_definitions(bimg_decode PRIVATE BIMG_CONFIG_PARSE_WEBP=0)
endif()

if(NOT APPLE AND NOT ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# The new bx requires SSE4.2 on x86_64 (see bx scripts/toolchain.lua and
# include/bx/inline/simd128_sse.inl which uses _mm_round_ps / _mm_blendv_ps
# under "SSE4.1 - always available with SSE4.2 minspec"). bgfx.cmake does
# not propagate this flag, so add it explicitly for any GCC/Clang frontend on
# x86_64 (e.g. Linux, or Clang targeting Windows), none of which enable SSE4.x
# by default. MSVC (cl.exe) allows the intrinsics regardless and Apple Silicon
# is unaffected.
foreach(_bx_target IN ITEMS bx bgfx bimg bimg_decode bimg_encode)
if(TARGET ${_bx_target})
target_compile_options(${_bx_target} PRIVATE -msse4.2)
endif()
endforeach()
endif()

if(UNIX AND NOT APPLE AND NOT ANDROID)
# Use GLVND libraries for EGL support in bgfx
set(OpenGL_GL_PREFERENCE GLVND)
Expand Down
11 changes: 0 additions & 11 deletions Plugins/NativeEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ endif()
if(WIN32)
target_compile_definitions(NativeEngine
PRIVATE NOMINMAX)

# arcana's Windows trace_region.h (pulled in by NativeEngine.cpp and Program.cpp)
# emits ETW TraceLogging events. The EventRegister/EventUnregister/EventWriteTransfer
# declarations it relies on (via <evntprov.h>) are only visible when
# _WIN32_WINNT >= _WIN32_WINNT_VISTA (0x0600). bx/platform.h only sets _WIN32_WINNT
# when it is still undefined, and then to 0x0601 for 64-bit but 0x0502 (pre-Vista)
# for 32-bit; its 64-bit check also misses MSVC's _M_ARM64, so Windows ARM64 is
# treated as 32-bit. Both cases leave _WIN32_WINNT below Vista and break the compile
# (error C3861). Pin a modern Windows API baseline so it is set before any header.
target_compile_definitions(NativeEngine
PRIVATE _WIN32_WINNT=0x0A00 WINVER=0x0A00)
endif()

# Required by VertexBuffer::BuildInstanceDataBuffer. Remove once we have a better solution for that method.
Expand Down
8 changes: 4 additions & 4 deletions Plugins/NativeEngine/Source/ShaderProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ namespace Babylon
{
// The shader cache is keyed only by source, so it must be bypassed when routing instanced
// attributes (otherwise a variant would collide with the base program's cached shader).
// Only referenced inside the SHADER_CACHE blocks below, so mark it maybe_unused for builds
// that compile with the ShaderCache plugin disabled.
[[maybe_unused]] const bool useCache = instancedAttributes.empty();

// Declared and used only inside the SHADER_CACHE blocks, so it is compiled out entirely when
// the ShaderCache plugin is disabled.
#ifdef SHADER_CACHE
const bool useCache = instancedAttributes.empty();

if (useCache && Plugins::ShaderCache::IsEnabled())
{
const auto shaderInfo = Plugins::ShaderCache::GetShader(vertexSource, fragmentSource);
Expand Down
Loading