Skip to content

Commit 4f5b89c

Browse files
authored
Update to latest Magnum with full skinning support and much more (#1968)
* Update Magnum submodules. * Port away from deprecated Magnum APIs. * Disable currently unused parts of Magnum.
1 parent 0b7e5eb commit 4f5b89c

13 files changed

Lines changed: 49 additions & 17 deletions

src/cmake/FindCorrade.cmake

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
# CORRADE_BUILD_MULTITHREADED - Defined if compiled in a way that makes it
8181
# possible to safely use certain Corrade features simultaneously in multiple
8282
# threads
83+
# CORRADE_BUILD_CPU_RUNTIME_DISPATCH - Defined if built with code paths
84+
# optimized for multiple architectres with the best matching variant selected
85+
# at runtime based on detected CPU features
8386
# CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor
8487
# (Linux, BSD, macOS)
8588
# CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms
@@ -100,6 +103,8 @@
100103
# CORRADE_TARGET_MSVC - Defined if compiling with MSVC or Clang with
101104
# a MSVC frontend
102105
# CORRADE_TARGET_MINGW - Defined if compiling under MinGW
106+
# CORRADE_CPU_USE_IFUNC - Defined if GNU IFUNC is allowed to be used
107+
# for runtime dispatch in the Cpu library
103108
# CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT - Defined if PluginManager
104109
# doesn't support dynamic plugin loading due to platform limitations
105110
# CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targeting Xcode
@@ -210,7 +215,7 @@
210215
# <metadata file>
211216
# <sources>...)
212217
#
213-
# Unline the above version this puts everything into ``<debug install dir>`` on
218+
# Unlike the above version this puts everything into ``<debug install dir>`` on
214219
# both DLL and non-DLL platforms. If ``<debug install dir>`` is set to
215220
# :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for testing purposes), the files
216221
# are copied directly, without the need to perform install step. Note that the
@@ -319,6 +324,7 @@ set(_corradeFlags
319324
BUILD_STATIC
320325
BUILD_STATIC_UNIQUE_GLOBALS
321326
BUILD_MULTITHREADED
327+
BUILD_CPU_RUNTIME_DISPATCH
322328
TARGET_UNIX
323329
TARGET_APPLE
324330
TARGET_IOS
@@ -327,10 +333,12 @@ set(_corradeFlags
327333
TARGET_WINDOWS_RT
328334
TARGET_EMSCRIPTEN
329335
TARGET_ANDROID
330-
# TARGET_X86 etc and TARGET_LIBCXX are not exposed to CMake as the meaning
331-
# is unclear on platforms with multi-arch binaries or when mixing different
332-
# STL implementations. TARGET_GCC etc are figured out via UseCorrade.cmake,
333-
# as the compiler can be different when compiling the lib & when using it.
336+
# TARGET_X86 etc, TARGET_32BIT, TARGET_BIG_ENDIAN and TARGET_LIBCXX etc.
337+
# are not exposed to CMake as the meaning is unclear on platforms with
338+
# multi-arch binaries or when mixing different STL implementations.
339+
# TARGET_GCC etc are figured out via UseCorrade.cmake, as the compiler can
340+
# be different when compiling the lib & when using it.
341+
CPU_USE_IFUNC
334342
PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
335343
TESTSUITE_TARGET_XCTEST
336344
UTILITY_USE_ANSI_COLORS)

src/cmake/FindMagnum.cmake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
# Audio - Audio library
5858
# DebugTools - DebugTools library
5959
# GL - GL library
60+
# MaterialTools - MaterialTools library
6061
# MeshTools - MeshTools library
6162
# Primitives - Primitives library
6263
# SceneGraph - SceneGraph library
@@ -367,8 +368,8 @@ endif()
367368
# Component distinction (listing them explicitly to avoid mistakes with finding
368369
# components from other repositories)
369370
set(_MAGNUM_LIBRARY_COMPONENTS
370-
Audio DebugTools GL MeshTools Primitives SceneGraph SceneTools Shaders
371-
ShaderTools Text TextureTools Trade
371+
Audio DebugTools GL MaterialTools MeshTools Primitives SceneGraph
372+
SceneTools Shaders ShaderTools Text TextureTools Trade
372373
WindowlessEglApplication EglContext OpenGLTester)
373374
set(_MAGNUM_PLUGIN_COMPONENTS
374375
AnyAudioImporter AnyImageConverter AnyImageImporter AnySceneConverter
@@ -432,6 +433,8 @@ if(MAGNUM_TARGET_GL)
432433
set(_MAGNUM_DebugTools_GL_DEPENDENCY_IS_OPTIONAL ON)
433434
endif()
434435

436+
set(_MAGNUM_MaterialTools_DEPENDENCIES Trade)
437+
435438
set(_MAGNUM_MeshTools_DEPENDENCIES Trade)
436439
if(MAGNUM_TARGET_GL)
437440
list(APPEND _MAGNUM_MeshTools_DEPENDENCIES GL)
@@ -883,6 +886,10 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
883886
INTERFACE_LINK_LIBRARIES OpenGLES3::OpenGLES3)
884887
endif()
885888

889+
# MaterialTools library
890+
elseif(_component STREQUAL MaterialTools)
891+
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES PhongToPbrMetallicRoughness.h)
892+
886893
# MeshTools library
887894
elseif(_component STREQUAL MeshTools)
888895
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h)
@@ -901,6 +908,10 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
901908

902909
# No special setup for SceneGraph library
903910

911+
# SceneTools library
912+
elseif(_component STREQUAL SceneTools)
913+
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES FlattenMeshHierarchy.h)
914+
904915
# ShaderTools library
905916
elseif(_component STREQUAL ShaderTools)
906917
set_property(TARGET Magnum::${_component} APPEND PROPERTY

src/cmake/FindMagnumPlugins.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ foreach(_component ${MagnumPlugins_FIND_COMPONENTS})
271271

272272
# Dynamic plugins don't have any prefix (e.g. `lib` on Linux),
273273
# search with empty prefix and then reset that back so we don't
274-
# accidentaly break something else
274+
# accidentally break something else
275275
set(_tmp_prefixes "${CMAKE_FIND_LIBRARY_PREFIXES}")
276276
set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};")
277277

src/cmake/dependencies.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ if(NOT USE_SYSTEM_MAGNUM)
197197
set(MAGNUM_TARGET_EGL ON CACHE BOOL "" FORCE)
198198
endif()
199199

200+
# These are enabled by default but we don't need them for anything yet
201+
set(MAGNUM_WITH_SHADERTOOLS OFF CACHE BOOL "" FORCE)
202+
set(MAGNUM_WITH_MATERIALTOOLS OFF CACHE BOOL "" FORCE)
203+
200204
# These are enabled by default but we don't need them if not building GUI
201205
# viewers -- disabling for slightly faster builds. If you need any of these
202206
# always, simply delete a line.

src/deps/corrade

Submodule corrade updated 134 files

src/deps/magnum

Submodule magnum updated 270 files

src/deps/magnum-plugins

Submodule magnum-plugins updated 122 files

src/esp/gfx/DebugLineRender.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ class DebugLineRender {
171171
Magnum::GL::Buffer buffer;
172172
Magnum::GL::Mesh mesh{Magnum::GL::MeshPrimitive::Lines};
173173
Magnum::Shaders::FlatGL3D shader{
174-
Magnum::Shaders::FlatGL3D::Flag::VertexColor};
174+
Magnum::Shaders::FlatGL3D::Configuration{}.setFlags(
175+
Magnum::Shaders::FlatGL3D::Flag::VertexColor)};
175176
};
176177

177178
std::vector<Magnum::Matrix4> _inputTransformStack;

0 commit comments

Comments
 (0)