Skip to content

Commit

Permalink
IGL: Switch to KTX-Software in TinyMesh_Large
Browse files Browse the repository at this point in the history
Summary:
This diff replaces usage of gli with KTX-Software. Later diffs will rework the IGLU texture_loader module to also make use of this.

This also switches the textures from ktx1 to ktx2.

Reviewed By: syeh1, corporateshark

Differential Revision: D49716504

fbshipit-source-id: 30fa5cd57fa8125f01d8da69ea2e5b7f84cc8515
  • Loading branch information
Eric Griffith authored and facebook-github-bot committed Sep 28, 2023
1 parent 646e4ce commit 42a221a
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 84 deletions.
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,37 @@ if(IGL_WITH_SAMPLES)
endif()
endif()

# KTX-Software forcibly includes fmt so prefer its version when building IGL_WITH_IGLU or IGL_WITH_SAMPLES
if (NOT EMSCRIPTEN)
if (IGL_WITH_IGLU OR IGL_WITH_SAMPLES)
set(KTX_FEATURE_DOC OFF CACHE BOOL "")
set(KTX_FEATURE_GL_UPLOAD OFF CACHE BOOL "")
set(KTX_FEATURE_JNI OFF CACHE BOOL "")
set(KTX_FEATURE_KTX1 ON CACHE BOOL "")
set(KTX_FEATURE_KTX2 ON CACHE BOOL "")
set(KTX_FEATURE_LOADTEST_APPS OFF CACHE BOOL "")
set(KTX_FEATURE_STATIC_LIBRARY ON CACHE BOOL "")
set(KTX_FEATURE_TESTS OFF CACHE BOOL "")
set(KTX_FEATURE_TOOLS OFF CACHE BOOL "")
set(KTX_FEATURE_VK_UPLOAD OFF CACHE BOOL "")
add_subdirectory(third-party/deps/src/ktx-software)
igl_set_folder(astcenc-avx2-static "third-party/ktx-software")
igl_set_folder(ktx "third-party/ktx-software")
igl_set_folder(ktx_read "third-party/ktx-software")
igl_set_folder(ktx_version "third-party/ktx-software")
igl_set_folder(makedfd2vk "third-party/ktx-software")
igl_set_folder(makevk2dfd "third-party/ktx-software")
igl_set_folder(mkvk "third-party/ktx-software")
igl_set_folder(mkvkformatfiles "third-party/ktx-software")
igl_set_folder(obj_basisu_cbind "third-party/ktx-software")
igl_set_folder(objUtil "third-party/ktx-software")
igl_set_folder(fmt "third-party")
elseif (IGL_WITH_VULKAN)
add_subdirectory(third-party/deps/src/fmt "fmt")
igl_set_folder(fmt "third-party")
endif()
endif()

if(IGL_WITH_TRACY)
target_link_libraries(IGLLibrary PUBLIC TracyClient)
endif()
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ https://github.com/nigels-com/glew/blob/master/LICENSE.txt
glfw
https://github.com/glfw/glfw/blob/master/LICENSE.md

gli
https://github.com/g-truc/gli#readme

glm
https://github.com/g-truc/glm

Expand All @@ -71,6 +68,9 @@ https://github.com/ocornut/imgui/blob/master/LICENSE.txt
ios-cmake
https://github.com/leetal/ios-cmake/blob/master/LICENSE.md

KTX-Software
https://github.com/KhronosGroup/KTX-Software/blob/main/LICENSE.md

Meshoptimizer
https://github.com/zeux/meshoptimizer/blob/master/LICENSE.md

Expand Down
1 change: 1 addition & 0 deletions samples/desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ macro(ADD_DEMO app)
target_link_libraries(${app} PRIVATE meshoptimizer)
target_link_libraries(${app} PRIVATE tinyobjloader)
target_link_libraries(${app} PRIVATE glfw)
target_link_libraries(${app} PRIVATE ktx)
if(IGL_WITH_IGLU)
target_link_libraries(${app} PRIVATE IGLUimgui)
target_link_libraries(${app} PRIVATE IGLUsimple_renderer)
Expand Down
Loading

0 comments on commit 42a221a

Please sign in to comment.