mirror of
https://github.com/toyota-connected/ivi-homescreen-plugins.git
synced 2026-06-21 07:19:32 -07:00
Removed filament_view plugin
This commit is contained in:
@@ -103,49 +103,6 @@ jobs:
|
||||
ninja -C buildDir install
|
||||
ls -laR $LIBCAMERA_STAGING
|
||||
|
||||
- name: Cache filament
|
||||
id: cache-filament-1-65-2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-filament-1-65-2
|
||||
path: |
|
||||
${{github.workspace}}/filament/cmake-build-release/staging/release/*
|
||||
|
||||
- name: Build Filament
|
||||
if: steps.cache-filament-1-65-2.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
git clone -b release https://github.com/google/filament.git
|
||||
cd filament
|
||||
git checkout v1.65.2
|
||||
PATCHES=${{github.workspace}}/.github/workflows/patches
|
||||
git apply $PATCHES/filament/0001-disable-backend-tests-1.65.2.patch
|
||||
git apply $PATCHES/filament/0002-install-required-files.patch
|
||||
git apply $PATCHES/filament/0003-move-include-contents-to-include-filament.patch
|
||||
git apply $PATCHES/filament/0004-move-libraries-so-they-install-1.65.2.patch
|
||||
git apply $PATCHES/filament/0005-spirv-tools-threads.patch
|
||||
FILAMENT_BUILD_DIR=$PWD/cmake-build-release
|
||||
FILAMENT_STAGING_DIR=${FILAMENT_BUILD_DIR}/staging/release
|
||||
mkdir -p $FILAMENT_BUILD_DIR
|
||||
cd $FILAMENT_BUILD_DIR
|
||||
CC=/usr/bin/clang CXX=/usr/bin/clang++ \
|
||||
cmake .. -GNinja \
|
||||
-DFILAMENT_SUPPORTS_VULKAN=ON \
|
||||
-DFILAMENT_ENABLE_LTO=OFF \
|
||||
-DFILAMENT_SUPPORTS_OPENGL=OFF \
|
||||
-DFILAMENT_USE_EXTERNAL_GLES3=OFF \
|
||||
-DFILAMENT_SUPPORTS_WAYLAND=ON \
|
||||
-DFILAMENT_SUPPORTS_X11=OFF \
|
||||
-DFILAMENT_SUPPORTS_XCB=OFF \
|
||||
-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF \
|
||||
-DFILAMENT_SKIP_SDL2=ON \
|
||||
-DFILAMENT_SKIP_SAMPLES=ON \
|
||||
-DFILAMENT_USE_SWIFTSHADER=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_STAGING_PREFIX=${FILAMENT_STAGING_DIR} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
ninja -C . install
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
@@ -176,9 +133,6 @@ jobs:
|
||||
-D BUILD_PLUGIN_COMP_REGION=OFF \
|
||||
-D BUILD_PLUGIN_COMP_SURF=OFF \
|
||||
-D BUILD_PLUGIN_DESKTOP_WINDOW_LINUX=ON \
|
||||
-D BUILD_PLUGIN_FILAMENT_VIEW=ON \
|
||||
-D FILAMENT_INCLUDE_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/include \
|
||||
-D FILAMENT_LINK_LIBRARIES_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/lib/x86_64 \
|
||||
-D BUILD_PLUGIN_FILE_SELECTOR=ON \
|
||||
-D BUILD_PLUGIN_FIREBASE_AUTH=OFF \
|
||||
-D BUILD_PLUGIN_FIREBASE_CORE=OFF \
|
||||
@@ -225,9 +179,6 @@ jobs:
|
||||
-warnings-as-errors='*,-bugprone-macro-parentheses' \
|
||||
-export-fixes=tidy-results-suggested-fixes.txt \
|
||||
-extra-arg='-I${{github.workspace}}/ivi-homescreen/build/third_party/waypp/waypp/protocols' \
|
||||
-extra-arg='-I${{github.workspace}}/filament/cmake-build-release/staging/release/include' \
|
||||
-extra-arg='-I${{github.workspace}}/filament/cmake-build-release/staging/release/include/filament' \
|
||||
-extra-arg='-I${{github.workspace}}/filament/lib/utils/include' \
|
||||
$FILE_LIST > tidy-results-log.txt
|
||||
|
||||
- name: Show results
|
||||
|
||||
@@ -141,50 +141,6 @@ jobs:
|
||||
ninja -C buildDir install
|
||||
ls -laR $LIBCAMERA_STAGING
|
||||
|
||||
- name: Cache filament
|
||||
id: cache-filament
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-filament
|
||||
path: |
|
||||
${{github.workspace}}/filament/cmake-build-release/staging/release/*
|
||||
|
||||
- name: Build Filament
|
||||
if: steps.cache-filament.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
git clone -b release https://github.com/google/filament.git
|
||||
cd filament
|
||||
git checkout v1.56.7
|
||||
PATCHES=${{github.workspace}}/.github/workflows/patches
|
||||
git apply $PATCHES/filament/0001-disable-backend-tests.patch
|
||||
git apply $PATCHES/filament/0002-install-required-files.patch
|
||||
git apply $PATCHES/filament/0003-move-include-contents-to-include-filament.patch
|
||||
git apply $PATCHES/filament/0004-move-libraries-so-they-install.patch
|
||||
git apply $PATCHES/filament/0005-return-shader-type-mobile-for-linux-vulkan.patch
|
||||
|
||||
FILAMENT_BUILD_DIR=$PWD/cmake-build-release
|
||||
FILAMENT_STAGING_DIR=${FILAMENT_BUILD_DIR}/staging/release
|
||||
mkdir -p $FILAMENT_BUILD_DIR
|
||||
cd $FILAMENT_BUILD_DIR
|
||||
CC=/usr/bin/clang CXX=/usr/bin/clang++ \
|
||||
cmake .. -GNinja \
|
||||
-DFILAMENT_SUPPORTS_VULKAN=ON \
|
||||
-DFILAMENT_ENABLE_LTO=ON \
|
||||
-DFILAMENT_SUPPORTS_OPENGL=OFF \
|
||||
-DFILAMENT_USE_EXTERNAL_GLES3=OFF \
|
||||
-DFILAMENT_SUPPORTS_WAYLAND=ON \
|
||||
-DFILAMENT_SUPPORTS_X11=OFF \
|
||||
-DFILAMENT_SUPPORTS_XCB=OFF \
|
||||
-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF \
|
||||
-DFILAMENT_SKIP_SDL2=ON \
|
||||
-DFILAMENT_SKIP_SAMPLES=ON \
|
||||
-DFILAMENT_USE_SWIFTSHADER=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_STAGING_PREFIX=${FILAMENT_STAGING_DIR} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
ninja -C . install
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
find /usr -iname "llvm-config*"
|
||||
@@ -214,9 +170,6 @@ jobs:
|
||||
-D BUILD_PLUGIN_COMP_REGION=OFF \
|
||||
-D BUILD_PLUGIN_COMP_SURF=OFF \
|
||||
-D BUILD_PLUGIN_DESKTOP_WINDOW_LINUX=ON \
|
||||
-D BUILD_PLUGIN_FILAMENT_VIEW=ON \
|
||||
-D FILAMENT_INCLUDE_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/include \
|
||||
-D FILAMENT_LINK_LIBRARIES_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/lib/x86_64 \
|
||||
-D BUILD_PLUGIN_FILE_SELECTOR=ON \
|
||||
-D BUILD_PLUGIN_FIREBASE_AUTH=OFF \
|
||||
-D BUILD_PLUGIN_FIREBASE_CORE=OFF \
|
||||
|
||||
@@ -101,49 +101,6 @@ jobs:
|
||||
ninja -C buildDir install
|
||||
ls -laR $LIBCAMERA_STAGING
|
||||
|
||||
- name: Cache filament
|
||||
id: cache-filament-1-65-2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-filament-1-65-2
|
||||
path: |
|
||||
${{github.workspace}}/filament/cmake-build-release/staging/release/*
|
||||
|
||||
- name: Build Filament
|
||||
if: steps.cache-filament-1-65-2.outputs.cache-hit != 'true'
|
||||
working-directory: ${{github.workspace}}
|
||||
run: |
|
||||
git clone -b release https://github.com/google/filament.git
|
||||
cd filament
|
||||
git checkout v1.65.2
|
||||
PATCHES=${{github.workspace}}/.github/workflows/patches
|
||||
git apply $PATCHES/filament/0001-disable-backend-tests-1.65.2.patch
|
||||
git apply $PATCHES/filament/0002-install-required-files.patch
|
||||
git apply $PATCHES/filament/0003-move-include-contents-to-include-filament.patch
|
||||
git apply $PATCHES/filament/0004-move-libraries-so-they-install-1.65.2.patch
|
||||
git apply $PATCHES/filament/0005-spirv-tools-threads.patch
|
||||
FILAMENT_BUILD_DIR=$PWD/cmake-build-release
|
||||
FILAMENT_STAGING_DIR=${FILAMENT_BUILD_DIR}/staging/release
|
||||
mkdir -p $FILAMENT_BUILD_DIR
|
||||
cd $FILAMENT_BUILD_DIR
|
||||
CC=/usr/bin/clang CXX=/usr/bin/clang++ \
|
||||
cmake .. -GNinja \
|
||||
-DFILAMENT_SUPPORTS_VULKAN=ON \
|
||||
-DFILAMENT_ENABLE_LTO=OFF \
|
||||
-DFILAMENT_SUPPORTS_OPENGL=OFF \
|
||||
-DFILAMENT_USE_EXTERNAL_GLES3=OFF \
|
||||
-DFILAMENT_SUPPORTS_WAYLAND=ON \
|
||||
-DFILAMENT_SUPPORTS_X11=OFF \
|
||||
-DFILAMENT_SUPPORTS_XCB=OFF \
|
||||
-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF \
|
||||
-DFILAMENT_SKIP_SDL2=ON \
|
||||
-DFILAMENT_SKIP_SAMPLES=ON \
|
||||
-DFILAMENT_USE_SWIFTSHADER=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_STAGING_PREFIX=${FILAMENT_STAGING_DIR} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
ninja -C . install
|
||||
|
||||
- name: Configure Debug
|
||||
run: |
|
||||
mkdir -p ${{github.workspace}}/build/debug
|
||||
@@ -177,9 +134,6 @@ jobs:
|
||||
-D BUILD_PLUGIN_COMP_REGION=OFF \
|
||||
-D BUILD_PLUGIN_COMP_SURF=OFF \
|
||||
-D BUILD_PLUGIN_DESKTOP_WINDOW_LINUX=ON \
|
||||
-D BUILD_PLUGIN_FILAMENT_VIEW=ON \
|
||||
-D FILAMENT_INCLUDE_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/include \
|
||||
-D FILAMENT_LINK_LIBRARIES_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/lib/x86_64 \
|
||||
-D BUILD_PLUGIN_FILE_SELECTOR=ON \
|
||||
-D BUILD_PLUGIN_FIREBASE_AUTH=OFF \
|
||||
-D BUILD_PLUGIN_FIREBASE_CORE=OFF \
|
||||
@@ -254,9 +208,6 @@ jobs:
|
||||
-D BUILD_PLUGIN_COMP_REGION=OFF \
|
||||
-D BUILD_PLUGIN_COMP_SURF=OFF \
|
||||
-D BUILD_PLUGIN_DESKTOP_WINDOW_LINUX=ON \
|
||||
-D BUILD_PLUGIN_FILAMENT_VIEW=ON \
|
||||
-D FILAMENT_INCLUDE_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/include \
|
||||
-D FILAMENT_LINK_LIBRARIES_DIR=${{github.workspace}}/filament/cmake-build-release/staging/release/lib/x86_64 \
|
||||
-D BUILD_PLUGIN_FILE_SELECTOR=ON \
|
||||
-D BUILD_PLUGIN_FIREBASE_AUTH=OFF \
|
||||
-D BUILD_PLUGIN_FIREBASE_CORE=OFF \
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0c4bc86bbfc883db61b585a21d2653ca8514f2f7 Mon Sep 17 00:00:00 2001
|
||||
From: Joel Winarske <joel.winarske@gmail.com>
|
||||
Date: Fri, 26 Sep 2025 07:13:07 -0700
|
||||
Subject: [PATCH] disable backend tests 1.65.2
|
||||
|
||||
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
|
||||
---
|
||||
filament/backend/CMakeLists.txt | 9 ---------
|
||||
1 file changed, 9 deletions(-)
|
||||
|
||||
diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt
|
||||
index 989078622..48c1d0a84 100644
|
||||
--- a/filament/backend/CMakeLists.txt
|
||||
+++ b/filament/backend/CMakeLists.txt
|
||||
@@ -660,15 +660,6 @@ if (APPLE AND NOT IOS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-if (LINUX)
|
||||
- add_executable(backend_test_linux test/linux_runner.cpp ${BACKEND_TEST_SRC})
|
||||
- target_link_libraries(backend_test_linux PRIVATE ${BACKEND_TEST_LIBS})
|
||||
- set_target_properties(backend_test_linux PROPERTIES FOLDER Tests)
|
||||
- if (FILAMENT_SUPPORTS_WEBGPU)
|
||||
- target_link_libraries(backend_test_linux PRIVATE webgpu_dawn dawncpp_headers)
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
# ==================================================================================================
|
||||
# Compute tests
|
||||
#
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From e7b701237581835e1267c30b3f5ef9cbd5b447c5 Mon Sep 17 00:00:00 2001
|
||||
From: Joel Winarske <joel.winarske@gmail.com>
|
||||
Date: Sun, 26 Jan 2025 10:42:12 -0800
|
||||
Subject: [PATCH 2/5] install required files
|
||||
|
||||
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
|
||||
---
|
||||
libs/imageio/CMakeLists.txt | 6 ++++++
|
||||
third_party/libpng/tnt/CMakeLists.txt | 2 ++
|
||||
third_party/stb/tnt/CMakeLists.txt | 1 +
|
||||
third_party/tinyexr/tnt/CMakeLists.txt | 5 ++++-
|
||||
4 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libs/imageio/CMakeLists.txt b/libs/imageio/CMakeLists.txt
|
||||
index 47544655b..7169da462 100644
|
||||
--- a/libs/imageio/CMakeLists.txt
|
||||
+++ b/libs/imageio/CMakeLists.txt
|
||||
@@ -44,3 +44,9 @@ endif()
|
||||
if (NOT MSVC)
|
||||
target_compile_options(${TARGET} PRIVATE -Wno-deprecated-register)
|
||||
endif()
|
||||
+
|
||||
+# ==================================================================================================
|
||||
+# Installation
|
||||
+# ==================================================================================================
|
||||
+install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/imageio DESTINATION include/filament)
|
||||
diff --git a/third_party/libpng/tnt/CMakeLists.txt b/third_party/libpng/tnt/CMakeLists.txt
|
||||
index cd5a033f5..4925a0474 100644
|
||||
--- a/third_party/libpng/tnt/CMakeLists.txt
|
||||
+++ b/third_party/libpng/tnt/CMakeLists.txt
|
||||
@@ -57,3 +57,5 @@ target_link_libraries(${TARGET} PUBLIC z)
|
||||
# specify where the public headers of this library are
|
||||
target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR})
|
||||
set_target_properties(${TARGET} PROPERTIES FOLDER ThirdParty)
|
||||
+
|
||||
+install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
diff --git a/third_party/stb/tnt/CMakeLists.txt b/third_party/stb/tnt/CMakeLists.txt
|
||||
index 0c25061c0..563a2604d 100644
|
||||
--- a/third_party/stb/tnt/CMakeLists.txt
|
||||
+++ b/third_party/stb/tnt/CMakeLists.txt
|
||||
@@ -15,3 +15,4 @@ target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR})
|
||||
set_target_properties(${TARGET} PROPERTIES FOLDER ThirdParty)
|
||||
|
||||
install(TARGETS stb ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
+install(FILES ${PUBLIC_HDRS} DESTINATION include/filament)
|
||||
diff --git a/third_party/tinyexr/tnt/CMakeLists.txt b/third_party/tinyexr/tnt/CMakeLists.txt
|
||||
index 20955b77b..ffe7cdfe1 100644
|
||||
--- a/third_party/tinyexr/tnt/CMakeLists.txt
|
||||
+++ b/third_party/tinyexr/tnt/CMakeLists.txt
|
||||
@@ -20,4 +20,7 @@ include_directories(${PUBLIC_HDR_DIR})
|
||||
add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS})
|
||||
target_include_directories (${TARGET} PUBLIC ${PUBLIC_HDR_DIR})
|
||||
target_link_libraries(${TARGET} LINK_PUBLIC z)
|
||||
-set_target_properties(${TARGET} PROPERTIES FOLDER ThirdParty)
|
||||
\ No newline at end of file
|
||||
+set_target_properties(${TARGET} PROPERTIES FOLDER ThirdParty)
|
||||
+
|
||||
+install(FILES ${PUBLIC_HDRS} DESTINATION include/filament)
|
||||
+install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
--
|
||||
2.48.1
|
||||
|
||||
-239
@@ -1,239 +0,0 @@
|
||||
diff --git a/filament/CMakeLists.txt b/filament/CMakeLists.txt
|
||||
index fae6565..3bbb22b 100644
|
||||
--- a/filament/CMakeLists.txt
|
||||
+++ b/filament/CMakeLists.txt
|
||||
@@ -651,7 +651,7 @@ target_link_libraries(${TARGET} PRIVATE
|
||||
# ==================================================================================================
|
||||
set(INSTALL_TYPE ARCHIVE)
|
||||
install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include/filament)
|
||||
install(FILES "README.md" DESTINATION .)
|
||||
install(FILES "../LICENSE" DESTINATION .)
|
||||
|
||||
diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt
|
||||
index 24cc789..4bfd9c5 100644
|
||||
--- a/filament/backend/CMakeLists.txt
|
||||
+++ b/filament/backend/CMakeLists.txt
|
||||
@@ -493,7 +493,7 @@ target_link_libraries(${TARGET} PRIVATE
|
||||
set(INSTALL_TYPE ARCHIVE)
|
||||
install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
install(TARGETS vkshaders ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/backend DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/backend DESTINATION include/filament)
|
||||
|
||||
if (FILAMENT_SUPPORTS_WEBGPU)
|
||||
install(TARGETS webgpu_dawn ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
diff --git a/libs/camutils/CMakeLists.txt b/libs/camutils/CMakeLists.txt
|
||||
index 541261c..013cbce 100644
|
||||
--- a/libs/camutils/CMakeLists.txt
|
||||
+++ b/libs/camutils/CMakeLists.txt
|
||||
@@ -45,7 +45,7 @@ endif()
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/camutils DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/camutils DESTINATION include/filament)
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/libs/filabridge/CMakeLists.txt b/libs/filabridge/CMakeLists.txt
|
||||
index 6840ce5..9627713 100644
|
||||
--- a/libs/filabridge/CMakeLists.txt
|
||||
+++ b/libs/filabridge/CMakeLists.txt
|
||||
@@ -32,5 +32,5 @@ target_link_libraries(${TARGET} backend_headers)
|
||||
# ==================================================================================================
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include/filament)
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt
|
||||
index 3d790b0..dd397df 100644
|
||||
--- a/libs/filamat/CMakeLists.txt
|
||||
+++ b/libs/filamat/CMakeLists.txt
|
||||
@@ -144,7 +144,7 @@ combine_static_libs(filamat "${FILAMAT_COMBINED_OUTPUT}" "${FILAMAT_DEPS}")
|
||||
|
||||
set(FILAMAT_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}filamat${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
install(FILES "${FILAMAT_COMBINED_OUTPUT}" DESTINATION lib/${DIST_DIR} RENAME ${FILAMAT_LIB_NAME})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/filamat DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/filamat DESTINATION include/filament)
|
||||
|
||||
# Need to install libtint for filamat on Android.
|
||||
# See libs/filamat/CMakeLists.txt and android/filamat-android/CMakeLists.txt.
|
||||
diff --git a/libs/filameshio/CMakeLists.txt b/libs/filameshio/CMakeLists.txt
|
||||
index eab3192..7143002 100644
|
||||
--- a/libs/filameshio/CMakeLists.txt
|
||||
+++ b/libs/filameshio/CMakeLists.txt
|
||||
@@ -32,7 +32,7 @@ target_link_libraries(${TARGET}
|
||||
# ==================================================================================================
|
||||
set(INSTALL_TYPE ARCHIVE)
|
||||
install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
-install(FILES ${DIST_HDRS} DESTINATION include/${TARGET})
|
||||
+install(FILES ${DIST_HDRS} DESTINATION include/filament/${TARGET})
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/libs/geometry/CMakeLists.txt b/libs/geometry/CMakeLists.txt
|
||||
index a7e8f39..5a5bb88 100644
|
||||
--- a/libs/geometry/CMakeLists.txt
|
||||
+++ b/libs/geometry/CMakeLists.txt
|
||||
@@ -55,7 +55,7 @@ endif()
|
||||
# No need to install since we're combining this lib and the dependent libs into a combined lib
|
||||
# install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/geometry DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/geometry DESTINATION include/filament)
|
||||
|
||||
set(COMBINED_DEPS
|
||||
${TARGET}
|
||||
diff --git a/libs/gltfio/CMakeLists.txt b/libs/gltfio/CMakeLists.txt
|
||||
index 373df1f..de289cf 100644
|
||||
--- a/libs/gltfio/CMakeLists.txt
|
||||
+++ b/libs/gltfio/CMakeLists.txt
|
||||
@@ -265,5 +265,5 @@ endif()
|
||||
# ==================================================================================================
|
||||
|
||||
install(TARGETS gltfio_core uberarchive ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/gltfio DESTINATION include)
|
||||
-install(FILES ${RESOURCE_DIR}/materials/uberarchive.h DESTINATION include/gltfio/materials)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/gltfio DESTINATION include/filament)
|
||||
+install(FILES ${RESOURCE_DIR}/materials/uberarchive.h DESTINATION include/filament/gltfio/materials)
|
||||
diff --git a/libs/iblprefilter/CMakeLists.txt b/libs/iblprefilter/CMakeLists.txt
|
||||
index c001de6..62066b3 100644
|
||||
--- a/libs/iblprefilter/CMakeLists.txt
|
||||
+++ b/libs/iblprefilter/CMakeLists.txt
|
||||
@@ -135,4 +135,4 @@ target_link_libraries(${TARGET} PRIVATE
|
||||
# ==================================================================================================
|
||||
set(INSTALL_TYPE ARCHIVE)
|
||||
install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament-iblprefilter DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/filament-iblprefilter DESTINATION include/filament)
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/libs/ktxreader/CMakeLists.txt b/libs/ktxreader/CMakeLists.txt
|
||||
index a9d5714..039ee6a 100644
|
||||
--- a/libs/ktxreader/CMakeLists.txt
|
||||
+++ b/libs/ktxreader/CMakeLists.txt
|
||||
@@ -41,7 +41,7 @@ endif()
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/${TARGET} DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/${TARGET} DESTINATION include/filament)
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt
|
||||
index 838aa2d..4256d66 100644
|
||||
--- a/libs/math/CMakeLists.txt
|
||||
+++ b/libs/math/CMakeLists.txt
|
||||
@@ -47,7 +47,7 @@ set_target_properties(${TARGET} PROPERTIES FOLDER Libs)
|
||||
# ==================================================================================================
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/math DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/math DESTINATION include/filament)
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/libs/mathio/CMakeLists.txt b/libs/mathio/CMakeLists.txt
|
||||
index 4ad5126..96b5287 100644
|
||||
--- a/libs/mathio/CMakeLists.txt
|
||||
+++ b/libs/mathio/CMakeLists.txt
|
||||
@@ -27,5 +27,5 @@ target_link_libraries(${TARGET} PRIVATE math)
|
||||
# ==================================================================================================
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/mathio DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/mathio DESTINATION include/filament)
|
||||
|
||||
diff --git a/libs/uberz/CMakeLists.txt b/libs/uberz/CMakeLists.txt
|
||||
index 47744e2..85569b5 100644
|
||||
--- a/libs/uberz/CMakeLists.txt
|
||||
+++ b/libs/uberz/CMakeLists.txt
|
||||
@@ -44,4 +44,4 @@ endif()
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/uberz DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/uberz DESTINATION include/filament)
|
||||
diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt
|
||||
index 3af98d0..ebb02e4 100644
|
||||
--- a/libs/utils/CMakeLists.txt
|
||||
+++ b/libs/utils/CMakeLists.txt
|
||||
@@ -139,11 +139,11 @@ endif()
|
||||
# ==================================================================================================
|
||||
set(INSTALL_TYPE ARCHIVE)
|
||||
install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR})
|
||||
-install(FILES ${DIST_HDRS} DESTINATION include/${TARGET})
|
||||
+install(FILES ${DIST_HDRS} DESTINATION include/filament/${TARGET})
|
||||
if (ANDROID)
|
||||
- install(FILES ${DIST_ANDROID_HDRS} DESTINATION include/${TARGET_LINUX})
|
||||
+ install(FILES ${DIST_ANDROID_HDRS} DESTINATION include/filament/${TARGET_LINUX})
|
||||
else()
|
||||
- install(FILES ${DIST_GENERIC_HDRS} DESTINATION include/${TARGET_GENERIC})
|
||||
+ install(FILES ${DIST_GENERIC_HDRS} DESTINATION include/filament/${TARGET_GENERIC})
|
||||
endif()
|
||||
|
||||
# ==================================================================================================
|
||||
diff --git a/libs/viewer/CMakeLists.txt b/libs/viewer/CMakeLists.txt
|
||||
index 3b67fde..5e40ef1 100644
|
||||
--- a/libs/viewer/CMakeLists.txt
|
||||
+++ b/libs/viewer/CMakeLists.txt
|
||||
@@ -54,7 +54,7 @@ endif()
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/viewer DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/viewer DESTINATION include/filament)
|
||||
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
diff --git a/third_party/libassimp/contrib/zip/CMakeLists.txt b/third_party/libassimp/contrib/zip/CMakeLists.txt
|
||||
index b46dbb1..368017a 100644
|
||||
--- a/third_party/libassimp/contrib/zip/CMakeLists.txt
|
||||
+++ b/third_party/libassimp/contrib/zip/CMakeLists.txt
|
||||
@@ -33,7 +33,7 @@ install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
COMPONENT library)
|
||||
-install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION include)
|
||||
+install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION include/filament)
|
||||
|
||||
# uninstall target (https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake)
|
||||
if(NOT TARGET uninstall)
|
||||
diff --git a/third_party/libsdl2/CMakeLists.txt b/third_party/libsdl2/CMakeLists.txt
|
||||
index 8f1e828..b1d7cbd 100644
|
||||
--- a/third_party/libsdl2/CMakeLists.txt
|
||||
+++ b/third_party/libsdl2/CMakeLists.txt
|
||||
@@ -1806,7 +1806,7 @@ foreach(_FNAME ${BIN_INCLUDE_FILES})
|
||||
list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
|
||||
endforeach()
|
||||
list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
|
||||
-install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
|
||||
+install(FILES ${INCLUDE_FILES} DESTINATION include/filament/SDL2)
|
||||
|
||||
if(NOT (WINDOWS OR CYGWIN))
|
||||
if(SDL_SHARED)
|
||||
diff --git a/third_party/mikktspace/CMakeLists.txt b/third_party/mikktspace/CMakeLists.txt
|
||||
index 36959ae..6c8fead 100644
|
||||
--- a/third_party/mikktspace/CMakeLists.txt
|
||||
+++ b/third_party/mikktspace/CMakeLists.txt
|
||||
@@ -26,4 +26,4 @@ endif()
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
||||
-install(DIRECTORY ${PUBLIC_HDR_DIR}/mikktspace DESTINATION include)
|
||||
+install(DIRECTORY ${PUBLIC_HDR_DIR}/mikktspace DESTINATION include/filament)
|
||||
diff --git a/third_party/robin-map/tnt/CMakeLists.txt b/third_party/robin-map/tnt/CMakeLists.txt
|
||||
index 300da52..ef5ef82 100644
|
||||
--- a/third_party/robin-map/tnt/CMakeLists.txt
|
||||
+++ b/third_party/robin-map/tnt/CMakeLists.txt
|
||||
@@ -27,4 +27,4 @@ set_target_properties(${TARGET} PROPERTIES FOLDER ThirdParty)
|
||||
# ==================================================================================================
|
||||
# Installation
|
||||
# ==================================================================================================
|
||||
-install(FILES ${PUBLIC_HDRS} DESTINATION include/${TARGET})
|
||||
+install(FILES ${PUBLIC_HDRS} DESTINATION include/filament/${TARGET})
|
||||
@@ -1,53 +0,0 @@
|
||||
From 96ddb443dca9a60a53df5acb6f8553d7526892dc Mon Sep 17 00:00:00 2001
|
||||
From: Joel Winarske <joel.winarske@gmail.com>
|
||||
Date: Fri, 26 Sep 2025 06:35:12 -0700
|
||||
Subject: [PATCH] move libraries so they install
|
||||
|
||||
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 15f5f52ac5..015fb9e771 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -808,6 +808,7 @@ add_subdirectory(${LIBRARIES}/gltfio)
|
||||
add_subdirectory(${LIBRARIES}/ibl)
|
||||
add_subdirectory(${LIBRARIES}/iblprefilter)
|
||||
add_subdirectory(${LIBRARIES}/image)
|
||||
+add_subdirectory(${LIBRARIES}/imageio)
|
||||
add_subdirectory(${LIBRARIES}/ktxreader)
|
||||
add_subdirectory(${LIBRARIES}/math)
|
||||
add_subdirectory(${LIBRARIES}/mathio)
|
||||
@@ -829,7 +830,10 @@ add_subdirectory(${EXTERNAL}/draco/tnt)
|
||||
add_subdirectory(${EXTERNAL}/jsmn/tnt)
|
||||
add_subdirectory(${EXTERNAL}/stb/tnt)
|
||||
add_subdirectory(${EXTERNAL}/getopt)
|
||||
+add_subdirectory(${EXTERNAL}/libpng/tnt)
|
||||
add_subdirectory(${EXTERNAL}/perfetto/tnt)
|
||||
+add_subdirectory(${EXTERNAL}/tinyexr/tnt)
|
||||
+add_subdirectory(${EXTERNAL}/libz/tnt)
|
||||
add_subdirectory(${EXTERNAL}/zstd/tnt)
|
||||
|
||||
# Note that this has to be placed after mikktspace in order for combine_static_libs to work.
|
||||
@@ -882,16 +886,12 @@ if (IS_HOST_PLATFORM)
|
||||
if (NOT FILAMENT_SKIP_SDL2)
|
||||
add_subdirectory(${LIBRARIES}/filamentapp)
|
||||
endif()
|
||||
- add_subdirectory(${LIBRARIES}/imageio)
|
||||
add_subdirectory(${LIBRARIES}/filament-matp)
|
||||
|
||||
add_subdirectory(${FILAMENT}/samples)
|
||||
|
||||
add_subdirectory(${EXTERNAL}/libassimp/tnt)
|
||||
- add_subdirectory(${EXTERNAL}/libpng/tnt)
|
||||
add_subdirectory(${EXTERNAL}/libsdl2/tnt)
|
||||
- add_subdirectory(${EXTERNAL}/libz/tnt)
|
||||
- add_subdirectory(${EXTERNAL}/tinyexr/tnt)
|
||||
|
||||
add_subdirectory(${TOOLS}/cmgen)
|
||||
add_subdirectory(${TOOLS}/cso-lut)
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From a06e514a0ace502163b1a1074871303bafa81903 Mon Sep 17 00:00:00 2001
|
||||
From: Joel Winarske <joel.winarske@gmail.com>
|
||||
Date: Fri, 26 Sep 2025 14:26:07 -0700
|
||||
Subject: [PATCH] spirv-tools threads
|
||||
|
||||
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
|
||||
---
|
||||
third_party/spirv-tools/CMakeLists.txt | 2 ++
|
||||
third_party/spirv-tools/examples/CMakeLists.txt | 2 +-
|
||||
third_party/spirv-tools/tools/CMakeLists.txt | 2 +-
|
||||
3 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/third_party/spirv-tools/CMakeLists.txt b/third_party/spirv-tools/CMakeLists.txt
|
||||
index affc49ed8..7ce7744c9 100644
|
||||
--- a/third_party/spirv-tools/CMakeLists.txt
|
||||
+++ b/third_party/spirv-tools/CMakeLists.txt
|
||||
@@ -56,6 +56,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
option(ENABLE_RTTI "Enables RTTI" OFF)
|
||||
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
|
||||
|
||||
+find_package(Threads)
|
||||
+
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
|
||||
diff --git a/third_party/spirv-tools/examples/CMakeLists.txt b/third_party/spirv-tools/examples/CMakeLists.txt
|
||||
index fd627cbda..7c723897b 100644
|
||||
--- a/third_party/spirv-tools/examples/CMakeLists.txt
|
||||
+++ b/third_party/spirv-tools/examples/CMakeLists.txt
|
||||
@@ -27,7 +27,7 @@ function(add_spvtools_example)
|
||||
|
||||
add_executable(${ARG_TARGET} ${ARG_SRCS})
|
||||
spvtools_default_compile_options(${ARG_TARGET})
|
||||
- target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS})
|
||||
+ target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools examples")
|
||||
endif()
|
||||
endfunction()
|
||||
diff --git a/third_party/spirv-tools/tools/CMakeLists.txt b/third_party/spirv-tools/tools/CMakeLists.txt
|
||||
index f5e830f57..8ad87ca32 100644
|
||||
--- a/third_party/spirv-tools/tools/CMakeLists.txt
|
||||
+++ b/third_party/spirv-tools/tools/CMakeLists.txt
|
||||
@@ -40,7 +40,7 @@ function(add_spvtools_tool)
|
||||
endif()
|
||||
|
||||
spvtools_default_compile_options(${ARG_TARGET})
|
||||
- target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS})
|
||||
+ target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(${ARG_TARGET} PRIVATE
|
||||
${spirv-tools_SOURCE_DIR}
|
||||
${spirv-tools_BINARY_DIR}
|
||||
--
|
||||
2.51.0
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
From 28ed6e3d6b5df4fc6ce9d11cda04144cce67b653 Mon Sep 17 00:00:00 2001
|
||||
From: Joel Winarske <joel.winarske@gmail.com>
|
||||
Date: Sun, 26 Jan 2025 11:03:15 -0800
|
||||
Subject: [PATCH 5/5] return shader type mobile for linux vulkan
|
||||
|
||||
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
|
||||
---
|
||||
filament/backend/src/vulkan/VulkanDriver.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/filament/backend/src/vulkan/VulkanDriver.cpp b/filament/backend/src/vulkan/VulkanDriver.cpp
|
||||
index 520ea22b7..3cb61dd24 100644
|
||||
--- a/filament/backend/src/vulkan/VulkanDriver.cpp
|
||||
+++ b/filament/backend/src/vulkan/VulkanDriver.cpp
|
||||
@@ -288,7 +288,7 @@ Driver* VulkanDriver::create(VulkanPlatform* platform, VulkanContext const& cont
|
||||
}
|
||||
|
||||
ShaderModel VulkanDriver::getShaderModel() const noexcept {
|
||||
-#if defined(__ANDROID__) || defined(FILAMENT_IOS)
|
||||
+#if defined(__ANDROID__) || defined(FILAMENT_IOS) || defined(__linux__)
|
||||
return ShaderModel::MOBILE;
|
||||
#else
|
||||
return ShaderModel::DESKTOP;
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
||||
message(FATAL_ERROR "CMake >= 2.8.0 required")
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||
message(FATAL_ERROR "CMake >= 2.8.3 required")
|
||||
endif()
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.8.3...3.25)
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
set(_cmake_targets_defined "")
|
||||
set(_cmake_targets_not_defined "")
|
||||
set(_cmake_expected_targets "")
|
||||
foreach(_cmake_expected_target IN ITEMS matc cmgen filamesh mipgen resgen uberz glslminifier)
|
||||
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
|
||||
if(TARGET "${_cmake_expected_target}")
|
||||
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
|
||||
else()
|
||||
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_cmake_expected_target)
|
||||
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
|
||||
unset(_cmake_targets_defined)
|
||||
unset(_cmake_targets_not_defined)
|
||||
unset(_cmake_expected_targets)
|
||||
unset(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
endif()
|
||||
if(NOT _cmake_targets_defined STREQUAL "")
|
||||
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
|
||||
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
|
||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
|
||||
endif()
|
||||
unset(_cmake_targets_defined)
|
||||
unset(_cmake_targets_not_defined)
|
||||
unset(_cmake_expected_targets)
|
||||
|
||||
|
||||
# Create imported target matc
|
||||
add_executable(matc IMPORTED)
|
||||
|
||||
# Create imported target cmgen
|
||||
add_executable(cmgen IMPORTED)
|
||||
|
||||
# Create imported target filamesh
|
||||
add_executable(filamesh IMPORTED)
|
||||
|
||||
# Create imported target mipgen
|
||||
add_executable(mipgen IMPORTED)
|
||||
|
||||
# Create imported target resgen
|
||||
add_executable(resgen IMPORTED)
|
||||
|
||||
# Create imported target uberz
|
||||
add_executable(uberz IMPORTED)
|
||||
|
||||
# Create imported target glslminifier
|
||||
add_executable(glslminifier IMPORTED)
|
||||
|
||||
# Import target "matc" for configuration "Release"
|
||||
set_property(TARGET matc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(matc PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/matc"
|
||||
)
|
||||
|
||||
# Import target "cmgen" for configuration "Release"
|
||||
set_property(TARGET cmgen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(cmgen PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/cmgen"
|
||||
)
|
||||
|
||||
# Import target "filamesh" for configuration "Release"
|
||||
set_property(TARGET filamesh APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(filamesh PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/filamesh"
|
||||
)
|
||||
|
||||
# Import target "mipgen" for configuration "Release"
|
||||
set_property(TARGET mipgen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(mipgen PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/mipgen"
|
||||
)
|
||||
|
||||
# Import target "resgen" for configuration "Release"
|
||||
set_property(TARGET resgen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(resgen PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/resgen"
|
||||
)
|
||||
|
||||
# Import target "uberz" for configuration "Release"
|
||||
set_property(TARGET uberz APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(uberz PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/uberz"
|
||||
)
|
||||
|
||||
# Import target "glslminifier" for configuration "Release"
|
||||
set_property(TARGET glslminifier APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(glslminifier PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FILAMENT_HOST_TOOLS_ROOT}/glslminifier"
|
||||
)
|
||||
|
||||
# This file does not depend on other imported targets which have
|
||||
# been exported from the same project but in a separate export set.
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
@@ -1 +0,0 @@
|
||||
../../plugins/filament_view/README.md
|
||||
@@ -11,7 +11,6 @@ Welcome to ivi-homescreen-plugin's documentation!
|
||||
camera
|
||||
cloud_firestore
|
||||
desktop_window_linux
|
||||
filament_view
|
||||
file_selector
|
||||
firebase_auth
|
||||
firebase_core
|
||||
|
||||
@@ -125,8 +125,6 @@ PLUGIN_OPTION(webrtc "Include Webrtc plugin" OFF)
|
||||
|
||||
# Platform View Plugins
|
||||
|
||||
PLUGIN_OPTION(filament_view "Include Filament View plugin" OFF)
|
||||
|
||||
PLUGIN_OPTION(layer_playground_view "Include Layer Playground View plugin" OFF)
|
||||
|
||||
PLUGIN_OPTION(nav_render_view "Include Navigation Render View plugin" OFF)
|
||||
|
||||
@@ -114,11 +114,6 @@
|
||||
#include "webrtc/include/webrtc/webrtc_plugin_c_api.h"
|
||||
#endif
|
||||
|
||||
#cmakedefine01 ENABLE_PLUGIN_FILAMENT_VIEW
|
||||
#if ENABLE_PLUGIN_FILAMENT_VIEW
|
||||
#include "filament_view/include/filament_view/filament_view_plugin_c_api.h"
|
||||
#endif
|
||||
|
||||
#cmakedefine01 ENABLE_PLUGIN_LAYER_PLAYGROUND_VIEW
|
||||
#if ENABLE_PLUGIN_LAYER_PLAYGROUND_VIEW
|
||||
#include "layer_playground_view/include/layer_playground_view/layer_playground_view_plugin_c_api.h"
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
# command:
|
||||
# find plugins -type d -name third_party -prune -false -o -name '*.cc' -o -name '*.hpp' -o -name '*.h' > clang-format-files && clang-format-18 -i --files=clang-format-files
|
||||
|
||||
Language: Cpp
|
||||
UseTab: Never
|
||||
TabWidth: 2
|
||||
IndentWidth: 2
|
||||
ContinuationIndentWidth: 2
|
||||
BracedInitializerIndentWidth: 2
|
||||
ConstructorInitializerIndentWidth: 2 # broken: llvm/llvm-project#61631
|
||||
ColumnLimit: 100
|
||||
|
||||
SpacesBeforeTrailingComments: 2
|
||||
AlignTrailingComments:
|
||||
Kind: Always
|
||||
OverEmptyLines: 1
|
||||
|
||||
IndentCaseLabels: true
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
|
||||
SpacesInParens: Custom
|
||||
SpacesInParensOptions:
|
||||
InConditionalStatements: false
|
||||
Other: false
|
||||
SpacesInAngles: Never
|
||||
SpaceAfterCStyleCast: false
|
||||
IndentAccessModifiers: true
|
||||
Cpp11BracedListStyle: true
|
||||
PointerAlignment: Left
|
||||
QualifierAlignment: Left
|
||||
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: false
|
||||
BreakBeforeBraces: Attach
|
||||
PackConstructorInitializers: Never
|
||||
# AlignAfterControlStatement: true # waiting for llvm/llvm-project#67738
|
||||
|
||||
BreakAfterAttributes: Never
|
||||
AlwaysBreakAfterReturnType: None
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000 # default: 60
|
||||
PenaltyBreakAssignment: 100
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
SpaceAfterTemplateKeyword: false
|
||||
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
|
||||
InsertNewlineAtEOF: true
|
||||
@@ -1,162 +0,0 @@
|
||||
#
|
||||
# Copyright 2024 Toyota Connected North America
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include_guard()
|
||||
|
||||
if (NOT EXISTS ${FILAMENT_INCLUDE_DIR})
|
||||
message(FATAL_ERROR "${FILAMENT_INCLUDE_DIR} does not exist")
|
||||
endif ()
|
||||
if (NOT EXISTS ${FILAMENT_LINK_LIBRARIES_DIR})
|
||||
message(FATAL_ERROR "${FILAMENT_LINK_LIBRARIES_DIR} does not exist")
|
||||
endif ()
|
||||
|
||||
message(STATUS " FILAMENT_INCLUDE_DIR: ${FILAMENT_INCLUDE_DIR}")
|
||||
message(STATUS " FILAMENT_LINK_LIBRARIES_DIR: ${FILAMENT_LINK_LIBRARIES_DIR}")
|
||||
|
||||
add_library(filament INTERFACE
|
||||
core/include/shapetypes.h)
|
||||
target_compile_options(filament INTERFACE -isystem${FILAMENT_INCLUDE_DIR} -isystem${FILAMENT_INCLUDE_DIR}/filament)
|
||||
target_link_options(filament INTERFACE -L${FILAMENT_LINK_LIBRARIES_DIR})
|
||||
target_link_libraries(filament INTERFACE
|
||||
libbackend.a
|
||||
libbluevk.a
|
||||
libdracodec.a
|
||||
libfilamat.a
|
||||
libfilameshio.a
|
||||
libgltfio_core.a
|
||||
libimage.a
|
||||
libshaders.a
|
||||
libuberarchive.a
|
||||
libviewer.a
|
||||
libbasis_transcoder.a
|
||||
libcamutils.a
|
||||
libfilabridge.a
|
||||
libfilament.a
|
||||
libgeometry.a
|
||||
libibl.a
|
||||
libimageio.a
|
||||
libmeshoptimizer.a
|
||||
libsmol-v.a
|
||||
libuberzlib.a
|
||||
libvkshaders.a
|
||||
libcivetweb.a
|
||||
libtinyexr.a
|
||||
libfilaflat.a
|
||||
libfilament-iblprefilter.a
|
||||
libgltfio.a
|
||||
libibl-lite.a
|
||||
libktxreader.a
|
||||
libmikktspace.a
|
||||
libpng.a
|
||||
libstb.a
|
||||
libutils.a
|
||||
libzstd.a
|
||||
|
||||
z
|
||||
toolchain::toolchain
|
||||
)
|
||||
# Include libmatdbg.a for debug builds
|
||||
if (FILAMENT_BUILD_TYPE STREQUAL "Debug")
|
||||
target_link_libraries(filament INTERFACE libmatdbg.a)
|
||||
endif ()
|
||||
|
||||
add_library(plugin_filament_view STATIC
|
||||
filament_view_plugin_c_api.cc
|
||||
filament_view_plugin.cc
|
||||
messages.g.cc
|
||||
|
||||
core/scene/serialization/scene_text_deserializer.cc
|
||||
core/components/derived/transform.cc
|
||||
core/components/derived/camera.cc
|
||||
core/components/derived/commonrenderable.cc
|
||||
core/components/derived/collider.cc
|
||||
core/components/derived/animation.cc
|
||||
core/components/derived/light.cc
|
||||
core/entity/derived/renderable_entityobject.cc
|
||||
core/systems/base/system.cc
|
||||
core/systems/ecs.cc
|
||||
core/systems/derived/filament_system.cc
|
||||
core/systems/derived/model_system.cc
|
||||
core/entity/derived/model/model.cc
|
||||
core/scene/camera/exposure.cc
|
||||
core/scene/camera/lens_projection.cc
|
||||
core/scene/camera/projection.cc
|
||||
core/entity/base/entityobject.cc
|
||||
core/scene/geometry/ray.cc
|
||||
core/scene/geometry/size.cc
|
||||
core/scene/serialization/scene_text_deserializer.cc
|
||||
core/systems/derived/collision_system.cc
|
||||
core/systems/derived/debug_lines_system.cc
|
||||
core/scene/indirect_light/indirect_light.cc
|
||||
core/systems/derived/indirect_light_system.cc
|
||||
core/utils/vectorutils.cc
|
||||
core/utils/hdr_loader.cc
|
||||
core/systems/derived/light_system.cc
|
||||
core/scene/material/loader/material_loader.cc
|
||||
core/scene/material/loader/texture_loader.cc
|
||||
core/systems/derived/material_system.cc
|
||||
core/components/derived/material_definitions.cc
|
||||
core/scene/material/material_parameter.cc
|
||||
core/scene/material/texture/texture_definitions.cc
|
||||
core/scene/material/texture/texture_sampler.cc
|
||||
core/scene/skybox/skybox.cc
|
||||
core/systems/derived/skybox_system.cc
|
||||
core/systems/derived/animation_system.cc
|
||||
core/entity/derived/shapes/baseshape.cc
|
||||
core/entity/derived/shapes/cube.cc
|
||||
core/entity/derived/shapes/sphere.cc
|
||||
core/entity/derived/shapes/plane.cc
|
||||
core/systems/derived/shape_system.cc
|
||||
core/utils/deserialize.cc
|
||||
core/utils/uuidGenerator.cc
|
||||
core/utils/asserts.cc
|
||||
core/scene/view_target.cc
|
||||
core/systems/derived/view_target_system.cc
|
||||
core/systems/derived/transform_system.cc
|
||||
)
|
||||
|
||||
target_include_directories(plugin_filament_view PUBLIC
|
||||
.
|
||||
include
|
||||
)
|
||||
|
||||
target_link_libraries(plugin_filament_view PUBLIC
|
||||
platform_homescreen
|
||||
plugin_common
|
||||
plugin_common_curl
|
||||
filament
|
||||
flutter
|
||||
asio
|
||||
toolchain::toolchain
|
||||
)
|
||||
|
||||
#
|
||||
# Filament MVP Example
|
||||
#
|
||||
pkg_check_modules(SDL2 IMPORTED_TARGET sdl2)
|
||||
if (SDL2_FOUND)
|
||||
if (NOT)
|
||||
add_executable(filament-mvp test/mvp.cc)
|
||||
target_link_libraries(filament-mvp PUBLIC
|
||||
PkgConfig::SDL2
|
||||
filament
|
||||
${FILAMENT_LINK_LIBRARIES_DIR}/../../../../third_party/spirv-tools/source/opt/libSPIRV-Tools-opt.a
|
||||
${FILAMENT_LINK_LIBRARIES_DIR}/../../../../third_party/spirv-cross/tnt/libspirv-cross-msl.a
|
||||
toolchain::toolchain
|
||||
)
|
||||
add_sanitizers(filament-mvp)
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -1,61 +0,0 @@
|
||||
# Filament View
|
||||
|
||||
This plugin is built for use with an AndroidView on the Flutter side.
|
||||
|
||||
## Requirements
|
||||
|
||||
- **System Compatibility:** The target system must support Vulkan
|
||||
- **Compiler:** Clang
|
||||
- Note: Filament requires Clang
|
||||
|
||||
## Cloning Filament
|
||||
|
||||
git clone https://github.com/google/filament -b release
|
||||
git checkout v1.52.3
|
||||
|
||||
## Building Filament
|
||||
|
||||
Apply patches found here:
|
||||
https://github.com/meta-flutter/workspace-automation/tree/filament-dev/patches/filament
|
||||
|
||||
_Note: If building for desktop do not apply last patch_
|
||||
|
||||
Build using these flags:
|
||||
|
||||
```
|
||||
-DFILAMENT_SUPPORTS_VULKAN=ON
|
||||
-DFILAMENT_ENABLE_LTO=ON
|
||||
-DFILAMENT_SUPPORTS_OPENGL=OFF
|
||||
-DFILAMENT_USE_EXTERNAL_GLES3=OFF
|
||||
-DFILAMENT_SUPPORTS_WAYLAND=ON
|
||||
-DFILAMENT_SUPPORTS_X11=OFF
|
||||
-DFILAMENT_SUPPORTS_XCB=OFF
|
||||
-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF
|
||||
-DFILAMENT_SKIP_SDL2=ON
|
||||
-DFILAMENT_SKIP_SAMPLES=ON
|
||||
-DFILAMENT_USE_SWIFTSHADER=OFF
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DCMAKE_STAGING_PREFIX=/mnt/raid10/filament/out/debug/usr
|
||||
```
|
||||
|
||||
Make the install target to stage the required folders.
|
||||
|
||||
ninja -C . install
|
||||
|
||||
Set ivi-homescreen variables to subfolders of the staged install:
|
||||
|
||||
-DFILAMENT_INCLUDE_DIR=/mnt/raid10/filament/out/debug/include
|
||||
-DFILAMENT_LINK_LIBRARIES_DIR=/mnt/raid10/filament/out/debug/lib/x86_64
|
||||
|
||||
In above case the staged install is set to:
|
||||
|
||||
/mnt/raid10/filament/out/debug/usr
|
||||
|
||||
## Notes
|
||||
|
||||
Playx3d-scene needs conversion of assets for running on Vulkan+Linux:
|
||||
|
||||
```
|
||||
cd filament/cmake-build-debug-clang
|
||||
./tools/matc/matc --api vulkan -o /home/joel/workspace-automation/app/playx-3d-scene/example/build/flutter_assets/assets/materials/textured_pbr.filamat ../samples/materials/groundShadow.mat
|
||||
```
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020-2024 Toyota Connected North America
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
|
||||
#include <core/utils/filament_types.h>
|
||||
#include <core/utils/identifiable_type.h>
|
||||
|
||||
namespace plugin_filament_view {
|
||||
class EntityObject;
|
||||
}
|
||||
|
||||
namespace plugin_filament_view {
|
||||
|
||||
class Component : public IdentifiableType {
|
||||
friend class EntityObject;
|
||||
|
||||
public:
|
||||
[[nodiscard]] inline const EntityObject* getOwner() const { return entityOwner_; }
|
||||
|
||||
[[nodiscard]] virtual const std::type_info& getType() const { return typeid(*this); }
|
||||
|
||||
virtual void debugPrint(const std::string& tabPrefix) const = 0;
|
||||
|
||||
[[nodiscard]] virtual Component* Clone() const = 0;
|
||||
|
||||
virtual ~Component() = default;
|
||||
|
||||
protected:
|
||||
explicit Component(std::string name)
|
||||
: name_(std::move(name)),
|
||||
entityOwner_(nullptr) {}
|
||||
|
||||
private:
|
||||
/// @deprecated Instead use getTypeName()
|
||||
std::string name_;
|
||||
|
||||
public:
|
||||
EntityObject* entityOwner_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace plugin_filament_view
|
||||
@@ -1,238 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020-2024 Toyota Connected North America
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "animation.h"
|
||||
|
||||
#include <core/include/literals.h>
|
||||
#include <core/systems/derived/animation_system.h>
|
||||
#include <core/systems/ecs.h>
|
||||
#include <core/utils/deserialize.h>
|
||||
#include <filesystem>
|
||||
#include <plugins/common/common.h>
|
||||
|
||||
namespace plugin_filament_view {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
Animation::Animation(const flutter::EncodableMap& params)
|
||||
: Component(std::string(__FUNCTION__)) {
|
||||
Deserialize::DecodeParameterWithDefault(kAutoPlay, &m_bAutoPlay, params, false);
|
||||
Deserialize::DecodeParameterWithDefault(kIndex, &m_nCurrentPlayingIndex, params, 0);
|
||||
|
||||
Deserialize::DecodeParameterWithDefault(kLoop, &m_bLoop, params, true);
|
||||
|
||||
Deserialize::DecodeParameterWithDefault(
|
||||
kResetToTPoseOnReset, &m_bResetToTPoseOnReset, params, false
|
||||
);
|
||||
|
||||
double speed;
|
||||
Deserialize::DecodeParameterWithDefault(kPlaybackSpeed, &speed, params, 1.0f);
|
||||
|
||||
m_fPlaybackSpeedScalar = static_cast<float>(speed);
|
||||
|
||||
Deserialize::DecodeParameterWithDefault(
|
||||
kNotifyOfAnimationEvents, &m_bNotifyOfAnimationEvents, params, false
|
||||
);
|
||||
|
||||
m_bPaused = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::update(const double deltaTime) {
|
||||
if (m_poAnimator == nullptr || m_bPaused) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_nCurrentPlayingIndex < 0 && !m_queAnimationQueue.empty()) {
|
||||
// Dequeue the next animation if the current one is finished
|
||||
m_nCurrentPlayingIndex = m_queAnimationQueue.front();
|
||||
m_queAnimationQueue.pop();
|
||||
m_fTimeSinceStart = 0.0f;
|
||||
|
||||
if (m_bNotifyOfAnimationEvents) {
|
||||
const auto animationSystem = ECSManager::GetInstance()->getSystem<AnimationSystem>(
|
||||
"Animation::update"
|
||||
);
|
||||
animationSystem->NotifyOfAnimationEvent(
|
||||
getOwner()->getGuid(), eAnimationStarted, std::to_string(m_nCurrentPlayingIndex)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_nCurrentPlayingIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_fTimeSinceStart += static_cast<float>(deltaTime) * m_fPlaybackSpeedScalar;
|
||||
|
||||
m_poAnimator->applyAnimation(static_cast<size_t>(m_nCurrentPlayingIndex), m_fTimeSinceStart);
|
||||
m_poAnimator->updateBoneMatrices();
|
||||
|
||||
const auto currentAnimDuration = m_poAnimator->getAnimationDuration(
|
||||
static_cast<size_t>(m_nCurrentPlayingIndex)
|
||||
);
|
||||
if (m_fTimeSinceStart > currentAnimDuration) {
|
||||
if (m_bNotifyOfAnimationEvents) {
|
||||
// send message here to dart
|
||||
const auto animationSystem = ECSManager::GetInstance()->getSystem<AnimationSystem>(
|
||||
"Animation::update"
|
||||
);
|
||||
|
||||
animationSystem->NotifyOfAnimationEvent(
|
||||
getOwner()->getGuid(), eAnimationEnded, std::to_string(m_nCurrentPlayingIndex)
|
||||
);
|
||||
}
|
||||
|
||||
// check queue
|
||||
|
||||
// check loop
|
||||
if (m_bLoop) {
|
||||
m_fTimeSinceStart -= currentAnimDuration;
|
||||
|
||||
if (m_bNotifyOfAnimationEvents) {
|
||||
// send message here to dart
|
||||
const auto animationSystem = ECSManager::GetInstance()->getSystem<AnimationSystem>(
|
||||
"Animation::update"
|
||||
);
|
||||
|
||||
animationSystem->NotifyOfAnimationEvent(
|
||||
getOwner()->getGuid(), eAnimationStarted, std::to_string(m_nCurrentPlayingIndex)
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
m_fTimeSinceStart = 0.0f;
|
||||
m_nCurrentPlayingIndex = -1;
|
||||
|
||||
if (!m_queAnimationQueue.empty()) {
|
||||
m_nCurrentPlayingIndex = m_queAnimationQueue.front();
|
||||
m_queAnimationQueue.pop();
|
||||
} else if (m_bResetToTPoseOnReset) {
|
||||
m_poAnimator->resetBoneMatrices();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::EnqueueAnimation(const int32_t index) {
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (static_cast<size_t>(index) >= m_mapAnimationNamesToIndex.size()) {
|
||||
spdlog::warn("Attempting to vEnqueueAnimation that is greater than total count of "
|
||||
"animations.");
|
||||
return;
|
||||
}
|
||||
|
||||
m_queAnimationQueue.push(index);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::ClearQueue() {
|
||||
std::queue<int32_t> emptyQueue;
|
||||
std::swap(m_queAnimationQueue, emptyQueue); // Efficiently clear the queue
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::setAnimator(filament::gltfio::Animator& animator) {
|
||||
m_poAnimator = &animator;
|
||||
|
||||
setupAnimationNameMapping();
|
||||
|
||||
if (m_bAutoPlay) {
|
||||
PlayAnimation(m_nCurrentPlayingIndex);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::PlayAnimation(int32_t index) {
|
||||
if (index < 0 || static_cast<size_t>(index) >= m_mapAnimationNamesToIndex.size()) {
|
||||
spdlog::warn("Invalid animation index: {}", index);
|
||||
return;
|
||||
}
|
||||
|
||||
ClearQueue();
|
||||
|
||||
m_nCurrentPlayingIndex = index;
|
||||
m_fTimeSinceStart = 0.0f;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool Animation::bPlayAnimation(const std::string& szName) {
|
||||
if (const auto foundIter = m_mapAnimationNamesToIndex.find(szName);
|
||||
foundIter != m_mapAnimationNamesToIndex.end()) {
|
||||
PlayAnimation(static_cast<int32_t>(foundIter->second));
|
||||
return true;
|
||||
}
|
||||
|
||||
spdlog::warn("Animation string not found in mapping table {}", szName);
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Animation::setupAnimationNameMapping() {
|
||||
if (m_poAnimator) {
|
||||
const auto count = m_poAnimator->getAnimationCount();
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
m_mapAnimationNamesToIndex.insert(
|
||||
std::make_pair(std::string(m_poAnimator->getAnimationName(i)), i)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
void Animation::debugPrint(const std::string& tabPrefix) const {
|
||||
spdlog::debug("{}m_nCurrentPlayingIndex: {}", tabPrefix, m_nCurrentPlayingIndex);
|
||||
spdlog::debug("{}m_bPaused: {}", tabPrefix, m_bPaused);
|
||||
spdlog::debug("{}m_bAutoPlay: {}", tabPrefix, m_bAutoPlay);
|
||||
spdlog::debug("{}m_bLoop: {}", tabPrefix, m_bLoop);
|
||||
spdlog::debug("{}m_bResetToTPoseOnReset: {}", tabPrefix, m_bResetToTPoseOnReset);
|
||||
spdlog::debug("{}m_fPlaybackSpeedScalar: {}", tabPrefix, m_fPlaybackSpeedScalar);
|
||||
spdlog::debug("{}m_bNotifyOfAnimationEvents: {}", tabPrefix, m_bNotifyOfAnimationEvents);
|
||||
spdlog::debug("{}m_fTimeSinceStart: {}", tabPrefix, m_fTimeSinceStart);
|
||||
|
||||
if (m_poAnimator) {
|
||||
const auto count = m_poAnimator->getAnimationCount();
|
||||
spdlog::debug("{}Animation Info: count[{}]", tabPrefix, count);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
spdlog::debug(
|
||||
"{}Anim at [{}]: Name: '{}', Duration: {}", tabPrefix, i, m_poAnimator->getAnimationName(i),
|
||||
m_poAnimator->getAnimationDuration(i)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
spdlog::debug("{}m_poAnimator is nullptr", tabPrefix);
|
||||
}
|
||||
|
||||
spdlog::debug("{}m_mapAnimationNamesToIndex:", tabPrefix);
|
||||
for (const auto& [name, index] : m_mapAnimationNamesToIndex) {
|
||||
spdlog::debug("{} Name: '{}', Index: {}", tabPrefix, name, index);
|
||||
}
|
||||
|
||||
spdlog::debug("{}m_queAnimationQueue size: {}", tabPrefix, m_queAnimationQueue.size());
|
||||
if (!m_queAnimationQueue.empty()) {
|
||||
std::queue<int32_t> tempQueue = m_queAnimationQueue; // Copy to iterate
|
||||
spdlog::debug("{}Queue contents:", tabPrefix);
|
||||
while (!tempQueue.empty()) {
|
||||
int32_t index = tempQueue.front();
|
||||
tempQueue.pop();
|
||||
spdlog::debug("{} Animation Index: {}", tabPrefix, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace plugin_filament_view
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020-2024 Toyota Connected North America
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include "shell/platform/common/client_wrapper/include/flutter/encodable_value.h"
|
||||
|
||||
#include <core/components/base/component.h>
|
||||
#include <filament/math/quat.h>
|
||||
#include <gltfio/Animator.h>
|
||||
#include <gltfio/AssetLoader.h>
|
||||
|
||||
namespace plugin_filament_view {
|
||||
|
||||
class Animation final : public Component {
|
||||
public:
|
||||
// Constructor
|
||||
explicit Animation(const flutter::EncodableMap& params);
|
||||
|
||||
void debugPrint(const std::string& tabPrefix) const override;
|
||||
|
||||
[[nodiscard]] inline Component* Clone() const override { return new Animation(*this); }
|
||||
|
||||
void setAnimator(filament::gltfio::Animator& animator);
|
||||
void PlayAnimation(int32_t index);
|
||||
[[maybe_unused]] bool bPlayAnimation(const std::string& szName);
|
||||
|
||||
void update(double deltaTime);
|
||||
|
||||
[[nodiscard]] inline float getSpeed() const { return m_fPlaybackSpeedScalar; }
|
||||
|
||||
// Setter for m_fPlaybackSpeedScalar
|
||||
inline void setSpeed(float playbackSpeedScalar) {
|
||||
m_fPlaybackSpeedScalar = playbackSpeedScalar;
|
||||
}
|
||||
|
||||
inline void setPaused(bool paused) { m_bPaused = paused; }
|
||||
|
||||
inline void Pause() { m_bPaused = true; }
|
||||
|
||||
inline void Resume() { m_bPaused = false; }
|
||||
|
||||
// Queue management
|
||||
void EnqueueAnimation(int32_t index);
|
||||
void ClearQueue();
|
||||
|
||||
inline void setLooping(bool enable) { m_bLoop = enable; }
|
||||
|
||||
private:
|
||||
int32_t m_nCurrentPlayingIndex{};
|
||||
bool m_bPaused;
|
||||
bool m_bAutoPlay{};
|
||||
bool m_bLoop{};
|
||||
bool m_bResetToTPoseOnReset{};
|
||||
float m_fPlaybackSpeedScalar{};
|
||||
bool m_bNotifyOfAnimationEvents{};
|
||||
|
||||
float m_fTimeSinceStart{};
|
||||
|
||||
filament::gltfio::Animator* m_poAnimator{};
|
||||
|
||||
// Setup when the animator is set.
|
||||
std::map<std::string, size_t> m_mapAnimationNamesToIndex;
|
||||
void setupAnimationNameMapping();
|
||||
|
||||
std::queue<int32_t> m_queAnimationQueue;
|
||||
};
|
||||
|
||||
} // namespace plugin_filament_view
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user