Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa0160f8ba | ||
|
|
8c037123b3 |
@@ -26,7 +26,7 @@ jobs:
|
||||
cd build/web && printf "y" | ./build.sh release
|
||||
- name: Deploy to npm
|
||||
run: |
|
||||
cd out/cmake-wasm-release/web/filament-js
|
||||
cd out/cmake-webgl-release/web/filament-js
|
||||
npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@@ -31,8 +31,6 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/mac-prereq
|
||||
- name: Select Xcode 16.2
|
||||
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/ios && printf "y" | ./build.sh continuous
|
||||
|
||||
@@ -184,8 +184,6 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/mac-prereq
|
||||
- name: Select Xcode 16.2
|
||||
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/ios && printf "y" | ./build.sh presubmit
|
||||
|
||||
@@ -286,8 +286,6 @@ jobs:
|
||||
with:
|
||||
ref: ${{ steps.git_ref.outputs.ref }}
|
||||
- uses: ./.github/actions/mac-prereq
|
||||
- name: Select Xcode 16.2
|
||||
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
|
||||
- name: Run build script
|
||||
env:
|
||||
TAG: ${{ steps.git_ref.outputs.tag }}
|
||||
|
||||
+20
-18
@@ -177,7 +177,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
# ==================================================================================================
|
||||
# OS specific
|
||||
# ==================================================================================================
|
||||
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT WASM)
|
||||
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT WEBGL)
|
||||
set(LINUX TRUE)
|
||||
else()
|
||||
# since cmake 3.25 LINUX is automatically set based on CMAKE_SYSTEM_NAME, which the android
|
||||
@@ -218,7 +218,7 @@ if (LINUX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ANDROID OR WASM OR IOS OR FILAMENT_LINUX_IS_MOBILE)
|
||||
if (ANDROID OR WEBGL OR IOS OR FILAMENT_LINUX_IS_MOBILE)
|
||||
set(IS_MOBILE_TARGET TRUE)
|
||||
endif()
|
||||
|
||||
@@ -226,7 +226,7 @@ if (ANDROID)
|
||||
add_definitions(-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
|
||||
endif()
|
||||
|
||||
if (NOT ANDROID AND NOT WASM AND NOT IOS AND NOT FILAMENT_LINUX_IS_MOBILE)
|
||||
if (NOT ANDROID AND NOT WEBGL AND NOT IOS AND NOT FILAMENT_LINUX_IS_MOBILE)
|
||||
set(IS_HOST_PLATFORM TRUE)
|
||||
endif()
|
||||
|
||||
@@ -473,7 +473,7 @@ if (NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections")
|
||||
endif()
|
||||
|
||||
if (ANDROID OR WASM)
|
||||
if (ANDROID OR WEBGL)
|
||||
# On Android and WebGL RELEASE builds, we omit unwind info to save space.
|
||||
# (We keep unwind info on iOS to allow readable stack traces in crash reports.)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-unwind-tables -fno-asynchronous-unwind-tables")
|
||||
@@ -482,11 +482,11 @@ endif()
|
||||
# With WebGL, we disable RTTI because we pass emscripten::val back and forth
|
||||
# between C++ and JavaScript in order to efficiently access typed arrays, which are unbound.
|
||||
# NOTE: This is not documented in emscripten so we should consider a different approach.
|
||||
if (WASM)
|
||||
if (WEBGL)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
||||
endif()
|
||||
|
||||
if (WASM_PTHREADS)
|
||||
if (WEBGL_PTHREADS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
endif()
|
||||
|
||||
@@ -503,7 +503,7 @@ if (ANDROID)
|
||||
# keep STL debug infos (mimics what the NDK does)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-limit-debug-info")
|
||||
endif()
|
||||
if (NOT MSVC AND NOT WASM)
|
||||
if (NOT MSVC AND NOT WEBGL)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstack-protector")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_SANITIZE_OPTIONS}")
|
||||
@@ -522,7 +522,7 @@ endif()
|
||||
# Linker flags
|
||||
# ==================================================================================================
|
||||
# Strip unused sections
|
||||
if (NOT WASM)
|
||||
if (NOT WEBGL)
|
||||
set(GC_SECTIONS "-Wl,--gc-sections")
|
||||
endif()
|
||||
|
||||
@@ -556,7 +556,7 @@ endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GC_SECTIONS} ${NO_EXEC_STACK}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GC_SECTIONS} ${B_SYMBOLIC_FUNCTIONS} ${BINARY_ALIGNMENT}")
|
||||
|
||||
if (WASM_PTHREADS)
|
||||
if (WEBGL_PTHREADS)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
|
||||
endif()
|
||||
|
||||
@@ -586,7 +586,7 @@ endif()
|
||||
|
||||
# By default, build with Vulkan support on desktop platforms, although clients must request to use
|
||||
# it at run time.
|
||||
if (WIN32 OR WASM OR IOS)
|
||||
if (WIN32 OR WEBGL OR IOS)
|
||||
option(FILAMENT_SUPPORTS_VULKAN "Include the Vulkan backend" OFF)
|
||||
else()
|
||||
option(FILAMENT_SUPPORTS_VULKAN "Include the Vulkan backend" ON)
|
||||
@@ -604,7 +604,7 @@ if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
|
||||
endif()
|
||||
|
||||
# Build with Metal support on non-WebGL Apple platforms.
|
||||
if (APPLE AND NOT WASM)
|
||||
if (APPLE AND NOT WEBGL)
|
||||
option(FILAMENT_SUPPORTS_METAL "Include the Metal backend" ON)
|
||||
else()
|
||||
option(FILAMENT_SUPPORTS_METAL "Include the Metal backend" OFF)
|
||||
@@ -614,7 +614,7 @@ if (FILAMENT_SUPPORTS_METAL)
|
||||
endif()
|
||||
|
||||
# Building filamat increases build times and isn't required for web, so turn it off by default.
|
||||
if (NOT WASM)
|
||||
if (NOT WEBGL)
|
||||
option(FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" ON)
|
||||
else()
|
||||
option(FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" OFF)
|
||||
@@ -691,6 +691,11 @@ if (FILAMENT_SUPPORTS_WEBGPU)
|
||||
set(MATC_API_FLAGS ${MATC_API_FLAGS} -a webgpu --variant-filter=stereo)
|
||||
endif()
|
||||
|
||||
# Disable ESSL 1.0 code generation.
|
||||
if (NOT FILAMENT_ENABLE_FEATURE_LEVEL_0)
|
||||
set(MATC_API_FLAGS ${MATC_API_FLAGS} -1)
|
||||
endif()
|
||||
|
||||
# Enable debug info (preserves names in SPIR-V)
|
||||
if (FILAMENT_ENABLE_MATDBG)
|
||||
set(MATC_OPT_FLAGS ${MATC_OPT_FLAGS} -d)
|
||||
@@ -727,9 +732,6 @@ string(TOLOWER "${DIST_ARCH}" DIST_ARCH)
|
||||
string(REPLACE "amd64" "x86_64" DIST_ARCH "${DIST_ARCH}")
|
||||
if (NOT DIST_DIR)
|
||||
set(DIST_DIR "${DIST_ARCH}")
|
||||
if (PLATFORM_NAME)
|
||||
set(DIST_DIR "${DIST_DIR}-${PLATFORM_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ==================================================================================================
|
||||
@@ -838,7 +840,7 @@ if (FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR)
|
||||
set(IMPORT_EXECUTABLES_DIR ${FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR})
|
||||
endif()
|
||||
|
||||
if (WASM)
|
||||
if (WEBGL)
|
||||
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-Release.cmake)
|
||||
else()
|
||||
if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES)
|
||||
@@ -873,7 +875,7 @@ function(get_resgen_vars ARCHIVE_DIR ARCHIVE_NAME)
|
||||
set(RESGEN_HEADER "${ARCHIVE_DIR}/${ARCHIVE_NAME}.h" PARENT_SCOPE)
|
||||
# Visual Studio makes it difficult to use assembly without using MASM. MASM doesn't support
|
||||
# the equivalent of .incbin, so on Windows we'll just tell resgen to output a C file.
|
||||
if (WASM OR WIN32 OR ANDROID_ON_WINDOWS)
|
||||
if (WEBGL OR WIN32 OR ANDROID_ON_WINDOWS)
|
||||
set(RESGEN_OUTPUTS "${OUTPUTS};${ARCHIVE_DIR}/${ARCHIVE_NAME}.c" PARENT_SCOPE)
|
||||
set(RESGEN_FLAGS -qcx ${ARCHIVE_DIR} -p ${ARCHIVE_NAME} PARENT_SCOPE)
|
||||
set(RESGEN_SOURCE "${ARCHIVE_DIR}/${ARCHIVE_NAME}.c" PARENT_SCOPE)
|
||||
@@ -978,7 +980,7 @@ add_subdirectory(${FILAMENT}/filament)
|
||||
|
||||
set(FILAMENT_SAMPLES_BINARY_DIR ${PROJECT_BINARY_DIR}/samples)
|
||||
|
||||
if (WASM)
|
||||
if (WEBGL)
|
||||
add_subdirectory(web/filament-js)
|
||||
add_subdirectory(web/examples)
|
||||
endif()
|
||||
|
||||
@@ -6,6 +6,3 @@
|
||||
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
|
||||
|
||||
## Release notes for next branch cut
|
||||
|
||||
- iOS: add Apple silicon (`arm64`) iOS Simulator support. The sample Xcode projects now require Xcode 16+ (CI is pinned to Xcode 16.2).
|
||||
- WEBGL_PTHREADS renamed to WASM_PTHREADS in CMakeLists.txt
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[](https://github.com/google/filament/actions/workflows/status-web.yml)
|
||||
|
||||
Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows,
|
||||
and WASM. It is designed to be as small as possible and as efficient as possible on Android.
|
||||
and WebGL. It is designed to be as small as possible and as efficient as possible on Android.
|
||||
|
||||
## Download
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Host tools required by Android, WASM, and iOS builds
|
||||
# Host tools required by Android, WebGL, and iOS builds
|
||||
MOBILE_HOST_TOOLS="matc resgen cmgen filamesh uberz"
|
||||
WEB_HOST_TOOLS="${MOBILE_HOST_TOOLS} mipgen filamesh"
|
||||
|
||||
@@ -34,7 +34,7 @@ function print_help {
|
||||
echo " -m"
|
||||
echo " Compile with make instead of ninja."
|
||||
echo " -p platform1,platform2,..."
|
||||
echo " Where platformN is [desktop|android|ios|wasm|all]."
|
||||
echo " Where platformN is [desktop|android|ios|webgl|all]."
|
||||
echo " Platform(s) to build, defaults to desktop."
|
||||
echo " Building for iOS will automatically perform a partial desktop build."
|
||||
echo " -q abi1,abi2,..."
|
||||
@@ -53,8 +53,8 @@ function print_help {
|
||||
echo " -e"
|
||||
echo " Enable EGL on Linux support for desktop builds."
|
||||
echo " -l"
|
||||
echo " Build universal libraries/frameworks."
|
||||
echo " For iOS, this builds XCFrameworks for devices and the simulator (implies -s)."
|
||||
echo " Build arm64/x86_64 universal libraries."
|
||||
echo " For iOS, this builds universal binaries for devices and the simulator (implies -s)."
|
||||
echo " For macOS, this builds universal binaries for both Apple silicon and Intel-based Macs."
|
||||
echo " -k sample1,sample2,..."
|
||||
echo " When building for Android, also build select sample APKs."
|
||||
@@ -173,7 +173,7 @@ ISSUE_RELEASE_BUILD=false
|
||||
ISSUE_ANDROID_BUILD=false
|
||||
ISSUE_IOS_BUILD=false
|
||||
ISSUE_DESKTOP_BUILD=true
|
||||
ISSUE_WASM_BUILD=false
|
||||
ISSUE_WEBGL_BUILD=false
|
||||
|
||||
# Default: all
|
||||
ABI_ARMEABI_V7A=true
|
||||
@@ -356,12 +356,12 @@ function build_desktop {
|
||||
fi
|
||||
}
|
||||
|
||||
function build_wasm_with_target {
|
||||
function build_webgl_with_target {
|
||||
local lc_target=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
echo "Building WASM ${lc_target}..."
|
||||
mkdir -p "out/cmake-wasm-${lc_target}"
|
||||
pushd "out/cmake-wasm-${lc_target}" > /dev/null
|
||||
echo "Building WebGL ${lc_target}..."
|
||||
mkdir -p "out/cmake-webgl-${lc_target}"
|
||||
pushd "out/cmake-webgl-${lc_target}" > /dev/null
|
||||
|
||||
if [[ ! "${BUILD_TARGETS}" ]]; then
|
||||
BUILD_TARGETS=${BUILD_CUSTOM_TARGETS}
|
||||
@@ -378,13 +378,13 @@ function build_wasm_with_target {
|
||||
${IMPORT_EXECUTABLES_DIR_OPTION} \
|
||||
-DCMAKE_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
|
||||
-DCMAKE_BUILD_TYPE="$1" \
|
||||
-DCMAKE_INSTALL_PREFIX="../wasm-${lc_target}/filament" \
|
||||
-DWASM=1 \
|
||||
-DCMAKE_INSTALL_PREFIX="../webgl-${lc_target}/filament" \
|
||||
-DWEBGL=1 \
|
||||
${WEBGPU_OPTION} \
|
||||
${BACKEND_DEBUG_FLAG_OPTION} \
|
||||
${EXCEPTIONS_OPTION} \
|
||||
../..
|
||||
ln -sf "out/cmake-wasm-${lc_target}/compile_commands.json" \
|
||||
ln -sf "out/cmake-webgl-${lc_target}/compile_commands.json" \
|
||||
../../compile_commands.json
|
||||
${BUILD_COMMAND} ${BUILD_TARGETS}
|
||||
)
|
||||
@@ -416,7 +416,7 @@ function build_wasm_with_target {
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
function build_wasm {
|
||||
function build_webgl {
|
||||
# For the host tools, suppress install and always use Release.
|
||||
local old_install_command=${INSTALL_COMMAND}; INSTALL_COMMAND=
|
||||
local old_issue_debug_build=${ISSUE_DEBUG_BUILD}; ISSUE_DEBUG_BUILD=false
|
||||
@@ -429,11 +429,11 @@ function build_wasm {
|
||||
ISSUE_RELEASE_BUILD=${old_issue_release_build}
|
||||
|
||||
if [[ "${ISSUE_DEBUG_BUILD}" == "true" ]]; then
|
||||
build_wasm_with_target "Debug"
|
||||
build_webgl_with_target "Debug"
|
||||
fi
|
||||
|
||||
if [[ "${ISSUE_RELEASE_BUILD}" == "true" ]]; then
|
||||
build_wasm_with_target "Release"
|
||||
build_webgl_with_target "Release"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -685,9 +685,9 @@ function build_ios_target {
|
||||
local platform=$3
|
||||
|
||||
echo "Building iOS ${lc_target} (${arch}) for ${platform}..."
|
||||
mkdir -p "out/cmake-ios-${lc_target}-${arch}-${platform}"
|
||||
mkdir -p "out/cmake-ios-${lc_target}-${arch}"
|
||||
|
||||
pushd "out/cmake-ios-${lc_target}-${arch}-${platform}" > /dev/null
|
||||
pushd "out/cmake-ios-${lc_target}-${arch}" > /dev/null
|
||||
|
||||
if [[ ! -d "CMakeFiles" ]] || [[ "${ISSUE_CMAKE_ALWAYS}" == "true" ]]; then
|
||||
cmake \
|
||||
@@ -746,79 +746,38 @@ function build_ios {
|
||||
# only arm64 devices support OpenGL 3.0 / Metal
|
||||
|
||||
if [[ "${ISSUE_DEBUG_BUILD}" == "true" ]]; then
|
||||
local out_dir="out/ios-debug/filament"
|
||||
local lib_dir="${out_dir}/lib"
|
||||
|
||||
build_ios_target "Debug" "arm64" "iphoneos"
|
||||
|
||||
if [[ "${IOS_BUILD_SIMULATOR}" == "true" ]]; then
|
||||
build_ios_target "Debug" "arm64" "iphonesimulator"
|
||||
build_ios_target "Debug" "x86_64" "iphonesimulator"
|
||||
|
||||
# Create a universal library for the simulator
|
||||
fi
|
||||
|
||||
if [[ "${BUILD_UNIVERSAL_LIBRARIES}" == "true" ]]; then
|
||||
build/ios/create-universal-libs.sh \
|
||||
-o "${lib_dir}/universal" \
|
||||
"${lib_dir}/arm64-iphonesimulator" \
|
||||
"${lib_dir}/x86_64-iphonesimulator"
|
||||
-o out/ios-debug/filament/lib/universal \
|
||||
out/ios-debug/filament/lib/arm64 \
|
||||
out/ios-debug/filament/lib/x86_64
|
||||
rm -rf out/ios-debug/filament/lib/arm64
|
||||
rm -rf out/ios-debug/filament/lib/x86_64
|
||||
fi
|
||||
|
||||
# Always create XCFrameworks
|
||||
local xcframework_paths=("${lib_dir}/arm64-iphoneos")
|
||||
if [[ -d "${lib_dir}/universal" ]]; then
|
||||
xcframework_paths+=("${lib_dir}/universal")
|
||||
elif [[ -d "${lib_dir}/arm64-iphonesimulator" ]]; then
|
||||
# If we built only one simulator arch but not both
|
||||
xcframework_paths+=("${lib_dir}/arm64-iphonesimulator")
|
||||
elif [[ -d "${lib_dir}/x86_64-iphonesimulator" ]]; then
|
||||
xcframework_paths+=("${lib_dir}/x86_64-iphonesimulator")
|
||||
fi
|
||||
|
||||
build/ios/create-xc-frameworks.sh -o "${lib_dir}" "${xcframework_paths[@]}"
|
||||
|
||||
rm -rf \
|
||||
"${lib_dir}/arm64-iphoneos" \
|
||||
"${lib_dir}/arm64-iphonesimulator" \
|
||||
"${lib_dir}/x86_64-iphonesimulator" \
|
||||
"${lib_dir}/universal"
|
||||
|
||||
archive_ios "Debug"
|
||||
fi
|
||||
|
||||
if [[ "${ISSUE_RELEASE_BUILD}" == "true" ]]; then
|
||||
local out_dir="out/ios-release/filament"
|
||||
local lib_dir="${out_dir}/lib"
|
||||
|
||||
build_ios_target "Release" "arm64" "iphoneos"
|
||||
|
||||
if [[ "${IOS_BUILD_SIMULATOR}" == "true" ]]; then
|
||||
build_ios_target "Release" "arm64" "iphonesimulator"
|
||||
build_ios_target "Release" "x86_64" "iphonesimulator"
|
||||
|
||||
# Create a universal library for the simulator
|
||||
fi
|
||||
|
||||
if [[ "${BUILD_UNIVERSAL_LIBRARIES}" == "true" ]]; then
|
||||
build/ios/create-universal-libs.sh \
|
||||
-o "${lib_dir}/universal" \
|
||||
"${lib_dir}/arm64-iphonesimulator" \
|
||||
"${lib_dir}/x86_64-iphonesimulator"
|
||||
-o out/ios-release/filament/lib/universal \
|
||||
out/ios-release/filament/lib/arm64 \
|
||||
out/ios-release/filament/lib/x86_64
|
||||
rm -rf out/ios-release/filament/lib/arm64
|
||||
rm -rf out/ios-release/filament/lib/x86_64
|
||||
fi
|
||||
|
||||
# Always create XCFrameworks
|
||||
local xcframework_paths=("${lib_dir}/arm64-iphoneos")
|
||||
if [[ -d "${lib_dir}/universal" ]]; then
|
||||
xcframework_paths+=("${lib_dir}/universal")
|
||||
elif [[ -d "${lib_dir}/arm64-iphonesimulator" ]]; then
|
||||
xcframework_paths+=("${lib_dir}/arm64-iphonesimulator")
|
||||
elif [[ -d "${lib_dir}/x86_64-iphonesimulator" ]]; then
|
||||
xcframework_paths+=("${lib_dir}/x86_64-iphonesimulator")
|
||||
fi
|
||||
|
||||
build/ios/create-xc-frameworks.sh -o "${lib_dir}" "${xcframework_paths[@]}"
|
||||
|
||||
rm -rf \
|
||||
"${lib_dir}/arm64-iphoneos" \
|
||||
"${lib_dir}/arm64-iphonesimulator" \
|
||||
"${lib_dir}/x86_64-iphonesimulator" \
|
||||
"${lib_dir}/universal"
|
||||
|
||||
archive_ios "Release"
|
||||
fi
|
||||
}
|
||||
@@ -850,7 +809,7 @@ function validate_build_command {
|
||||
fi
|
||||
fi
|
||||
# If building a WebAssembly module, ensure we know where Emscripten lives.
|
||||
if [[ "${EMSDK}" == "" ]] && [[ "${ISSUE_WASM_BUILD}" == "true" ]]; then
|
||||
if [[ "${EMSDK}" == "" ]] && [[ "${ISSUE_WEBGL_BUILD}" == "true" ]]; then
|
||||
echo "Error: EMSDK is not set, exiting"
|
||||
exit 1
|
||||
fi
|
||||
@@ -876,7 +835,7 @@ function run_test {
|
||||
}
|
||||
|
||||
function run_tests {
|
||||
if [[ "${ISSUE_WASM_BUILD}" == "true" ]]; then
|
||||
if [[ "${ISSUE_WEBGL_BUILD}" == "true" ]]; then
|
||||
if ! echo "TypeScript $(tsc --version)" ; then
|
||||
tsc --noEmit \
|
||||
third_party/gl-matrix/gl-matrix.d.ts \
|
||||
@@ -961,18 +920,18 @@ while getopts ":hacCfgimp:q:uvWslwedtk:bVx:S:X:Py:E" opt; do
|
||||
ios)
|
||||
ISSUE_IOS_BUILD=true
|
||||
;;
|
||||
wasm)
|
||||
ISSUE_WASM_BUILD=true
|
||||
webgl)
|
||||
ISSUE_WEBGL_BUILD=true
|
||||
;;
|
||||
all)
|
||||
ISSUE_ANDROID_BUILD=true
|
||||
ISSUE_IOS_BUILD=true
|
||||
ISSUE_DESKTOP_BUILD=true
|
||||
ISSUE_WASM_BUILD=false
|
||||
ISSUE_WEBGL_BUILD=false
|
||||
;;
|
||||
*)
|
||||
echo "Unknown platform ${platform}"
|
||||
echo "Platform must be one of [desktop|android|ios|wasm|all]"
|
||||
echo "Platform must be one of [desktop|android|ios|webgl|all]"
|
||||
echo ""
|
||||
exit 1
|
||||
;;
|
||||
@@ -1153,8 +1112,8 @@ if [[ "${ISSUE_IOS_BUILD}" == "true" ]]; then
|
||||
check_debug_release_build build_ios
|
||||
fi
|
||||
|
||||
if [[ "${ISSUE_WASM_BUILD}" == "true" ]]; then
|
||||
check_debug_release_build build_wasm
|
||||
if [[ "${ISSUE_WEBGL_BUILD}" == "true" ]]; then
|
||||
check_debug_release_build build_webgl
|
||||
fi
|
||||
|
||||
if [[ "${RUN_TESTS}" == "true" ]]; then
|
||||
|
||||
+23
-36
@@ -13,20 +13,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
||||
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"dependencies": {
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/http-client": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/exec": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
||||
"dependencies": {
|
||||
"@actions/io": "^1.0.1"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/glob": {
|
||||
@@ -46,11 +38,6 @@
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/io": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
||||
},
|
||||
"node_modules/@octokit/auth-token": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz",
|
||||
@@ -270,24 +257,24 @@
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.2.tgz",
|
||||
"integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
||||
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"requires": {
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/http-client": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"@actions/exec": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
||||
"requires": {
|
||||
"@actions/io": "^1.0.1"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"@actions/glob": {
|
||||
@@ -307,11 +294,6 @@
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"@actions/io": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
||||
},
|
||||
"@octokit/auth-token": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz",
|
||||
@@ -462,6 +444,11 @@
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.2.tgz",
|
||||
"integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q=="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
function print_help {
|
||||
local SELF_NAME
|
||||
SELF_NAME=$(basename "$0")
|
||||
echo "$SELF_NAME. Combine multiple platform-specific libraries into XCFramework bundles."
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo " $SELF_NAME [options] <path>..."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -h"
|
||||
echo " Print this help message."
|
||||
echo " -o"
|
||||
echo " Output directory to store the XCFrameworks."
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " $SELF_NAME -o xcframeworks/ iphoneos/ iphonesimulator/"
|
||||
echo ""
|
||||
}
|
||||
|
||||
OUTPUT_DIR=""
|
||||
while getopts "ho:" opt; do
|
||||
case ${opt} in
|
||||
h)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
o)
|
||||
OUTPUT_DIR="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
PATHS=("$@")
|
||||
|
||||
if [[ ! "${PATHS[*]}" ]]; then
|
||||
echo "One or more paths required."
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! "${OUTPUT_DIR}" ]]; then
|
||||
echo "Output directory required."
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
|
||||
# Use the first path as the leader to find all .a files
|
||||
LEADER_PATH="${PATHS[0]}"
|
||||
|
||||
for FILE in "${LEADER_PATH}"/*.a; do
|
||||
[ -f "${FILE}" ] || continue
|
||||
|
||||
LIBRARY_NAME="${FILE##*/}"
|
||||
FRAMEWORK_NAME="${LIBRARY_NAME%.a}.xcframework"
|
||||
|
||||
echo "Creating XCFramework for: ${LIBRARY_NAME}"
|
||||
|
||||
CMD="xcodebuild -create-xcframework"
|
||||
|
||||
for PLATFORM_PATH in "${PATHS[@]}"; do
|
||||
LIB_PATH="${PLATFORM_PATH}/${LIBRARY_NAME}"
|
||||
if [[ -f "${LIB_PATH}" ]]; then
|
||||
CMD="${CMD} -library ${LIB_PATH}"
|
||||
else
|
||||
echo "Warning: ${LIB_PATH} does not exist, skipping this platform for ${LIBRARY_NAME}"
|
||||
fi
|
||||
done
|
||||
|
||||
CMD="${CMD} -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}"
|
||||
|
||||
# Remove existing framework if it exists
|
||||
rm -rf "${OUTPUT_DIR}/${FRAMEWORK_NAME}"
|
||||
|
||||
eval "${CMD}"
|
||||
done
|
||||
+1
-1
@@ -8,4 +8,4 @@ set -x
|
||||
source `dirname $0`/../common/build-common.sh
|
||||
pushd `dirname $0`/../.. > /dev/null
|
||||
|
||||
./build.sh -p wasm -c $RUN_TESTS $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
|
||||
./build.sh -p webgl -c $RUN_TESTS $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
|
||||
|
||||
+3
-3
@@ -234,11 +234,11 @@ book.</p>
|
||||
<p>The process for copying and processing these READMEs is outlined in
|
||||
<a href="#introductory-doc">Introductory docs</a>.</p>
|
||||
<h3 id="web-examples-and-tutorials"><a class="header" href="#web-examples-and-tutorials">Web Examples and Tutorials</a></h3>
|
||||
<p>Filament provides a number of web tutorials and examples in the <code>web/</code> directory. These are
|
||||
compiled during the web CMake build and are integrated into the documentation via
|
||||
<p>Filament provides a number of WebGL tutorials and examples in the <code>web/</code> directory. These are
|
||||
compiled during the WebGL CMake build and are integrated into the documentation via
|
||||
<code>duplicates.json</code>. The process is entirely automated:</p>
|
||||
<ol>
|
||||
<li><code>run.py</code> maps the <code>.html</code> and <code>.md</code> web outputs from the <code>out/cmake-wasm-release/...</code>
|
||||
<li><code>run.py</code> maps the <code>.html</code> and <code>.md</code> WebGL outputs from the <code>out/cmake-webgl-release/...</code>
|
||||
directory into <code>docs_src/src_mdbook/src/samples/web/</code> using the instructions in <code>duplicates.json</code>.</li>
|
||||
<li>While transferring <code>.html</code> to <code>.md</code>, <code>run.py</code> strips away the <code><!DOCTYPE html></code>, <code><head></code>, and
|
||||
<code><html></code> tags. By retaining only the <code><style></code> and <code><body></code> elements, the HTML samples can be
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@
|
||||
<a href="https://github.com/google/filament/actions/workflows/status-windows.yml"><img src="https://github.com/google/filament/actions/workflows/status-windows.yml/badge.svg" alt="Windows Build Status" /></a>
|
||||
<a href="https://github.com/google/filament/actions/workflows/status-web.yml"><img src="https://github.com/google/filament/actions/workflows/status-web.yml/badge.svg" alt="Web Build Status" /></a></p>
|
||||
<p>Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows,
|
||||
and WASM. It is designed to be as small as possible and as efficient as possible on Android.</p>
|
||||
and WebGL. It is designed to be as small as possible and as efficient as possible on Android.</p>
|
||||
<h2 id="download"><a class="header" href="#download">Download</a></h2>
|
||||
<p><a href="https://github.com/google/filament/releases">Download Filament releases</a> to access stable builds.
|
||||
Filament release archives contains host-side tools that are required to generate assets.</p>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
+3
-3
@@ -81,10 +81,10 @@ The process for copying and processing these READMEs is outlined in
|
||||
[Introductory docs](#introductory-doc).
|
||||
|
||||
### Web Examples and Tutorials
|
||||
Filament provides a number of web tutorials and examples in the `web/` directory. These are
|
||||
compiled during the web CMake build and are integrated into the documentation via
|
||||
Filament provides a number of WebGL tutorials and examples in the `web/` directory. These are
|
||||
compiled during the WebGL CMake build and are integrated into the documentation via
|
||||
`duplicates.json`. The process is entirely automated:
|
||||
1. `run.py` maps the `.html` and `.md` web outputs from the `out/cmake-wasm-release/...`
|
||||
1. `run.py` maps the `.html` and `.md` WebGL outputs from the `out/cmake-webgl-release/...`
|
||||
directory into `docs_src/src_mdbook/src/samples/web/` using the instructions in `duplicates.json`.
|
||||
2. While transferring `.html` to `.md`, `run.py` strips away the `<!DOCTYPE html>`, `<head>`, and
|
||||
`<html>` tags. By retaining only the `<style>` and `<body>` elements, the HTML samples can be
|
||||
|
||||
@@ -20,7 +20,7 @@ import glob
|
||||
import re
|
||||
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
OUT_DIR = os.path.join(CUR_DIR, "../../out/cmake-wasm-release/web/examples/examples")
|
||||
OUT_DIR = os.path.join(CUR_DIR, "../../out/cmake-webgl-release/web/examples/examples")
|
||||
BOOK_DIR = os.path.join(CUR_DIR, "../src_mdbook/book")
|
||||
|
||||
def setup_dirs():
|
||||
|
||||
@@ -106,43 +106,43 @@
|
||||
"filament/backend/test/README.md": {
|
||||
"dest": "dup/backend_test.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/triangle/triangle.md": {
|
||||
"out/cmake-webgl-release/web/examples/examples/triangle/triangle.md": {
|
||||
"dest": "samples/web/triangle.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/redball/redball.md": {
|
||||
"out/cmake-webgl-release/web/examples/examples/redball/redball.md": {
|
||||
"dest": "samples/web/redball.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/suzanne/suzanne.md": {
|
||||
"out/cmake-webgl-release/web/examples/examples/suzanne/suzanne.md": {
|
||||
"dest": "samples/web/suzanne.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/animation/animation.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/animation/animation.html": {
|
||||
"dest": "samples/web/animation.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/cube_fl0/cube_fl0.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/cube_fl0/cube_fl0.html": {
|
||||
"dest": "samples/web/cube_fl0.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/helmet/helmet.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/helmet/helmet.html": {
|
||||
"dest": "samples/web/helmet.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/morphing/morphing.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/morphing/morphing.html": {
|
||||
"dest": "samples/web/morphing.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/parquet/parquet.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/parquet/parquet.html": {
|
||||
"dest": "samples/web/parquet.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/skinning/skinning.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/skinning/skinning.html": {
|
||||
"dest": "samples/web/skinning.md"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/sky/sky.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/sky/sky.html": {
|
||||
"dest": "samples/web/sky.md",
|
||||
"replacements": {
|
||||
"<!-- mdbook: add fullscreen mode -->": "<a href=\"../../web/sky.html\">Full screen</a>"
|
||||
}
|
||||
},
|
||||
"./out/cmake-wasm-release/web/examples/examples/sky/sky.html": {
|
||||
"./out/cmake-webgl-release/web/examples/examples/sky/sky.html": {
|
||||
"dest": "web/sky.html"
|
||||
},
|
||||
"out/cmake-wasm-release/web/examples/examples/remote/remote.html": {
|
||||
"out/cmake-webgl-release/web/examples/examples/remote/remote.html": {
|
||||
"dest": "remote/index.html"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ FILAMENT_BOT_TOKEN=$2
|
||||
set -ex
|
||||
|
||||
function update_to_main() {
|
||||
./build.sh -p wasm release
|
||||
./build.sh -p webgl release
|
||||
python3 docs_src/build/run.py
|
||||
mkdir -p tmp
|
||||
pushd .
|
||||
|
||||
@@ -744,10 +744,10 @@ if (MSVC)
|
||||
set(OPTIMIZATION_FLAGS
|
||||
/fp:fast
|
||||
)
|
||||
elseif (WASM)
|
||||
elseif(WEBGL)
|
||||
# Avoid strict-vtable-pointers here, it is broken in WebAssembly.
|
||||
set(OPTIMIZATION_FLAGS -fvisibility-inlines-hidden)
|
||||
elseif (FILAMENT_USING_GCC)
|
||||
elseif(FILAMENT_USING_GCC)
|
||||
set(OPTIMIZATION_FLAGS
|
||||
-ffast-math
|
||||
-fno-finite-math-only
|
||||
|
||||
@@ -124,7 +124,7 @@ if (FILAMENT_SUPPORTS_OPENGL AND NOT FILAMENT_USE_EXTERNAL_GLES3)
|
||||
list(APPEND SRCS src/opengl/platforms/PlatformCocoaGL.mm)
|
||||
list(APPEND SRCS src/opengl/platforms/CocoaExternalImage.mm)
|
||||
endif()
|
||||
elseif (WASM)
|
||||
elseif (WEBGL)
|
||||
list(APPEND SRCS src/opengl/platforms/PlatformWebGL.cpp)
|
||||
elseif (LINUX)
|
||||
if (FILAMENT_SUPPORTS_X11)
|
||||
@@ -432,7 +432,7 @@ if (FILAMENT_USE_ABSEIL_LOGGING)
|
||||
endif()
|
||||
|
||||
# Android, iOS, and WebGL do not use bluegl.
|
||||
if(FILAMENT_SUPPORTS_OPENGL AND NOT IOS AND NOT ANDROID AND NOT WASM)
|
||||
if(FILAMENT_SUPPORTS_OPENGL AND NOT IOS AND NOT ANDROID AND NOT WEBGL)
|
||||
target_link_libraries(${TARGET} PRIVATE bluegl)
|
||||
endif()
|
||||
|
||||
@@ -463,7 +463,7 @@ if (MSVC)
|
||||
set(OPTIMIZATION_FLAGS
|
||||
/fp:fast
|
||||
)
|
||||
elseif(WASM)
|
||||
elseif(WEBGL)
|
||||
# Avoid strict-vtable-pointers here, it is broken in WebAssembly.
|
||||
set(OPTIMIZATION_FLAGS -fvisibility-inlines-hidden)
|
||||
elseif(FILAMENT_USING_GCC)
|
||||
@@ -699,7 +699,7 @@ if (FILAMENT_BUILD_TESTING)
|
||||
# ==================================================================================================
|
||||
# Compute tests
|
||||
#
|
||||
#if (NOT IOS AND NOT WASM)
|
||||
#if (NOT IOS AND NOT WEBGL)
|
||||
#
|
||||
#add_executable(compute_test
|
||||
# test/ComputeTest.cpp
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
#include "backend/PresentCallable.h"
|
||||
#include "private/backend/CommandStream.h"
|
||||
#include "CommandStreamDispatcher.h"
|
||||
@@ -161,11 +160,9 @@ MetalDriver::MetalDriver(
|
||||
}
|
||||
|
||||
mContext->supportsDepthClamp = false;
|
||||
#if !TARGET_OS_SIMULATOR
|
||||
if (@available(macOS 10.11, iOS 11.0, *)) {
|
||||
mContext->supportsDepthClamp = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// In order to support resolve store action on depth attachment, the GPU needs to support it.
|
||||
// Note that support for depth resolve implies support for stencil resolve using .sample0 resolve filter.
|
||||
|
||||
@@ -43,6 +43,101 @@ namespace filament::backend {
|
||||
|
||||
namespace {
|
||||
|
||||
/**
|
||||
* Given the source code of a [WGSL] WebGPU shader in text (string view to it) and the constants
|
||||
* to be overwritten now (at runtime), returns updated [WGSL] shader code text, where the constants
|
||||
* have been replaced.
|
||||
* @param shaderLabel Something to call this shader for troubleshooting, error messaging, etc.
|
||||
* @param shaderSource The original WGSL WebGPU shader code as text to be processed. This is a
|
||||
* view to that text and this function does not change it; it is immutable.
|
||||
* Instead, the processed version of this source is returned by the function.
|
||||
* @param specConstants The constants to replace in the shader code, indexed by constant id.
|
||||
* @return Processed version of the WGSL WebGPU shader code provided, where the constants have
|
||||
* been replaced with the values provided by the specConstants parameter.
|
||||
*/
|
||||
[[nodiscard]] std::string replaceSpecConstants(std::string_view shaderLabel,
|
||||
std::string_view shaderSource,
|
||||
utils::FixedCapacityVector<Program::SpecializationConstant> const& specConstants) {
|
||||
// this function is not expected to be called at all if no spec constants are to be replaced
|
||||
assert_invariant(!specConstants.empty());
|
||||
static constexpr std::string_view specConstantPrefix = "FILAMENT_SPEC_CONST_";
|
||||
static constexpr size_t specConstantPrefixSize = specConstantPrefix.size();
|
||||
const char* const sourceData = shaderSource.data();
|
||||
std::stringstream processedShaderSource{};
|
||||
size_t pos = 0;
|
||||
while (pos < shaderSource.size()) {
|
||||
const size_t posOfNextSpecConstant = shaderSource.find(specConstantPrefix, pos);
|
||||
if (posOfNextSpecConstant == std::string::npos) {
|
||||
// no more spec constants, so just stream the rest of the source code string
|
||||
processedShaderSource << std::string_view(sourceData + pos, shaderSource.size() - pos);
|
||||
break;
|
||||
}
|
||||
const size_t posOfId = posOfNextSpecConstant + specConstantPrefixSize;
|
||||
const size_t posAfterId = shaderSource.find('_', posOfId);
|
||||
FILAMENT_CHECK_POSTCONDITION(posAfterId != std::string::npos)
|
||||
<< "malformed " << shaderLabel << ". Found spec constant prefix '"
|
||||
<< specConstantPrefix << "' without an id or '_' after it.";
|
||||
const std::string_view idStr =
|
||||
std::string_view(sourceData + posOfId, posAfterId - posOfId);
|
||||
const size_t posEndOfStatement = shaderSource.find(';', posAfterId);
|
||||
FILAMENT_CHECK_POSTCONDITION(posEndOfStatement != std::string::npos)
|
||||
<< "malformed " << shaderLabel << ". Found spec constant assignment with id "
|
||||
<< idStr << " without a terminating ';' character?";
|
||||
// this is a view into part of the statement, from after the id to the ';'
|
||||
const std::string_view statementSegment =
|
||||
std::string_view(sourceData + posAfterId, posEndOfStatement - posAfterId);
|
||||
size_t posOfEqual = statementSegment.find('=');
|
||||
if (posOfEqual == std::string::npos) {
|
||||
// Not an assignment, so we don't need to replace it.
|
||||
processedShaderSource << std::string_view(sourceData + pos,
|
||||
posEndOfStatement + 1 - pos);
|
||||
pos = posEndOfStatement + 1;
|
||||
continue;
|
||||
}
|
||||
posOfEqual += posAfterId; // position in original source overall, not just the segment
|
||||
int constantId = 0;
|
||||
char* endPtr;
|
||||
errno = 0; // Clear errno before the call
|
||||
|
||||
long tempConstantId = std::strtol(idStr.data(), &endPtr, 10);
|
||||
|
||||
// Check for conversion errors
|
||||
if (endPtr == idStr.data() || *endPtr != '\0' || errno == ERANGE) {
|
||||
// Parsing failed, or conversion was out of range for 'long'
|
||||
// or the string contained non-numeric characters after the number.
|
||||
PANIC_POSTCONDITION("Invalid spec constant id '%s' in %s (not a valid integer or out "
|
||||
"of range for 'long'?)",
|
||||
idStr.data(), shaderLabel.data());
|
||||
} else {
|
||||
// Check if the parsed long value fits into an int
|
||||
if (tempConstantId > std::numeric_limits<int>::max() ||
|
||||
tempConstantId < std::numeric_limits<int>::min()) {
|
||||
PANIC_POSTCONDITION(
|
||||
"Invalid spec constant id '%s' in %s (value out of range for 'int')",
|
||||
idStr.data(), shaderLabel.data());
|
||||
} else {
|
||||
constantId = static_cast<int>(tempConstantId);
|
||||
}
|
||||
}
|
||||
const std::variant<int32_t, float, bool> newValue = specConstants[constantId];
|
||||
// stream up to the equal sign...
|
||||
processedShaderSource << std::string_view(sourceData + pos, posOfEqual + 1 - pos);
|
||||
// stream the new value...
|
||||
if (auto* v = std::get_if<int32_t>(&newValue)) {
|
||||
processedShaderSource << " " << *v << "i";
|
||||
} else if (auto* f = std::get_if<float>(&newValue)) {
|
||||
processedShaderSource << " " << *f << "f";
|
||||
} else if (auto* b = std::get_if<bool>(&newValue)) {
|
||||
processedShaderSource << " " << ((*b) ? "true" : "false");
|
||||
}
|
||||
// end the statement...
|
||||
processedShaderSource << ";";
|
||||
// and skip to after the end of the statement in the original source and continue...
|
||||
pos = posEndOfStatement + 1;
|
||||
}
|
||||
return processedShaderSource.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a WebGPU shader module for a given "program" "stage", accounting for override constants.
|
||||
* Effectively, this function is responsible for preprocessing the shader source and compiling it.
|
||||
@@ -50,12 +145,14 @@ namespace {
|
||||
* a shader module
|
||||
* @param program The "program" to compile/create the shader, which includes the shader source
|
||||
* @param stage The stage (e.g. vertex, fragment, etc.) to create the shader module
|
||||
* @param specConstants Override constants to apply when creating/compiling the shader module.
|
||||
* @return the proper WebGPU shader module compiled/created from the input parameters. This might
|
||||
* wrap a null handle if the shader is not present (if the shader source is empty), such as
|
||||
* a missing fragment or compute shader.
|
||||
*/
|
||||
[[nodiscard]] wgpu::ShaderModule createShaderModule(wgpu::Device const& device,
|
||||
Program const& program, const ShaderStage stage) {
|
||||
Program const& program, const ShaderStage stage,
|
||||
utils::FixedCapacityVector<Program::SpecializationConstant> const& specConstants) {
|
||||
const char* const programName = program.getName().c_str_safe();
|
||||
std::array<utils::FixedCapacityVector<uint8_t>, Program::SHADER_TYPE_COUNT> const&
|
||||
shaderSource = program.getShadersSource();
|
||||
@@ -67,9 +164,13 @@ namespace {
|
||||
std::stringstream labelStream;
|
||||
labelStream << programName << " " << filamentShaderStageToString(stage) << " shader";
|
||||
const auto label = labelStream.str();
|
||||
|
||||
const std::string processedShaderSource =
|
||||
specConstants.empty()
|
||||
? reinterpret_cast<const char*>(sourceBytes.data())
|
||||
: replaceSpecConstants(label, reinterpret_cast<const char*>(sourceBytes.data()),
|
||||
specConstants);
|
||||
wgpu::ShaderSourceWGSL wgslDescriptor{};
|
||||
wgslDescriptor.code = wgpu::StringView(reinterpret_cast<const char*>(sourceBytes.data()));
|
||||
wgslDescriptor.code = wgpu::StringView(processedShaderSource);
|
||||
const wgpu::ShaderModuleDescriptor descriptor{
|
||||
.nextInChain = &wgslDescriptor,
|
||||
.label = label.data()
|
||||
@@ -150,11 +251,14 @@ namespace {
|
||||
}// namespace
|
||||
|
||||
WebGPUProgram::WebGPUProgram(wgpu::Device const& device, Program const& program)
|
||||
: HwProgram{ program.getName() } {
|
||||
: HwProgram{ program.getName() } {
|
||||
utils::FixedCapacityVector<Program::SpecializationConstant> const& specConstants =
|
||||
program.getSpecializationConstants();
|
||||
// TODO: Consider creating/compiling these shaders in parallel.
|
||||
vertexShaderModule = createShaderModule(device, program, ShaderStage::VERTEX);
|
||||
fragmentShaderModule = createShaderModule(device, program, ShaderStage::FRAGMENT);
|
||||
computeShaderModule = createShaderModule(device, program, ShaderStage::COMPUTE);
|
||||
vertexShaderModule = createShaderModule(device, program, ShaderStage::VERTEX, specConstants);
|
||||
fragmentShaderModule =
|
||||
createShaderModule(device, program, ShaderStage::FRAGMENT, specConstants);
|
||||
computeShaderModule = createShaderModule(device, program, ShaderStage::COMPUTE, specConstants);
|
||||
}
|
||||
|
||||
}// namespace filament::backend
|
||||
|
||||
@@ -225,73 +225,42 @@ struct AttributeInfo final {
|
||||
* associated with a vertex buffer, and the slot each one belongs
|
||||
*/
|
||||
void createBufferLayoutsBindingSlotsAndAttributeInfos(AttributeArray const& attributes,
|
||||
const uint32_t deviceMaxVertexBuffers,
|
||||
const uint8_t attributeCount, const uint32_t deviceMaxVertexBuffers,
|
||||
std::vector<WebGPUVertexBufferInfo::WebGPUSlotBindingInfo>& outWebGPUSlotBindingInfos,
|
||||
std::vector<wgpu::VertexBufferLayout>& outVertexBufferLayouts,
|
||||
std::array<AttributeInfo, MAX_VERTEX_ATTRIBUTE_COUNT>& outAttributeInfos,
|
||||
uint8_t& outActualAttributeCount) {
|
||||
std::array<AttributeInfo, MAX_VERTEX_ATTRIBUTE_COUNT>& outAttributeInfos) {
|
||||
uint8_t currentWebGPUSlotIndex = 0;
|
||||
uint8_t currentAttributeIndex = 0;
|
||||
outVertexBufferLayouts.reserve(MAX_VERTEX_BUFFER_COUNT);
|
||||
outWebGPUSlotBindingInfos.reserve(outVertexBufferLayouts.capacity());
|
||||
|
||||
// Find a valid attribute to use as a dummy for unused slots (typically POSITION at index 0)
|
||||
Attribute dummyAttribute{};
|
||||
bool hasDummy = false;
|
||||
for (uint32_t i = 0; i < attributes.size(); ++i) {
|
||||
if (attributes[i].buffer != Attribute::BUFFER_UNUSED) {
|
||||
dummyAttribute = attributes[i];
|
||||
hasDummy = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WebGPU Strict Validation Workaround:
|
||||
*
|
||||
* 1. Completeness: WebGPU requires ALL shader-declared attributes to exist in the Pipeline's
|
||||
* VertexState, even if unused by a specific mesh variant (e.g., BONE_WEIGHTS).
|
||||
* 2. Stride Boundary: Offset + Format_Size <= arrayStride.
|
||||
*
|
||||
* If we omit an unused attribute, WebGPU crashes (violates 1).
|
||||
* If we pad it as Float32x4 (16 bytes) into Slot 0 (e.g., Position, stride 12), WebGPU crashes
|
||||
* (violates 2):
|
||||
*
|
||||
* [ Slot 0 Stride: 12 bytes ]
|
||||
* |-------POSITION--------|
|
||||
* |------ BONE_WEIGHTS (Float32x4 = 16b) -----| <-- OVERFLOWS STRIDE!
|
||||
*
|
||||
* FIX: We alias unused attributes into Slot 0 as a 4-byte format (Float32 or Uint32).
|
||||
*
|
||||
* [ Slot 0 Stride: 12 bytes ]
|
||||
* |-------POSITION--------|
|
||||
* |-BONE-| <-- (Float32 = 4b) Safely fits inside the 12-byte stride!
|
||||
*
|
||||
* WebGPU safely promotes the 4-byte Float32 into a WGSL vec4<f32> as (x, 0.0, 0.0, 1.0).
|
||||
*/
|
||||
for (uint32_t attributeIndex = 0; attributeIndex < attributes.size(); ++attributeIndex) {
|
||||
auto attribute = attributes[attributeIndex];
|
||||
wgpu::VertexFormat vertexFormat;
|
||||
|
||||
const auto& attribute = attributes[attributeIndex];
|
||||
if (attribute.buffer == Attribute::BUFFER_UNUSED) {
|
||||
if (!hasDummy) {
|
||||
continue;
|
||||
}
|
||||
// HACK: Re-use the dummy buffer for disabled attributes to satisfy WebGPU validation.
|
||||
// Filament's shaders expect vec4 or uvec4. We provide a dummy format.
|
||||
const bool isInteger = attribute.flags & Attribute::FLAG_INTEGER_TARGET;
|
||||
vertexFormat = isInteger ? wgpu::VertexFormat::Uint8x4 : wgpu::VertexFormat::Unorm8x4;
|
||||
attribute = dummyAttribute;
|
||||
} else {
|
||||
const bool isInteger = attribute.flags & Attribute::FLAG_INTEGER_TARGET;
|
||||
const bool isNormalized = attribute.flags & Attribute::FLAG_NORMALIZED;
|
||||
vertexFormat = getVertexFormat(attribute.type, isNormalized, isInteger);
|
||||
// We ignore "unused" attributes, ones not associated with a buffer. If a shader
|
||||
// references such an attribute we have a bug one way or another. Either the API/CPU
|
||||
// will produce an error (best case scenario), where an attribute is referenced in the
|
||||
// shader but not provided by the backend API (CPU-side), or the shader would be getting
|
||||
// junk/undefined data from the GPU, since we do not have a valid buffer of data to
|
||||
// provide to the shader/GPU.
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool isInteger = attribute.flags & Attribute::FLAG_INTEGER_TARGET;
|
||||
const bool isNormalized = attribute.flags & Attribute::FLAG_NORMALIZED;
|
||||
const wgpu::VertexFormat vertexFormat =
|
||||
getVertexFormat(attribute.type, isNormalized, isInteger);
|
||||
uint8_t existingSlot = INVALID_SLOT_INDEX;
|
||||
for (uint32_t slot = 0; slot < currentWebGPUSlotIndex; slot++) {
|
||||
WebGPUVertexBufferInfo::WebGPUSlotBindingInfo const& info =
|
||||
outWebGPUSlotBindingInfos[slot];
|
||||
// We consider attributes to be in the same slot/layout only if they belong to the
|
||||
// same buffer and are interleaved; they cannot belong to separate partitions in the
|
||||
// same buffer, for example.
|
||||
// For the attributes to be interleaved, the stride must match (among other things).
|
||||
// The attribute offset being less than the slot's/layout's buffer offset indicates
|
||||
// that it is in a separate partition before this slot/layout, thus not part of it.
|
||||
// The difference from the attribute's offset and this slot's/layout's buffer offset
|
||||
// being greater than the stride indicates it is in a separate partition after this
|
||||
// slot/layout, thus not part of it.
|
||||
if (info.sourceBufferIndex == attribute.buffer && info.stride == attribute.stride &&
|
||||
attribute.offset >= info.bufferOffset &&
|
||||
((attribute.offset - info.bufferOffset) < attribute.stride)) {
|
||||
@@ -300,18 +269,26 @@ void createBufferLayoutsBindingSlotsAndAttributeInfos(AttributeArray const& attr
|
||||
}
|
||||
}
|
||||
if (existingSlot == INVALID_SLOT_INDEX) {
|
||||
// New combination, use a new WebGPU slot
|
||||
FILAMENT_CHECK_PRECONDITION(currentWebGPUSlotIndex < MAX_VERTEX_BUFFER_COUNT &&
|
||||
currentWebGPUSlotIndex < deviceMaxVertexBuffers)
|
||||
<< "Number of vertex buffer layouts must not exceed MAX_VERTEX_BUFFER_COUNT ("
|
||||
<< MAX_VERTEX_BUFFER_COUNT << ") or the device limit ("
|
||||
<< deviceMaxVertexBuffers << ")";
|
||||
existingSlot = currentWebGPUSlotIndex++;
|
||||
outWebGPUSlotBindingInfos.push_back({ .sourceBufferIndex = attribute.buffer,
|
||||
outWebGPUSlotBindingInfos.push_back({
|
||||
.sourceBufferIndex = attribute.buffer,
|
||||
.bufferOffset = attribute.offset,
|
||||
.stride = attribute.stride });
|
||||
outVertexBufferLayouts.push_back(
|
||||
{ .stepMode = wgpu::VertexStepMode::Vertex, .arrayStride = attribute.stride });
|
||||
// we need to have a vertex buffer layout for each slot
|
||||
outVertexBufferLayouts.push_back({
|
||||
.stepMode = wgpu::VertexStepMode::Vertex,
|
||||
.arrayStride = attribute.stride
|
||||
// we do not know attributeCount or attributes at this time. We get those
|
||||
// in a subsequent pass over the attributeInfos we collect in this loop.
|
||||
});
|
||||
}
|
||||
// we don't use a designated initializer here because certain compilers can't handle it
|
||||
outAttributeInfos[currentAttributeIndex++] = AttributeInfo(
|
||||
existingSlot,
|
||||
{
|
||||
@@ -320,8 +297,9 @@ void createBufferLayoutsBindingSlotsAndAttributeInfos(AttributeArray const& attr
|
||||
attribute.offset - outWebGPUSlotBindingInfos[existingSlot].bufferOffset,
|
||||
.shaderLocation = attributeIndex });
|
||||
}
|
||||
|
||||
outActualAttributeCount = currentAttributeIndex;
|
||||
FILAMENT_CHECK_POSTCONDITION(currentAttributeIndex == attributeCount)
|
||||
<< "Using " << currentAttributeIndex << " attributes, but " << attributeCount
|
||||
<< " where indicated.";
|
||||
outVertexBufferLayouts.shrink_to_fit();
|
||||
outWebGPUSlotBindingInfos.shrink_to_fit();
|
||||
}
|
||||
@@ -338,21 +316,21 @@ WebGPUVertexBufferInfo::WebGPUVertexBufferInfo(const uint8_t bufferCount,
|
||||
<< ") exceeds Filament's MAX_VERTEX_ATTRIBUTE_COUNT limit ("
|
||||
<< MAX_VERTEX_ATTRIBUTE_COUNT << ") and/or the device's limit ("
|
||||
<< deviceLimits.maxVertexAttributes << ")";
|
||||
mVertexAttributes.reserve(MAX_VERTEX_ATTRIBUTE_COUNT); // Reserve max as we might add dummies
|
||||
mVertexAttributes.reserve(attributeCount);
|
||||
if (attributeCount == 0) {
|
||||
mVertexBufferLayouts.resize(0);
|
||||
mWebGPUSlotBindingInfos.resize(0);
|
||||
return; // should not be possible, but being defensive. nothing to do otherwise
|
||||
}
|
||||
std::array<AttributeInfo, MAX_VERTEX_ATTRIBUTE_COUNT> attributeInfos{};
|
||||
uint8_t actualAttributeCount = 0;
|
||||
createBufferLayoutsBindingSlotsAndAttributeInfos(attributes, deviceLimits.maxVertexBuffers,
|
||||
mWebGPUSlotBindingInfos, mVertexBufferLayouts, attributeInfos, actualAttributeCount);
|
||||
createBufferLayoutsBindingSlotsAndAttributeInfos(attributes, attributeCount,
|
||||
deviceLimits.maxVertexBuffers, mWebGPUSlotBindingInfos, mVertexBufferLayouts,
|
||||
attributeInfos);
|
||||
// sort attribute infos by increasing slot (by increasing offset within each slot).
|
||||
// We do this to ensure that attributes for the same slot/layout are contiguous in
|
||||
// the vector, so the vertex buffer layout associated with these contiguous attributes
|
||||
// can directly reference them in the mVertexAttributes vector below.
|
||||
std::sort(attributeInfos.data(), attributeInfos.data() + actualAttributeCount,
|
||||
std::sort(attributeInfos.data(), attributeInfos.data() + attributeCount,
|
||||
[](AttributeInfo const& first, AttributeInfo const& second) {
|
||||
if (first.slot < second.slot) {
|
||||
return true;
|
||||
@@ -366,7 +344,7 @@ WebGPUVertexBufferInfo::WebGPUVertexBufferInfo(const uint8_t bufferCount,
|
||||
});
|
||||
// populate mVertexAttributes and update mVertexBufferLayouts to reference the correct
|
||||
// attributes in it (which will be contiguous in memory as ensured by the sorting above)...
|
||||
for (uint32_t attributeIndex = 0; attributeIndex < actualAttributeCount; ++attributeIndex) {
|
||||
for (uint32_t attributeIndex = 0; attributeIndex < attributeCount; ++attributeIndex) {
|
||||
AttributeInfo const& info = attributeInfos[attributeIndex];
|
||||
mVertexAttributes.push_back(info.attribute);
|
||||
if (mVertexBufferLayouts[info.slot].attributeCount == 0) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
project(filament-tests)
|
||||
|
||||
if(IOS OR WASM)
|
||||
if(IOS OR WEBGL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@ Pod::Spec.new do |spec|
|
||||
|
||||
spec.libraries = 'c++'
|
||||
|
||||
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
|
||||
spec.pod_target_xcconfig = {
|
||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
|
||||
}
|
||||
spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
|
||||
|
||||
spec.subspec "filament" do |ss|
|
||||
ss.source_files =
|
||||
"include/filament/*.h",
|
||||
@@ -19,13 +25,13 @@ Pod::Spec.new do |spec|
|
||||
"include/ibl/*.h",
|
||||
"include/geometry/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libfilament.xcframework",
|
||||
"lib/libbackend.xcframework",
|
||||
"lib/libfilabridge.xcframework",
|
||||
"lib/libfilaflat.xcframework",
|
||||
"lib/libibl.xcframework",
|
||||
"lib/libgeometry.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libfilament.a",
|
||||
"lib/universal/libbackend.a",
|
||||
"lib/universal/libfilabridge.a",
|
||||
"lib/universal/libfilaflat.a",
|
||||
"lib/universal/libibl.a",
|
||||
"lib/universal/libgeometry.a"
|
||||
ss.dependency "Filament/utils"
|
||||
ss.dependency "Filament/math"
|
||||
end
|
||||
@@ -36,10 +42,11 @@ Pod::Spec.new do |spec|
|
||||
"include/filament/MaterialChunkType.h",
|
||||
"include/filament/MaterialEnums.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libfilamat.xcframework",
|
||||
"lib/libshaders.xcframework",
|
||||
"lib/libsmol-v.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libfilamat.a",
|
||||
"lib/universal/libshaders.a",
|
||||
"lib/universal/libsmol-v.a",
|
||||
"lib/universal/libfilabridge.a"
|
||||
ss.dependency "Filament/utils"
|
||||
ss.dependency "Filament/math"
|
||||
end
|
||||
@@ -47,11 +54,11 @@ Pod::Spec.new do |spec|
|
||||
spec.subspec "gltfio_core" do |ss|
|
||||
ss.source_files = "include/gltfio/**/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libgltfio_core.xcframework",
|
||||
"lib/libdracodec.xcframework",
|
||||
"lib/libuberarchive.xcframework",
|
||||
"lib/libstb.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libgltfio_core.a",
|
||||
"lib/universal/libdracodec.a",
|
||||
"lib/universal/libuberarchive.a",
|
||||
"lib/universal/libstb.a"
|
||||
ss.dependency "Filament/filament"
|
||||
ss.dependency "Filament/ktxreader"
|
||||
ss.dependency "Filament/uberz"
|
||||
@@ -59,23 +66,23 @@ Pod::Spec.new do |spec|
|
||||
|
||||
spec.subspec "camutils" do |ss|
|
||||
ss.source_files = "include/camutils/*.h"
|
||||
ss.vendored_frameworks = "lib/libcamutils.xcframework"
|
||||
ss.vendored_libraries = "lib/universal/libcamutils.a"
|
||||
ss.header_dir = "camutils"
|
||||
ss.dependency "Filament/math"
|
||||
end
|
||||
|
||||
spec.subspec "filameshio" do |ss|
|
||||
ss.source_files = "include/filameshio/*.h"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libfilameshio.xcframework",
|
||||
"lib/libmeshoptimizer.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libfilameshio.a",
|
||||
"lib/universal/libmeshoptimizer.a"
|
||||
ss.header_dir = "filameshio"
|
||||
ss.dependency "Filament/filament"
|
||||
end
|
||||
|
||||
spec.subspec "image" do |ss|
|
||||
ss.source_files = "include/image/*.h"
|
||||
ss.vendored_frameworks = "lib/libimage.xcframework"
|
||||
ss.vendored_libraries = "lib/universal/libimage.a"
|
||||
ss.header_dir = "image"
|
||||
ss.dependency "Filament/filament"
|
||||
end
|
||||
@@ -83,7 +90,7 @@ Pod::Spec.new do |spec|
|
||||
spec.subspec "utils" do |ss|
|
||||
ss.source_files = "include/utils/**/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks = "lib/libutils.xcframework"
|
||||
ss.vendored_libraries = "lib/universal/libutils.a"
|
||||
ss.dependency "Filament/tsl"
|
||||
end
|
||||
|
||||
@@ -100,9 +107,9 @@ Pod::Spec.new do |spec|
|
||||
spec.subspec "ktxreader" do |ss|
|
||||
ss.source_files = "include/ktxreader/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libktxreader.xcframework",
|
||||
"lib/libbasis_transcoder.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libktxreader.a",
|
||||
"lib/universal/libbasis_transcoder.a"
|
||||
ss.dependency "Filament/image"
|
||||
ss.dependency "Filament/filament"
|
||||
end
|
||||
@@ -110,9 +117,9 @@ Pod::Spec.new do |spec|
|
||||
spec.subspec "viewer" do |ss|
|
||||
ss.source_files = "include/viewer/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libviewer.xcframework",
|
||||
"lib/libcivetweb.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libviewer.a",
|
||||
"lib/universal/libcivetweb.a"
|
||||
ss.dependency "Filament/filament"
|
||||
ss.dependency "Filament/gltfio_core"
|
||||
end
|
||||
@@ -120,9 +127,9 @@ Pod::Spec.new do |spec|
|
||||
spec.subspec "uberz" do |ss|
|
||||
ss.source_files = "include/uberz/*.h"
|
||||
ss.header_mappings_dir = "include"
|
||||
ss.vendored_frameworks =
|
||||
"lib/libuberzlib.xcframework",
|
||||
"lib/libzstd.xcframework"
|
||||
ss.vendored_libraries =
|
||||
"lib/universal/libuberzlib.a",
|
||||
"lib/universal/libzstd.a"
|
||||
ss.header_dir = "uberz"
|
||||
ss.dependency "Filament/filamat"
|
||||
ss.dependency "Filament/tsl"
|
||||
|
||||
+9
-14
@@ -47,16 +47,14 @@ build Filament in Release mode, replace `debug` with `release` in the above `bui
|
||||
|
||||
If you also want to be able to run on the iOS simulator, add the `-s` flag to the `build.sh`
|
||||
command. For example, the following command will build for both devices (ARM64) and the simulator
|
||||
(both Apple silicon `arm64` and Intel `x86_64`) in Debug mode:
|
||||
(x86_64) in Debug mode:
|
||||
|
||||
```
|
||||
$ ./build.sh -s -p ios -i debug
|
||||
```
|
||||
|
||||
When building for the simulator, the samples link against the libraries present in
|
||||
`out/ios-debug/filament/lib/arm64` (Apple silicon simulators) or
|
||||
`out/ios-debug/filament/lib/x86_64` (Intel simulators). The Filament `.xcframework`s expose both
|
||||
slices, so Xcode automatically picks the right one for the active simulator runtime.
|
||||
When building for the simulator, the sample will then link against the libraries present in
|
||||
`out/ios-debug/filament/lib/x86_64`.
|
||||
|
||||
## Xcode
|
||||
|
||||
@@ -90,20 +88,17 @@ from scratch.
|
||||
|
||||
## XcodeGen
|
||||
|
||||
[XcodeGen](https://github.com/yonaskolb/XcodeGen) is used to generate the Xcode projects. While not
|
||||
required to run the samples, XcodeGen makes modifying them easier. Each sample folder contains the
|
||||
`project.yml` file used for the sample, which includes a global `app-template.yml` file. Either run
|
||||
[XcodeGen](https://github.com/yonaskolb/XcodeGen) version 2.43.0 is used to generate the Xcode
|
||||
projects. While not required to run the samples, XcodeGen makes modifying them easier. Each sample
|
||||
folder contains the `project.yml` file used for the sample, which includes a global
|
||||
`app-template.yml` file. Simply run
|
||||
|
||||
```
|
||||
$ xcodegen
|
||||
```
|
||||
|
||||
within a sample folder, or run `./generate-samples.sh` from this directory to regenerate all of
|
||||
them at once.
|
||||
|
||||
The committed `project.pbxproj` files use `objectVersion = 77`, which requires **Xcode 16 or newer**
|
||||
to open. CI pins Xcode 16.2 for this reason. You may need to close and re-open the project in Xcode
|
||||
to see changes take effect.
|
||||
within a sample folder to re-generate the Xcode project. You may need to close and re-open the
|
||||
project in Xcode to see changes take effect.
|
||||
|
||||
## Building iOS Samples with ASan / UBSan
|
||||
|
||||
|
||||
@@ -13,35 +13,30 @@ targetTemplates:
|
||||
- path: ${target_name}/Materials
|
||||
buildPhase: none
|
||||
optional: true
|
||||
dependencies:
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework
|
||||
- framework: ../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework
|
||||
scheme:
|
||||
configVariants:
|
||||
- Metal
|
||||
- OpenGL
|
||||
settings:
|
||||
base:
|
||||
OTHER_LDFLAGS: ["-lfilament", "-lbackend", "-lfilaflat", "-lktxreader",
|
||||
"-lfilabridge", "-lutils", "-lsmol-v", "-lgeometry", "-libl",
|
||||
"-labseil", "-lzstd"]
|
||||
ENABLE_BITCODE: NO
|
||||
CLANG_CXX_LANGUAGE_STANDARD: c++20
|
||||
# This allows users to not have to specify a unique bundle ID when building the sample apps.
|
||||
SAMPLE_CODE_DISAMBIGUATOR: ${DEVELOPMENT_TEAM}
|
||||
configs:
|
||||
debug:
|
||||
FILAMENT_OUT_NAME: ios-debug
|
||||
HEADER_SEARCH_PATHS: ["$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include", "generated"]
|
||||
HEADER_SEARCH_PATHS: ["../../../out/ios-debug/filament/include", "generated"]
|
||||
LIBRARY_SEARCH_PATHS:
|
||||
- "../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)"
|
||||
- "../../../out/ios-debug/filament/lib/universal"
|
||||
release:
|
||||
FILAMENT_OUT_NAME: ios-release
|
||||
HEADER_SEARCH_PATHS: ["$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include", "generated"]
|
||||
HEADER_SEARCH_PATHS: ["../../../out/ios-release/filament/include", "generated"]
|
||||
LIBRARY_SEARCH_PATHS:
|
||||
- "../../../out/ios-release/filament/lib/$(CURRENT_ARCH)"
|
||||
- "../../../out/ios-release/filament/lib/universal"
|
||||
metal:
|
||||
GCC_PREPROCESSOR_DEFINITIONS: ["FILAMENT_APP_USE_METAL=1", "$(inherited)"]
|
||||
opengl:
|
||||
|
||||
@@ -3,117 +3,34 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0DE5DD77BF1B9049D63B76D0 /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7C969D515221A7739C68F3AC /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20863805FC626BF952BA3275 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33D80A4472074C601C57C773 /* ViewController.mm */; };
|
||||
2AABB2C1262EBA9553666078 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8F108854ADC54BBAA29C2055 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
305D6C983D22F7BC74FC76C7 /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0ED51915983DAE97083D44EF /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
32AC9F2183DD11F130D4A91D /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 912652335565C18B252345DE /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
376F63E72973F07BF618082D /* FilamentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = B54DFEB4DB6ACC0289FA3046 /* FilamentView.mm */; };
|
||||
3D73E90782CC3A2124DF046F /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E8375B927AFDFD1069016D1 /* libfilaflat.xcframework */; };
|
||||
477A2A67D32B7A3AF2E7B2F4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EB0A767D257F3D05BE9F0960 /* LaunchScreen.storyboard */; };
|
||||
66014C413BCBF00E8E6DAF76 /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB3F32D8D3D7310FA3A0C1A1 /* libgeometry.xcframework */; };
|
||||
6A5D5E984CA862B943742745 /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DB3F32D8D3D7310FA3A0C1A1 /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6C8A7D49A8F689E20D60F4D4 /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ED51915983DAE97083D44EF /* libabseil.xcframework */; };
|
||||
7D8D3494388D7BF4D9FE4FCE /* libfilamat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4BDDF85AADA2069C0F9FBAE /* libfilamat.xcframework */; };
|
||||
7E671E777FDB5F34AAA13D5A /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C969D515221A7739C68F3AC /* libutils.xcframework */; };
|
||||
8095A6D37F6F1C9C13BBFEA8 /* libfilamat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C4BDDF85AADA2069C0F9FBAE /* libfilamat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
8402B2AC6D081D1E8E065552 /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8632D4625CFCBD32A46772B5 /* libbackend.xcframework */; };
|
||||
88C039F10343B8598FD5FF7F /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2A3753419FC4A7D4C039868 /* libfilabridge.xcframework */; };
|
||||
91CCBA3BA96DC289D0E8E975 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE6C78F32A0494087B0CEF32 /* main.mm */; };
|
||||
AA5AB498C5A6117057B06824 /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9E8375B927AFDFD1069016D1 /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
AE63AFEA7E7D507BB677C158 /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8632D4625CFCBD32A46772B5 /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
B3684DB18E82C867020294F1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FDB89AD408A508D6CB74C32 /* AppDelegate.m */; };
|
||||
BFE92829375EE1DBA1E4A689 /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B2A3753419FC4A7D4C039868 /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
C74DDEF71B6F3C060BB56189 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B63A6E45E40F58037ABD8F84 /* Main.storyboard */; };
|
||||
C8C8BF3416B9B37003F1031E /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 19CBBB6C426E8D038BDAC97B /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D0E54C592A378E549C96A54D /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D1E30700B368B5F84196FD97 /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D472EB54D462394FE99DCE2B /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E30700B368B5F84196FD97 /* libibl.xcframework */; };
|
||||
D5B2F0A85F7C6F352AA99DF1 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F108854ADC54BBAA29C2055 /* libsmol-v.xcframework */; };
|
||||
E090ED826EE54CA2EA611D83 /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4C3E6E0AB2BA7D686E424D8F /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
E6163776920A1643B1ED01FA /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C3E6E0AB2BA7D686E424D8F /* libzstd.xcframework */; };
|
||||
F5E844BFD77174F770543A87 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 912652335565C18B252345DE /* libfilament.xcframework */; };
|
||||
FB393C813D7A30404A2DEF23 /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19CBBB6C426E8D038BDAC97B /* libktxreader.xcframework */; };
|
||||
FC9D623AC5CF31BA9FB0C47B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 93394D7D4A78C56A2BD31A7D /* Assets.xcassets */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
0ABB76F2D4011A4AF5186FCA /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
32AC9F2183DD11F130D4A91D /* libfilament.xcframework in Embed Frameworks */,
|
||||
AE63AFEA7E7D507BB677C158 /* libbackend.xcframework in Embed Frameworks */,
|
||||
AA5AB498C5A6117057B06824 /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
C8C8BF3416B9B37003F1031E /* libktxreader.xcframework in Embed Frameworks */,
|
||||
BFE92829375EE1DBA1E4A689 /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
0DE5DD77BF1B9049D63B76D0 /* libutils.xcframework in Embed Frameworks */,
|
||||
2AABB2C1262EBA9553666078 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
6A5D5E984CA862B943742745 /* libgeometry.xcframework in Embed Frameworks */,
|
||||
D0E54C592A378E549C96A54D /* libibl.xcframework in Embed Frameworks */,
|
||||
305D6C983D22F7BC74FC76C7 /* libabseil.xcframework in Embed Frameworks */,
|
||||
E090ED826EE54CA2EA611D83 /* libzstd.xcframework in Embed Frameworks */,
|
||||
8095A6D37F6F1C9C13BBFEA8 /* libfilamat.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
056C16E7805E8D33D4C8F7B4 /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
0ED51915983DAE97083D44EF /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
13DDE7723EC1A6EFCA4D2D58 /* backend-test.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "backend-test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
17364ECD407006EEBDC06024 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
19CBBB6C426E8D038BDAC97B /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
276A0ADD5B521719BBB1DA21 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
33D80A4472074C601C57C773 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = "<group>"; };
|
||||
4C3E6E0AB2BA7D686E424D8F /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
5FDB89AD408A508D6CB74C32 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
603475CEE63507AA04A9B21A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
7C969D515221A7739C68F3AC /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
8632D4625CFCBD32A46772B5 /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
8F108854ADC54BBAA29C2055 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
912652335565C18B252345DE /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
93394D7D4A78C56A2BD31A7D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
9E8375B927AFDFD1069016D1 /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
A283B2D6DB365368855E2D7A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
AE6C78F32A0494087B0CEF32 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
|
||||
B2A3753419FC4A7D4C039868 /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
B54DFEB4DB6ACC0289FA3046 /* FilamentView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentView.mm; sourceTree = "<group>"; };
|
||||
C4BDDF85AADA2069C0F9FBAE /* libfilamat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilamat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilamat.xcframework"; sourceTree = "<group>"; };
|
||||
C76230D48038E8109EC121B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
D1E30700B368B5F84196FD97 /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
DB3F32D8D3D7310FA3A0C1A1 /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
5E31B50ED1338E6ADE1FA49A /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F5E844BFD77174F770543A87 /* libfilament.xcframework in Frameworks */,
|
||||
8402B2AC6D081D1E8E065552 /* libbackend.xcframework in Frameworks */,
|
||||
3D73E90782CC3A2124DF046F /* libfilaflat.xcframework in Frameworks */,
|
||||
FB393C813D7A30404A2DEF23 /* libktxreader.xcframework in Frameworks */,
|
||||
88C039F10343B8598FD5FF7F /* libfilabridge.xcframework in Frameworks */,
|
||||
7E671E777FDB5F34AAA13D5A /* libutils.xcframework in Frameworks */,
|
||||
D5B2F0A85F7C6F352AA99DF1 /* libsmol-v.xcframework in Frameworks */,
|
||||
66014C413BCBF00E8E6DAF76 /* libgeometry.xcframework in Frameworks */,
|
||||
D472EB54D462394FE99DCE2B /* libibl.xcframework in Frameworks */,
|
||||
6C8A7D49A8F689E20D60F4D4 /* libabseil.xcframework in Frameworks */,
|
||||
E6163776920A1643B1ED01FA /* libzstd.xcframework in Frameworks */,
|
||||
7D8D3494388D7BF4D9FE4FCE /* libfilamat.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
05CA69F10D830E40A8FB561D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -127,30 +44,10 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FE198F0E1EF047534F8F3128 /* backend-test */,
|
||||
81BF22C13654E58F622E6BEC /* Frameworks */,
|
||||
05CA69F10D830E40A8FB561D /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
81BF22C13654E58F622E6BEC /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0ED51915983DAE97083D44EF /* libabseil.xcframework */,
|
||||
8632D4625CFCBD32A46772B5 /* libbackend.xcframework */,
|
||||
B2A3753419FC4A7D4C039868 /* libfilabridge.xcframework */,
|
||||
9E8375B927AFDFD1069016D1 /* libfilaflat.xcframework */,
|
||||
C4BDDF85AADA2069C0F9FBAE /* libfilamat.xcframework */,
|
||||
912652335565C18B252345DE /* libfilament.xcframework */,
|
||||
DB3F32D8D3D7310FA3A0C1A1 /* libgeometry.xcframework */,
|
||||
D1E30700B368B5F84196FD97 /* libibl.xcframework */,
|
||||
19CBBB6C426E8D038BDAC97B /* libktxreader.xcframework */,
|
||||
8F108854ADC54BBAA29C2055 /* libsmol-v.xcframework */,
|
||||
7C969D515221A7739C68F3AC /* libutils.xcframework */,
|
||||
4C3E6E0AB2BA7D686E424D8F /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FE198F0E1EF047534F8F3128 /* backend-test */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -160,11 +57,11 @@
|
||||
056C16E7805E8D33D4C8F7B4 /* FilamentView.h */,
|
||||
B54DFEB4DB6ACC0289FA3046 /* FilamentView.mm */,
|
||||
A283B2D6DB365368855E2D7A /* Info.plist */,
|
||||
EB0A767D257F3D05BE9F0960 /* LaunchScreen.storyboard */,
|
||||
AE6C78F32A0494087B0CEF32 /* main.mm */,
|
||||
B63A6E45E40F58037ABD8F84 /* Main.storyboard */,
|
||||
276A0ADD5B521719BBB1DA21 /* ViewController.h */,
|
||||
33D80A4472074C601C57C773 /* ViewController.mm */,
|
||||
EB0A767D257F3D05BE9F0960 /* LaunchScreen.storyboard */,
|
||||
B63A6E45E40F58037ABD8F84 /* Main.storyboard */,
|
||||
);
|
||||
path = "backend-test";
|
||||
sourceTree = "<group>";
|
||||
@@ -178,8 +75,6 @@
|
||||
buildPhases = (
|
||||
445863ED54C294354A388281 /* Sources */,
|
||||
BD71575ED7ED3237FEFD94C7 /* Resources */,
|
||||
5E31B50ED1338E6ADE1FA49A /* Frameworks */,
|
||||
0ABB76F2D4011A4AF5186FCA /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -200,10 +95,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = E89E1EEA671E49DBAC9D5A9C /* Build configuration list for PBXProject "backend-test" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -212,8 +106,7 @@
|
||||
);
|
||||
mainGroup = 3D2B936C924E0DB70941EE6D;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = 05CA69F10D830E40A8FB561D /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -275,7 +168,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -331,17 +224,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "backend-test/Info.plist";
|
||||
@@ -350,8 +238,24 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load $(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/lib/$(CURRENT_ARCH)-$(PLATFORM_NAME)/libbackend_test.a",
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilamat",
|
||||
"-force_load ../../../out/ios-debug/filament/lib/arm64/libbackend_test.a",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.backend-test";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
@@ -366,7 +270,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -429,17 +333,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "backend-test/Info.plist";
|
||||
@@ -448,8 +347,24 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load $(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/lib/$(CURRENT_ARCH)-$(PLATFORM_NAME)/libbackend_test.a",
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilamat",
|
||||
"-force_load ../../../out/ios-debug/filament/lib/arm64/libbackend_test.a",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.backend-test";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
@@ -464,7 +379,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -520,17 +435,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "backend-test/Info.plist";
|
||||
@@ -539,8 +449,24 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load $(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/lib/$(CURRENT_ARCH)-$(PLATFORM_NAME)/libbackend_test.a",
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilamat",
|
||||
"-force_load ../../../out/ios-debug/filament/lib/arm64/libbackend_test.a",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.backend-test";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
@@ -556,17 +482,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "backend-test/Info.plist";
|
||||
@@ -575,8 +496,24 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load $(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/lib/$(CURRENT_ARCH)-$(PLATFORM_NAME)/libbackend_test.a",
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilamat",
|
||||
"-force_load ../../../out/ios-debug/filament/lib/arm64/libbackend_test.a",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.backend-test";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
@@ -591,7 +528,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
||||
@@ -6,10 +6,8 @@ targets:
|
||||
backend-test:
|
||||
templates:
|
||||
- FilamentApp
|
||||
dependencies:
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilamat.xcframework
|
||||
settings:
|
||||
base:
|
||||
# Because each test case is a separate file, the -force_load flag is necessary to prevent the
|
||||
# linker from removing "unused" symbols.
|
||||
OTHER_LDFLAGS: ["-force_load $(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/lib/$(CURRENT_ARCH)-$(PLATFORM_NAME)/libbackend_test.a"]
|
||||
OTHER_LDFLAGS: ["-lfilamat", "-force_load ../../../out/ios-debug/filament/lib/arm64/libbackend_test.a"]
|
||||
|
||||
@@ -10,7 +10,7 @@ set -e
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
|
||||
cmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
cmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
|
||||
# Ensure that the required tools are present in the out/ directory.
|
||||
# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.
|
||||
|
||||
@@ -3,178 +3,40 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
00101E55E74547D6C2FD8C03 /* default_env_ibl.ktx in Resources */ = {isa = PBXBuildFile; fileRef = A027015F6F283E92C379F0B1 /* default_env_ibl.ktx */; };
|
||||
0A6463A23D9E0C766EF24559 /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B9468E1B7FED7F00513152 /* libgeometry.xcframework */; };
|
||||
10A51B4DB601FEF9A6F1C0E3 /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61B9468E1B7FED7F00513152 /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
10EB5B0EBD334A09BFC3B9DF /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2FB034B2AD911A82D44F4E /* libibl.xcframework */; };
|
||||
1297B48507BF2849751AE0E6 /* FILViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B5A2C1598614ED63098A783 /* FILViewController.mm */; };
|
||||
1404696E6E1E5E4D265773B8 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C766C894259479FC62B7C8B4 /* libsmol-v.xcframework */; };
|
||||
14D3627324AE91F7B9C74745 /* libuberzlib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F7030A0C0BABAD05CDEAFDE8 /* libuberzlib.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
174327B08EFFA8255829FF49 /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFC9093A6EF27302A37326E /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1E42FEC5AE043BDDCE3CB0A4 /* libcamutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2B534EACCD70A2DA1623F743 /* libcamutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
22EBD00922E4FBAE5F20AF3B /* libviewer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52712E0BD50CA883190B6C1D /* libviewer.xcframework */; };
|
||||
285A74424AF5E3014363F8E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 14BA4B8B6A697847DA9934D2 /* Main.storyboard */; };
|
||||
2B0B9C8428D402D919CAC47E /* libimageio-lite.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60330C4B6F21AA47B5524999 /* libimageio-lite.xcframework */; };
|
||||
318A6749D6D4258385B67447 /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75EFC385D49A53E005466F45 /* libzstd.xcframework */; };
|
||||
36E0764917CB1EE729C6B771 /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CF656283054DABCE73A96F57 /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
379B9C62A9AB782FDBC0E16C /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BFA0007FC472C65083E2452 /* libabseil.xcframework */; };
|
||||
3CF14DE9557B15702D1CC5A9 /* libstb.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 487A93E37417074697C5AEE1 /* libstb.xcframework */; };
|
||||
4033B9273D8B4C4631200EC1 /* libimage.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F6D55F40189E2AD59138BFC /* libimage.xcframework */; };
|
||||
453F7CCB3A029F9604857C1C /* FILModelView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F16324F2F287CB27E1A84EB /* FILModelView.mm */; };
|
||||
45F28F70A616F4B5C67FEC66 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DF545E3F8FD553E334F5D6D6 /* Assets.xcassets */; };
|
||||
4C287DB6F93BD352927F003A /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6BFA0007FC472C65083E2452 /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4FE0C24C9B962C9F7439C9D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FF7EE9D5DD74F1A740C0D88 /* main.m */; };
|
||||
58EBAAC97B7EA63E102CDCDB /* BusterDrone in Resources */ = {isa = PBXBuildFile; fileRef = 7F78E613984102280C822052 /* BusterDrone */; };
|
||||
5C706EF98086B64B4CB3EF9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A0A866F9B1B8D315E88D3D12 /* AppDelegate.m */; };
|
||||
5FA818045C43856C7FFED3DB /* libcivetweb.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B41054C75146CF46900EB674 /* libcivetweb.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
60EB0B4391BB0FB171A4481D /* libmeshoptimizer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F696C8553E8CC1A6416678CB /* libmeshoptimizer.xcframework */; };
|
||||
698BA8E8638E7BD46D6BC337 /* libcamutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B534EACCD70A2DA1623F743 /* libcamutils.xcframework */; };
|
||||
700D3E15E852F06C5D8AD28B /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 515259657B354C8F37272D16 /* libfilament.xcframework */; };
|
||||
701EA9C2DFA93FC8D27E4831 /* libimage.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8F6D55F40189E2AD59138BFC /* libimage.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7922299F8548416D6E8504AB /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 020557AD44AE2D4F9D99EC33 /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7FB58BE1AF39FD8710F6903E /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 75EFC385D49A53E005466F45 /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
847436C12F9597E494EDD811 /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91CAACDECFDED76D0DBD8404 /* libutils.xcframework */; };
|
||||
872D52205E6A17C440CEFB8B /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFC9093A6EF27302A37326E /* libbackend.xcframework */; };
|
||||
8949CFB77397BDDBB71B155C /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF656283054DABCE73A96F57 /* libfilaflat.xcframework */; };
|
||||
8A03666082048B85BDE1C1CE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 21CA7296309BBFADBB0B00C3 /* LaunchScreen.storyboard */; };
|
||||
902D317731C0347ED896B7D2 /* libuberzlib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7030A0C0BABAD05CDEAFDE8 /* libuberzlib.xcframework */; };
|
||||
A5D1D0F914C22A76A15EF93E /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AF19593AAD6D35C6A9198C27 /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A6C04B690A802EBF133E23C4 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 515259657B354C8F37272D16 /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A7C7D42BDE57B77CB9D9C5D2 /* default_env_skybox.ktx in Resources */ = {isa = PBXBuildFile; fileRef = 5271315876D6BC61346DFD97 /* default_env_skybox.ktx */; };
|
||||
AB07A9DD1861F9233ADC5A9F /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2FB034B2AD911A82D44F4E /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
AE30134D543B24298D96BC03 /* libdracodec.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7A57517D52C2BDCA859338D1 /* libdracodec.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
AEDF1CEAF183E92426DA594A /* libmeshoptimizer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F696C8553E8CC1A6416678CB /* libmeshoptimizer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
AFAD827230601E60E38FA771 /* libstb.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 487A93E37417074697C5AEE1 /* libstb.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
B54C62933C17714E465A76A5 /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 91CAACDECFDED76D0DBD8404 /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
C0D8E3E2C38F674A23427224 /* libuberarchive.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25D5A93890B91F8C86BE2F0A /* libuberarchive.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
C427F6D58A977156565AE677 /* libcivetweb.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = B41054C75146CF46900EB674 /* libcivetweb.xcframework */; };
|
||||
C7A64F27B1A83023C1212E1C /* libdracodec.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A57517D52C2BDCA859338D1 /* libdracodec.xcframework */; };
|
||||
CB3A6143B788613B58BAB28A /* libgltfio_core.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B9B11A731D26A94397D4B9B /* libgltfio_core.xcframework */; };
|
||||
CDD73BDF196F559F671AE616 /* libbasis_transcoder.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4EDA245B8F43311DD75A1F81 /* libbasis_transcoder.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D3AE8B47D9F8509C8A875E39 /* libgltfio_core.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5B9B11A731D26A94397D4B9B /* libgltfio_core.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D89F33EFEDE5814BFA8D9892 /* libimageio-lite.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 60330C4B6F21AA47B5524999 /* libimageio-lite.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D93CA0A2E8A487D040934121 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C766C894259479FC62B7C8B4 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EFBDF01BC780CE2F40B83CE0 /* libbasis_transcoder.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EDA245B8F43311DD75A1F81 /* libbasis_transcoder.xcframework */; };
|
||||
F14C52ECDB8C27794AD54DB0 /* libuberarchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25D5A93890B91F8C86BE2F0A /* libuberarchive.xcframework */; };
|
||||
F5B36F9395DFC29EA677B406 /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF19593AAD6D35C6A9198C27 /* libktxreader.xcframework */; };
|
||||
F682DAD214D9F8E2DD36A110 /* libviewer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 52712E0BD50CA883190B6C1D /* libviewer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
FC3919370067F7747B9C4C53 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 020557AD44AE2D4F9D99EC33 /* libfilabridge.xcframework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
26182010104312BFB0BA3CE4 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
A6C04B690A802EBF133E23C4 /* libfilament.xcframework in Embed Frameworks */,
|
||||
174327B08EFFA8255829FF49 /* libbackend.xcframework in Embed Frameworks */,
|
||||
36E0764917CB1EE729C6B771 /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
A5D1D0F914C22A76A15EF93E /* libktxreader.xcframework in Embed Frameworks */,
|
||||
7922299F8548416D6E8504AB /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
B54C62933C17714E465A76A5 /* libutils.xcframework in Embed Frameworks */,
|
||||
D93CA0A2E8A487D040934121 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
10A51B4DB601FEF9A6F1C0E3 /* libgeometry.xcframework in Embed Frameworks */,
|
||||
AB07A9DD1861F9233ADC5A9F /* libibl.xcframework in Embed Frameworks */,
|
||||
4C287DB6F93BD352927F003A /* libabseil.xcframework in Embed Frameworks */,
|
||||
7FB58BE1AF39FD8710F6903E /* libzstd.xcframework in Embed Frameworks */,
|
||||
D3AE8B47D9F8509C8A875E39 /* libgltfio_core.xcframework in Embed Frameworks */,
|
||||
C0D8E3E2C38F674A23427224 /* libuberarchive.xcframework in Embed Frameworks */,
|
||||
701EA9C2DFA93FC8D27E4831 /* libimage.xcframework in Embed Frameworks */,
|
||||
AFAD827230601E60E38FA771 /* libstb.xcframework in Embed Frameworks */,
|
||||
CDD73BDF196F559F671AE616 /* libbasis_transcoder.xcframework in Embed Frameworks */,
|
||||
1E42FEC5AE043BDDCE3CB0A4 /* libcamutils.xcframework in Embed Frameworks */,
|
||||
AE30134D543B24298D96BC03 /* libdracodec.xcframework in Embed Frameworks */,
|
||||
AEDF1CEAF183E92426DA594A /* libmeshoptimizer.xcframework in Embed Frameworks */,
|
||||
F682DAD214D9F8E2DD36A110 /* libviewer.xcframework in Embed Frameworks */,
|
||||
5FA818045C43856C7FFED3DB /* libcivetweb.xcframework in Embed Frameworks */,
|
||||
14D3627324AE91F7B9C74745 /* libuberzlib.xcframework in Embed Frameworks */,
|
||||
D89F33EFEDE5814BFA8D9892 /* libimageio-lite.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
020557AD44AE2D4F9D99EC33 /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
03A535A718B2F64A70C5F231 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
1CFC9093A6EF27302A37326E /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
1ED9318FEC158171D99C0857 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
1F16324F2F287CB27E1A84EB /* FILModelView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FILModelView.mm; sourceTree = "<group>"; };
|
||||
1FF7EE9D5DD74F1A740C0D88 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
25D5A93890B91F8C86BE2F0A /* libuberarchive.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libuberarchive.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberarchive.xcframework"; sourceTree = "<group>"; };
|
||||
2B534EACCD70A2DA1623F743 /* libcamutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcamutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libcamutils.xcframework"; sourceTree = "<group>"; };
|
||||
2B973C3E0FE0EEED37D41D32 /* FILModelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FILModelView.h; sourceTree = "<group>"; };
|
||||
3B5A2C1598614ED63098A783 /* FILViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FILViewController.mm; sourceTree = "<group>"; };
|
||||
487A93E37417074697C5AEE1 /* libstb.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libstb.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libstb.xcframework"; sourceTree = "<group>"; };
|
||||
4D2FB034B2AD911A82D44F4E /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
4EDA245B8F43311DD75A1F81 /* libbasis_transcoder.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbasis_transcoder.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbasis_transcoder.xcframework"; sourceTree = "<group>"; };
|
||||
515259657B354C8F37272D16 /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
52712E0BD50CA883190B6C1D /* libviewer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libviewer.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libviewer.xcframework"; sourceTree = "<group>"; };
|
||||
5271315876D6BC61346DFD97 /* default_env_skybox.ktx */ = {isa = PBXFileReference; path = default_env_skybox.ktx; sourceTree = "<group>"; };
|
||||
5B9B11A731D26A94397D4B9B /* libgltfio_core.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgltfio_core.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgltfio_core.xcframework"; sourceTree = "<group>"; };
|
||||
60330C4B6F21AA47B5524999 /* libimageio-lite.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libimageio-lite.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimageio-lite.xcframework"; sourceTree = "<group>"; };
|
||||
61B9468E1B7FED7F00513152 /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
6BFA0007FC472C65083E2452 /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
6E6BB885F2B193E786CD9F14 /* FILViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FILViewController.h; sourceTree = "<group>"; };
|
||||
75EFC385D49A53E005466F45 /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
7A57517D52C2BDCA859338D1 /* libdracodec.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libdracodec.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libdracodec.xcframework"; sourceTree = "<group>"; };
|
||||
7F78E613984102280C822052 /* BusterDrone */ = {isa = PBXFileReference; lastKnownFileType = folder; name = BusterDrone; path = ../../../third_party/models/BusterDrone; sourceTree = SOURCE_ROOT; };
|
||||
8F6D55F40189E2AD59138BFC /* libimage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libimage.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework"; sourceTree = "<group>"; };
|
||||
91CAACDECFDED76D0DBD8404 /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
9ADEA6DE7305D0B8CCFFA53D /* gltf-viewer.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "gltf-viewer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A027015F6F283E92C379F0B1 /* default_env_ibl.ktx */ = {isa = PBXFileReference; path = default_env_ibl.ktx; sourceTree = "<group>"; };
|
||||
A0A866F9B1B8D315E88D3D12 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
AF19593AAD6D35C6A9198C27 /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
B41054C75146CF46900EB674 /* libcivetweb.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcivetweb.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libcivetweb.xcframework"; sourceTree = "<group>"; };
|
||||
B9C391BBD90EB54D27F8E4FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
C766C894259479FC62B7C8B4 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
C7ECAA95F4A55C69B948F806 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
CF656283054DABCE73A96F57 /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
DF545E3F8FD553E334F5D6D6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
F696C8553E8CC1A6416678CB /* libmeshoptimizer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libmeshoptimizer.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework"; sourceTree = "<group>"; };
|
||||
F7030A0C0BABAD05CDEAFDE8 /* libuberzlib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libuberzlib.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberzlib.xcframework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
E646271806112A138895CBE3 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
700D3E15E852F06C5D8AD28B /* libfilament.xcframework in Frameworks */,
|
||||
872D52205E6A17C440CEFB8B /* libbackend.xcframework in Frameworks */,
|
||||
8949CFB77397BDDBB71B155C /* libfilaflat.xcframework in Frameworks */,
|
||||
F5B36F9395DFC29EA677B406 /* libktxreader.xcframework in Frameworks */,
|
||||
FC3919370067F7747B9C4C53 /* libfilabridge.xcframework in Frameworks */,
|
||||
847436C12F9597E494EDD811 /* libutils.xcframework in Frameworks */,
|
||||
1404696E6E1E5E4D265773B8 /* libsmol-v.xcframework in Frameworks */,
|
||||
0A6463A23D9E0C766EF24559 /* libgeometry.xcframework in Frameworks */,
|
||||
10EB5B0EBD334A09BFC3B9DF /* libibl.xcframework in Frameworks */,
|
||||
379B9C62A9AB782FDBC0E16C /* libabseil.xcframework in Frameworks */,
|
||||
318A6749D6D4258385B67447 /* libzstd.xcframework in Frameworks */,
|
||||
CB3A6143B788613B58BAB28A /* libgltfio_core.xcframework in Frameworks */,
|
||||
F14C52ECDB8C27794AD54DB0 /* libuberarchive.xcframework in Frameworks */,
|
||||
4033B9273D8B4C4631200EC1 /* libimage.xcframework in Frameworks */,
|
||||
3CF14DE9557B15702D1CC5A9 /* libstb.xcframework in Frameworks */,
|
||||
EFBDF01BC780CE2F40B83CE0 /* libbasis_transcoder.xcframework in Frameworks */,
|
||||
698BA8E8638E7BD46D6BC337 /* libcamutils.xcframework in Frameworks */,
|
||||
C7A64F27B1A83023C1212E1C /* libdracodec.xcframework in Frameworks */,
|
||||
60EB0B4391BB0FB171A4481D /* libmeshoptimizer.xcframework in Frameworks */,
|
||||
22EBD00922E4FBAE5F20AF3B /* libviewer.xcframework in Frameworks */,
|
||||
C427F6D58A977156565AE677 /* libcivetweb.xcframework in Frameworks */,
|
||||
902D317731C0347ED896B7D2 /* libuberzlib.xcframework in Frameworks */,
|
||||
2B0B9C8428D402D919CAC47E /* libimageio-lite.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2678CEA2FDBFE6D6DC1D4D71 /* gltf-viewer */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -203,8 +65,8 @@
|
||||
children = (
|
||||
DF545E3F8FD553E334F5D6D6 /* Assets.xcassets */,
|
||||
B9C391BBD90EB54D27F8E4FD /* Info.plist */,
|
||||
1FF7EE9D5DD74F1A740C0D88 /* main.m */,
|
||||
21CA7296309BBFADBB0B00C3 /* LaunchScreen.storyboard */,
|
||||
1FF7EE9D5DD74F1A740C0D88 /* main.m */,
|
||||
14BA4B8B6A697847DA9934D2 /* Main.storyboard */,
|
||||
);
|
||||
path = SupportFiles;
|
||||
@@ -216,41 +78,10 @@
|
||||
7F78E613984102280C822052 /* BusterDrone */,
|
||||
E102A6C527928715EF7B0497 /* default_env */,
|
||||
2678CEA2FDBFE6D6DC1D4D71 /* gltf-viewer */,
|
||||
8826A1E62E0B87AA4A9982D5 /* Frameworks */,
|
||||
3BFD6EBD6D97D6F1C40F1C90 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8826A1E62E0B87AA4A9982D5 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6BFA0007FC472C65083E2452 /* libabseil.xcframework */,
|
||||
1CFC9093A6EF27302A37326E /* libbackend.xcframework */,
|
||||
4EDA245B8F43311DD75A1F81 /* libbasis_transcoder.xcframework */,
|
||||
2B534EACCD70A2DA1623F743 /* libcamutils.xcframework */,
|
||||
B41054C75146CF46900EB674 /* libcivetweb.xcframework */,
|
||||
7A57517D52C2BDCA859338D1 /* libdracodec.xcframework */,
|
||||
020557AD44AE2D4F9D99EC33 /* libfilabridge.xcframework */,
|
||||
CF656283054DABCE73A96F57 /* libfilaflat.xcframework */,
|
||||
515259657B354C8F37272D16 /* libfilament.xcframework */,
|
||||
61B9468E1B7FED7F00513152 /* libgeometry.xcframework */,
|
||||
5B9B11A731D26A94397D4B9B /* libgltfio_core.xcframework */,
|
||||
4D2FB034B2AD911A82D44F4E /* libibl.xcframework */,
|
||||
8F6D55F40189E2AD59138BFC /* libimage.xcframework */,
|
||||
60330C4B6F21AA47B5524999 /* libimageio-lite.xcframework */,
|
||||
AF19593AAD6D35C6A9198C27 /* libktxreader.xcframework */,
|
||||
F696C8553E8CC1A6416678CB /* libmeshoptimizer.xcframework */,
|
||||
C766C894259479FC62B7C8B4 /* libsmol-v.xcframework */,
|
||||
487A93E37417074697C5AEE1 /* libstb.xcframework */,
|
||||
25D5A93890B91F8C86BE2F0A /* libuberarchive.xcframework */,
|
||||
F7030A0C0BABAD05CDEAFDE8 /* libuberzlib.xcframework */,
|
||||
91CAACDECFDED76D0DBD8404 /* libutils.xcframework */,
|
||||
52712E0BD50CA883190B6C1D /* libviewer.xcframework */,
|
||||
75EFC385D49A53E005466F45 /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E102A6C527928715EF7B0497 /* default_env */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -271,8 +102,6 @@
|
||||
0B375996CE4EBC4A5B258C27 /* Build Resources */,
|
||||
C8F38C978C83CD5335A21F72 /* Sources */,
|
||||
7D3B1B99EEAFB6F53ECBAA5A /* Resources */,
|
||||
E646271806112A138895CBE3 /* Frameworks */,
|
||||
26182010104312BFB0BA3CE4 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -293,10 +122,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 90327DE42AE5DF12C4BD2113 /* Build configuration list for PBXProject "gltf-viewer" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -305,8 +133,7 @@
|
||||
);
|
||||
mainGroup = 7DB4500696DB13904CDF40C4;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = 3BFD6EBD6D97D6F1C40F1C90 /* Products */;
|
||||
preferredProjectObjectVersion = 56;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -340,7 +167,7 @@
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
../../../third_party/environments/lightroom_14b.hdr,
|
||||
"$(SRCROOT)/../../../third_party/environments/lightroom_14b.hdr",
|
||||
);
|
||||
name = "Build Resources";
|
||||
outputFileListPaths = (
|
||||
@@ -351,7 +178,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The gltf-viewer app requires two resources:\n# 1. The IBL image\n# 2. The skybox image\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\ncmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/default_env\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/lightroom_14b.hdr\"\n";
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The gltf-viewer app requires two resources:\n# 1. The IBL image\n# 2. The skybox image\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\ncmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/default_env\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/lightroom_14b.hdr\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -395,7 +222,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -457,7 +284,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -512,7 +339,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -568,17 +395,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "gltf-viewer/SupportFiles/Info.plist";
|
||||
@@ -587,6 +409,36 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-lstb",
|
||||
"-lbasis_transcoder",
|
||||
"-lzstd",
|
||||
"-lcamutils",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lviewer",
|
||||
"-lcivetweb",
|
||||
"-luberzlib",
|
||||
"-limageio-lite",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.gltf-viewer";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -601,17 +453,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "gltf-viewer/SupportFiles/Info.plist";
|
||||
@@ -620,6 +467,36 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-lstb",
|
||||
"-lbasis_transcoder",
|
||||
"-lzstd",
|
||||
"-lcamutils",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lviewer",
|
||||
"-lcivetweb",
|
||||
"-luberzlib",
|
||||
"-limageio-lite",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.gltf-viewer";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -633,7 +510,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -696,17 +573,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "gltf-viewer/SupportFiles/Info.plist";
|
||||
@@ -715,6 +587,36 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-lstb",
|
||||
"-lbasis_transcoder",
|
||||
"-lzstd",
|
||||
"-lcamutils",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lviewer",
|
||||
"-lcivetweb",
|
||||
"-luberzlib",
|
||||
"-limageio-lite",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.gltf-viewer";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -729,17 +631,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "gltf-viewer/SupportFiles/Info.plist";
|
||||
@@ -748,6 +645,36 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-lstb",
|
||||
"-lbasis_transcoder",
|
||||
"-lzstd",
|
||||
"-lcamutils",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lviewer",
|
||||
"-lcivetweb",
|
||||
"-luberzlib",
|
||||
"-limageio-lite",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.gltf-viewer";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
|
||||
@@ -17,24 +17,16 @@ targets:
|
||||
optional: true
|
||||
templates:
|
||||
- FilamentApp
|
||||
dependencies:
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgltfio_core.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberarchive.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libstb.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbasis_transcoder.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libcamutils.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libdracodec.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libviewer.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libcivetweb.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberzlib.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimageio-lite.xcframework
|
||||
settings:
|
||||
base:
|
||||
OTHER_LDFLAGS: ["-lgltfio_core", "-luberarchive", "-limage", "-lstb", "-lbasis_transcoder",
|
||||
"-lzstd", "-lcamutils", "-ldracodec", "-lmeshoptimizer", "-lviewer", "-lcivetweb",
|
||||
"-luberzlib", "-limageio-lite"]
|
||||
preBuildScripts:
|
||||
- path: build-resources.sh
|
||||
name: Build Resources
|
||||
inputFiles:
|
||||
- ../../../third_party/environments/lightroom_14b.hdr
|
||||
- $(SRCROOT)/../../../third_party/environments/lightroom_14b.hdr
|
||||
outputFiles:
|
||||
- $(SRCROOT)/generated/default_env/default_env_ibl.ktx
|
||||
- $(SRCROOT)/generated/default_env/default_env_skybox.ktx
|
||||
|
||||
@@ -14,10 +14,10 @@ set -e
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
|
||||
filamesh_path=`find -L ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`
|
||||
matc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
resgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
filamesh_path=`find ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`
|
||||
matc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
resgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
|
||||
# Ensure that the required tools are present in the out/ directory.
|
||||
# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.
|
||||
|
||||
@@ -3,113 +3,44 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
01DEF0C8AAF14D275D5E731B /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D3D6EFC9EE7349AC9F4F845A /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
0704BBFECEFCE6618E4A67F7 /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 67D8E02D1AF661E4EF7CC2CD /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
072B1333A85F99F6FBA10846 /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E238CF2D5E37556427C00675 /* libzstd.xcframework */; };
|
||||
091D995885B1312DA4322F31 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0DE88103BBBE542FC5D46B1 /* libsmol-v.xcframework */; };
|
||||
11DE997161B2D3272247EE72 /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9E445414106E7103104FC16C /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1EFC9E499E3733CF230DAECB /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DB899E40418A88883E6ED2E4 /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
2956D56161744254E2FFD353 /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D6EFC9EE7349AC9F4F845A /* libgeometry.xcframework */; };
|
||||
2B4ED44D08F36953D3D111CF /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9D99ABAB340140BF94D57B3 /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4FAC85567A730FCCB7B3B6EC /* FilamentApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF21F54926F34F027F4FCEA4 /* FilamentApp.cpp */; };
|
||||
50F0F62A949F9DB17E1E102D /* libmeshoptimizer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1720B9D4D55AB6B8513B0 /* libmeshoptimizer.xcframework */; };
|
||||
5432120E716355C4A519ABC6 /* FilamentArViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA47852B486CBD549FA68729 /* FilamentArViewController.mm */; };
|
||||
5FEA2EC1B8A6FECCACA5FAFA /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 644F36437FC03CCC25AC6EFC /* libutils.xcframework */; };
|
||||
66754FE8EF26B5335C0CC9FF /* FullScreenTriangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05D9AFA7CFC6498FE2A8C6A5 /* FullScreenTriangle.cpp */; };
|
||||
6D2DAB291A29345E5179ECD8 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 87261693EC970989615C5AE7 /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6DF5D6B097AC3C124C576DD1 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67D8E02D1AF661E4EF7CC2CD /* libfilabridge.xcframework */; };
|
||||
819CEF9004BAA1BD59EB3ADE /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8E5A38F197D487277FDED20 /* libktxreader.xcframework */; };
|
||||
84AC34B44E1AEE96BA8C53B0 /* libimage.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 586F9BE85A436EBA56181848 /* libimage.xcframework */; };
|
||||
85C9CA885D3E9BA87AEA24E8 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0DE88103BBBE542FC5D46B1 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
89E16D259F951AA787C3B265 /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 644F36437FC03CCC25AC6EFC /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
9718E9B12B1D353DF9E66311 /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6422176EDC22262D20C51A8 /* libibl.xcframework */; };
|
||||
99BD70EFF08A1419FE539A44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE684A73135705C4EDAA7C53 /* Assets.xcassets */; };
|
||||
ACF87F0F3989EF583E90E499 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B92BD0FA8E6F9CFEAE1707 /* main.m */; };
|
||||
AE4035E76423745AFC8CEB58 /* libfilameshio.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 16ED3BF9A0D7194CECB86D55 /* libfilameshio.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
AEEFE325E8BDB00E30FDEC93 /* Resources.S in Sources */ = {isa = PBXBuildFile; fileRef = DD0010D60097DEAA82DAA089 /* Resources.S */; };
|
||||
B28ED2F81785F13E0B9A3607 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC652AC3D2C91759215320C3 /* AppDelegate.m */; };
|
||||
B48D41A39CF5F4FDE5CF6770 /* libfilameshio.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16ED3BF9A0D7194CECB86D55 /* libfilameshio.xcframework */; };
|
||||
B604AB5F246840D2CCF4762B /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D99ABAB340140BF94D57B3 /* libfilaflat.xcframework */; };
|
||||
B8934FC46557424E705A2154 /* ARKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33B2CBA1A0F654632B39A45D /* ARKit.framework */; };
|
||||
BC6AAB72CD468EF04F684014 /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB899E40418A88883E6ED2E4 /* libabseil.xcframework */; };
|
||||
CB7C1B8F335B873B77D15934 /* libmeshoptimizer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1720B9D4D55AB6B8513B0 /* libmeshoptimizer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CBBBF68C2F58FF0F4FA81008 /* libimage.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 586F9BE85A436EBA56181848 /* libimage.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CE6AB7B76D5EB580EFD90897 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AFCB91D87494B7FC879A7A5E /* Main.storyboard */; };
|
||||
CFCD1B57C3CDFA2AC3525EF6 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87261693EC970989615C5AE7 /* libfilament.xcframework */; };
|
||||
D56834764BC4D127736878DF /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E445414106E7103104FC16C /* libbackend.xcframework */; };
|
||||
DD6C337BAEC527FA0F5DB4A3 /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D6422176EDC22262D20C51A8 /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
DEF78081F52F6A776242A599 /* FilamentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D025A0625708CC50AEA0DB /* FilamentView.m */; };
|
||||
E4C06B048BFA075CD9FB73AD /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A8E5A38F197D487277FDED20 /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
E92B00016D52070448DA66F6 /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E238CF2D5E37556427C00675 /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
F933D6701B0A0E90381E8030 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C88A8BDFC06D144D80EC052B /* LaunchScreen.storyboard */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
AA70CE1AA47836D72F588764 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
6D2DAB291A29345E5179ECD8 /* libfilament.xcframework in Embed Frameworks */,
|
||||
11DE997161B2D3272247EE72 /* libbackend.xcframework in Embed Frameworks */,
|
||||
2B4ED44D08F36953D3D111CF /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
E4C06B048BFA075CD9FB73AD /* libktxreader.xcframework in Embed Frameworks */,
|
||||
0704BBFECEFCE6618E4A67F7 /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
89E16D259F951AA787C3B265 /* libutils.xcframework in Embed Frameworks */,
|
||||
85C9CA885D3E9BA87AEA24E8 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
01DEF0C8AAF14D275D5E731B /* libgeometry.xcframework in Embed Frameworks */,
|
||||
DD6C337BAEC527FA0F5DB4A3 /* libibl.xcframework in Embed Frameworks */,
|
||||
1EFC9E499E3733CF230DAECB /* libabseil.xcframework in Embed Frameworks */,
|
||||
E92B00016D52070448DA66F6 /* libzstd.xcframework in Embed Frameworks */,
|
||||
AE4035E76423745AFC8CEB58 /* libfilameshio.xcframework in Embed Frameworks */,
|
||||
CB7C1B8F335B873B77D15934 /* libmeshoptimizer.xcframework in Embed Frameworks */,
|
||||
CBBBF68C2F58FF0F4FA81008 /* libimage.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
05D9AFA7CFC6498FE2A8C6A5 /* FullScreenTriangle.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FullScreenTriangle.cpp; sourceTree = "<group>"; };
|
||||
16ED3BF9A0D7194CECB86D55 /* libfilameshio.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilameshio.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilameshio.xcframework"; sourceTree = "<group>"; };
|
||||
2AFEFBF6FE91628599F70817 /* clear_coat.mat */ = {isa = PBXFileReference; path = clear_coat.mat; sourceTree = "<group>"; };
|
||||
2AFF66F1228C5F1079042FE2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
33B2CBA1A0F654632B39A45D /* ARKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ARKit.framework; path = System/Library/Frameworks/ARKit.framework; sourceTree = SDKROOT; };
|
||||
4CA1720B9D4D55AB6B8513B0 /* libmeshoptimizer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libmeshoptimizer.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework"; sourceTree = "<group>"; };
|
||||
4F8E6B508F8C5DE284DA2E34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
53D025A0625708CC50AEA0DB /* FilamentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FilamentView.m; sourceTree = "<group>"; };
|
||||
586F9BE85A436EBA56181848 /* libimage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libimage.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework"; sourceTree = "<group>"; };
|
||||
5B5D3E611DCDD9CD2C13B825 /* FilamentApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentApp.h; sourceTree = "<group>"; };
|
||||
644F36437FC03CCC25AC6EFC /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
67D8E02D1AF661E4EF7CC2CD /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
6938BE21CFB8BEB2422BD490 /* FilamentArViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentArViewController.h; sourceTree = "<group>"; };
|
||||
7C5E322BA97EEB4FB7EC030F /* camera_feed.mat */ = {isa = PBXFileReference; path = camera_feed.mat; sourceTree = "<group>"; };
|
||||
87261693EC970989615C5AE7 /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
8832D93E678057F9940A226D /* shadow_plane.mat */ = {isa = PBXFileReference; path = shadow_plane.mat; sourceTree = "<group>"; };
|
||||
973EB840E804440B2AA0F93A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
9E445414106E7103104FC16C /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
A85B9D53F72DEE0374F8EBDF /* FullScreenTriangle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FullScreenTriangle.h; sourceTree = "<group>"; };
|
||||
A8E5A38F197D487277FDED20 /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
AA47852B486CBD549FA68729 /* FilamentArViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentArViewController.mm; sourceTree = "<group>"; };
|
||||
AE684A73135705C4EDAA7C53 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
AF451D7D0FAAD069F916F51C /* MathHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MathHelpers.h; sourceTree = "<group>"; };
|
||||
B6B92BD0FA8E6F9CFEAE1707 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
C9D99ABAB340140BF94D57B3 /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
CF21F54926F34F027F4FCEA4 /* FilamentApp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FilamentApp.cpp; sourceTree = "<group>"; };
|
||||
D0800F9FE0C390D084082637 /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
D0DE88103BBBE542FC5D46B1 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
D3D6EFC9EE7349AC9F4F845A /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
D6422176EDC22262D20C51A8 /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
D7BA0AA38645722DCFA3490D /* hello-ar.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "hello-ar.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DB899E40418A88883E6ED2E4 /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
DD0010D60097DEAA82DAA089 /* Resources.S */ = {isa = PBXFileReference; path = Resources.S; sourceTree = "<group>"; };
|
||||
E238CF2D5E37556427C00675 /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
EC652AC3D2C91759215320C3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
FCF16FE1B4146DE87F2B76F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -119,21 +50,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CFCD1B57C3CDFA2AC3525EF6 /* libfilament.xcframework in Frameworks */,
|
||||
D56834764BC4D127736878DF /* libbackend.xcframework in Frameworks */,
|
||||
B604AB5F246840D2CCF4762B /* libfilaflat.xcframework in Frameworks */,
|
||||
819CEF9004BAA1BD59EB3ADE /* libktxreader.xcframework in Frameworks */,
|
||||
6DF5D6B097AC3C124C576DD1 /* libfilabridge.xcframework in Frameworks */,
|
||||
5FEA2EC1B8A6FECCACA5FAFA /* libutils.xcframework in Frameworks */,
|
||||
091D995885B1312DA4322F31 /* libsmol-v.xcframework in Frameworks */,
|
||||
2956D56161744254E2FFD353 /* libgeometry.xcframework in Frameworks */,
|
||||
9718E9B12B1D353DF9E66311 /* libibl.xcframework in Frameworks */,
|
||||
BC6AAB72CD468EF04F684014 /* libabseil.xcframework in Frameworks */,
|
||||
072B1333A85F99F6FBA10846 /* libzstd.xcframework in Frameworks */,
|
||||
B8934FC46557424E705A2154 /* ARKit.framework in Frameworks */,
|
||||
B48D41A39CF5F4FDE5CF6770 /* libfilameshio.xcframework in Frameworks */,
|
||||
50F0F62A949F9DB17E1E102D /* libmeshoptimizer.xcframework in Frameworks */,
|
||||
84AC34B44E1AEE96BA8C53B0 /* libimage.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -175,20 +92,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33B2CBA1A0F654632B39A45D /* ARKit.framework */,
|
||||
DB899E40418A88883E6ED2E4 /* libabseil.xcframework */,
|
||||
9E445414106E7103104FC16C /* libbackend.xcframework */,
|
||||
67D8E02D1AF661E4EF7CC2CD /* libfilabridge.xcframework */,
|
||||
C9D99ABAB340140BF94D57B3 /* libfilaflat.xcframework */,
|
||||
87261693EC970989615C5AE7 /* libfilament.xcframework */,
|
||||
16ED3BF9A0D7194CECB86D55 /* libfilameshio.xcframework */,
|
||||
D3D6EFC9EE7349AC9F4F845A /* libgeometry.xcframework */,
|
||||
D6422176EDC22262D20C51A8 /* libibl.xcframework */,
|
||||
586F9BE85A436EBA56181848 /* libimage.xcframework */,
|
||||
A8E5A38F197D487277FDED20 /* libktxreader.xcframework */,
|
||||
4CA1720B9D4D55AB6B8513B0 /* libmeshoptimizer.xcframework */,
|
||||
D0DE88103BBBE542FC5D46B1 /* libsmol-v.xcframework */,
|
||||
644F36437FC03CCC25AC6EFC /* libutils.xcframework */,
|
||||
E238CF2D5E37556427C00675 /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -198,10 +101,10 @@
|
||||
children = (
|
||||
AE684A73135705C4EDAA7C53 /* Assets.xcassets */,
|
||||
FCF16FE1B4146DE87F2B76F3 /* Info.plist */,
|
||||
B6B92BD0FA8E6F9CFEAE1707 /* main.m */,
|
||||
DD0010D60097DEAA82DAA089 /* Resources.S */,
|
||||
C88A8BDFC06D144D80EC052B /* LaunchScreen.storyboard */,
|
||||
B6B92BD0FA8E6F9CFEAE1707 /* main.m */,
|
||||
AFCB91D87494B7FC879A7A5E /* Main.storyboard */,
|
||||
DD0010D60097DEAA82DAA089 /* Resources.S */,
|
||||
);
|
||||
path = SupportFiles;
|
||||
sourceTree = "<group>";
|
||||
@@ -241,7 +144,6 @@
|
||||
A5598850636B6208AE64E95E /* Sources */,
|
||||
77189A28CB88A4753728F549 /* Resources */,
|
||||
FA9CC5F2D3E84FB632557A2E /* Frameworks */,
|
||||
AA70CE1AA47836D72F588764 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -262,10 +164,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 281E763643B2F1F3B903864B /* Build configuration list for PBXProject "hello-ar" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -274,8 +175,7 @@
|
||||
);
|
||||
mainGroup = 316A56C698744769908E6F88;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = E2EC9706948EC07E74121EF1 /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -314,7 +214,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-ar app requires four resources:\n# 1. The cube mesh\n# 2. The Filament material definition\n# 3. The Filament camera feed material definition\n# 4. The Filament shadow plane material definition\n# 5. The IBL image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nfilamesh_path=`find -L ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`\nmatc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\nresgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${filamesh_path}\" ]]; then\n echo \"No filamesh binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# The filamesh tool converts the .obj file into a Filament-specific filamesh file that has been\n# optimized for loading into Filament.\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${filamesh_path}\" \\\n \"${PROJECT_DIR}/../../../assets/models/rounded_cube/rounded_cube.obj\" \\\n \"${PROJECT_DIR}/generated/cube.filamesh\"\n\n# The matc tool compiles the clear_coat.mat, shadow_plane.mat, and camera_feed.mat materials into\n# Filament material BLOBs.\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/Materials/clear_coat.mat\"\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/shadow_plane.filamat\" \\\n \"${PROJECT_DIR}/Materials/shadow_plane.mat\"\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/camera_feed.filamat\" \\\n \"${PROJECT_DIR}/Materials/camera_feed.mat\"\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/cube.filamesh\" \\\n \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/generated/shadow_plane.filamat\" \\\n \"${PROJECT_DIR}/generated/camera_feed.filamat\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\"\n\n# FilamentApp.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-ar/FilamentArView/FullScreenTriangle.cpp\"\ntouch \"${PROJECT_DIR}/hello-ar/FilamentArView/FilamentApp.cpp\"\ntouch \"${PROJECT_DIR}/hello-ar/SupportFiles/Resources.S\"\n";
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-ar app requires four resources:\n# 1. The cube mesh\n# 2. The Filament material definition\n# 3. The Filament camera feed material definition\n# 4. The Filament shadow plane material definition\n# 5. The IBL image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nfilamesh_path=`find ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`\nmatc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\nresgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${filamesh_path}\" ]]; then\n echo \"No filamesh binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# The filamesh tool converts the .obj file into a Filament-specific filamesh file that has been\n# optimized for loading into Filament.\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${filamesh_path}\" \\\n \"${PROJECT_DIR}/../../../assets/models/rounded_cube/rounded_cube.obj\" \\\n \"${PROJECT_DIR}/generated/cube.filamesh\"\n\n# The matc tool compiles the clear_coat.mat, shadow_plane.mat, and camera_feed.mat materials into\n# Filament material BLOBs.\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/Materials/clear_coat.mat\"\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/shadow_plane.filamat\" \\\n \"${PROJECT_DIR}/Materials/shadow_plane.mat\"\n\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/camera_feed.filamat\" \\\n \"${PROJECT_DIR}/Materials/camera_feed.mat\"\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/cube.filamesh\" \\\n \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/generated/shadow_plane.filamat\" \\\n \"${PROJECT_DIR}/generated/camera_feed.filamat\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\"\n\n# FilamentApp.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-ar/FilamentArView/FullScreenTriangle.cpp\"\ntouch \"${PROJECT_DIR}/hello-ar/FilamentArView/FilamentApp.cpp\"\ntouch \"${PROJECT_DIR}/hello-ar/SupportFiles/Resources.S\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -362,17 +262,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-ar/SupportFiles/Info.plist";
|
||||
@@ -381,6 +276,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-ar";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -395,17 +310,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-ar/SupportFiles/Info.plist";
|
||||
@@ -414,6 +324,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-ar";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -427,7 +357,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -490,17 +420,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-ar/SupportFiles/Info.plist";
|
||||
@@ -509,6 +434,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-ar";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -522,7 +467,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -584,7 +529,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -640,17 +585,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-ar/SupportFiles/Info.plist";
|
||||
@@ -659,6 +599,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-ar";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -672,7 +632,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
||||
@@ -8,9 +8,9 @@ targets:
|
||||
- FilamentApp
|
||||
dependencies:
|
||||
- sdk: ARKit.framework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilameshio.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework
|
||||
settings:
|
||||
base:
|
||||
OTHER_LDFLAGS: ["-lfilameshio", "-lmeshoptimizer", "-limage"]
|
||||
preBuildScripts:
|
||||
- path: build-resources.sh
|
||||
name: Build Resources
|
||||
|
||||
@@ -11,8 +11,8 @@ set -e
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
|
||||
resgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
resgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
|
||||
# Ensure that the required tools are present in the out/ directory.
|
||||
# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.
|
||||
|
||||
@@ -3,162 +3,44 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0023225ED0F6344A42FDF021 /* libbasis_transcoder.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 18129A9C5FC10A170625F0DF /* libbasis_transcoder.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
032FA0177E5B258A6EFC10FB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F8FDA2F8F0B257A1364E302 /* Assets.xcassets */; };
|
||||
0C4676263C3C6F429DE8E1E7 /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABE8F592F84AD947269C79F /* libabseil.xcframework */; };
|
||||
12FA790CDCF4048A3B3D816B /* libuberzlib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AE9C8F3B16EEC02C00FC462 /* libuberzlib.xcframework */; };
|
||||
153DF9C7D86AB76EDBEB3AC4 /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6E2AD103B6A164CA10779A2C /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1A4585E6153963D89D838344 /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51E07CB7D191EE70C8393733 /* libutils.xcframework */; };
|
||||
2101923AA53D391D871C0BCF /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 51E07CB7D191EE70C8393733 /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
272268CA1B14AE98DFACDD33 /* libstb.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A40EBFD944F94426FBCEDB82 /* libstb.xcframework */; };
|
||||
3153490EB02DE914E6C7B16B /* libimage.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 481A41C1DE19D71E21CA17C0 /* libimage.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
3370EF2CC0CD0D08F69CC581 /* libmeshoptimizer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9B29DDB1D323E259E5EDBE4 /* libmeshoptimizer.xcframework */; };
|
||||
357279930C4271E22C329E27 /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A955859FB96A0B4AA15C36D /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
372DC481D060CF95FDFA9DD7 /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 190D6FD76C902A52E8C71DF7 /* libzstd.xcframework */; };
|
||||
3DA39FBD408D7B6F50822939 /* FilamentViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4544E7FD3EC9BC5C5E4487B7 /* FilamentViewController.mm */; };
|
||||
415CBC815DE6A370EE6DD502 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9CD116AEF8BD291A123F2A /* libfilament.xcframework */; };
|
||||
41E74598143C17C5C2037D67 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9CD116AEF8BD291A123F2A /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4474017EFFC53567F2369DB8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FEA341C442B210CFD35E4663 /* LaunchScreen.storyboard */; };
|
||||
4F555B8114838AF666F39CD1 /* App.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3AF77884F45974610F79F92F /* App.cpp */; };
|
||||
53C4CFCFC54929CEDE416EC5 /* libstb.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A40EBFD944F94426FBCEDB82 /* libstb.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6057DA6A016889B23EE6410F /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6842BC9C9A130CE658B642CB /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6535EDC4F6D3BBCA745C453F /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E33DC0C95B9B0260504E357 /* libsmol-v.xcframework */; };
|
||||
6D84A7C1AA03C171F01A044D /* libgltfio_core.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 06B530A8294DD5CBAD41DB51 /* libgltfio_core.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6DFCBA84E571F0C5B1683640 /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A955859FB96A0B4AA15C36D /* libbackend.xcframework */; };
|
||||
7BFDB88EAFC7B8CE0B571A35 /* libdracodec.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CC1A326E7C2E54A8F3227045 /* libdracodec.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7FD7B7E760C10ACDA64F0890 /* libuberarchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BEC8295652B68CF0854F861 /* libuberarchive.xcframework */; };
|
||||
8309D337274D6920F81FDFED /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8947E0E5B74BA8785FE2158D /* libfilaflat.xcframework */; };
|
||||
872251D9846351641FFE1EDB /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83035F42A448BDA20C5EC0DB /* libibl.xcframework */; };
|
||||
872990CD06765549CBE6EB85 /* libbasis_transcoder.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18129A9C5FC10A170625F0DF /* libbasis_transcoder.xcframework */; };
|
||||
899A92E0F0148A9BAE3E7B1A /* Resources.S in Sources */ = {isa = PBXBuildFile; fileRef = B1B470F3CDEE0D4A60B11C72 /* Resources.S */; };
|
||||
8D82323C866A8429A29903A8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F534BD31E8FB84B3925B0402 /* AppDelegate.m */; };
|
||||
916F7A5DE5031D7523FB1FA1 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5E33DC0C95B9B0260504E357 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A38DF6C8EA6292F62E9D5F68 /* libimage.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 481A41C1DE19D71E21CA17C0 /* libimage.xcframework */; };
|
||||
A8004A31F0068178EF0557DA /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6842BC9C9A130CE658B642CB /* libgeometry.xcframework */; };
|
||||
ABF42D2B7081EB39CEC1B43B /* libgltfio_core.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06B530A8294DD5CBAD41DB51 /* libgltfio_core.xcframework */; };
|
||||
ADE1F0D02BA65C77C6B109AB /* FilamentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D7269DBC8441140F7F8905 /* FilamentView.m */; };
|
||||
B69E7A38F3A58F7DB4002219 /* libdracodec.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC1A326E7C2E54A8F3227045 /* libdracodec.xcframework */; };
|
||||
B766A23145C9D58BB09CB068 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 47B161015D23D464253ABAF1 /* main.m */; };
|
||||
B9E63A561CEE77D5D0D29A0E /* libuberarchive.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0BEC8295652B68CF0854F861 /* libuberarchive.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
BFD25191C0BF9804FF3C1B19 /* DamagedHelmet.glb in Resources */ = {isa = PBXBuildFile; fileRef = B299B19218E1CF7B2D13ABB8 /* DamagedHelmet.glb */; };
|
||||
C609C4B4BD4082A399517524 /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9555C4935AFD98E079719C07 /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CE0DC84646DB51D505E521E9 /* libuberzlib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8AE9C8F3B16EEC02C00FC462 /* libuberzlib.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CFADC7EF16411309B0CF08D8 /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 190D6FD76C902A52E8C71DF7 /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D1174ECF9CDDC1EA7DE95840 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59032D070D1641AA60F6CC2D /* Main.storyboard */; };
|
||||
DB90B94FBBD5F819ED9D1685 /* CameraManipulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6238AED51F5F46CCFBE6892D /* CameraManipulator.cpp */; };
|
||||
DC96354994E844E3730CBEB7 /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83035F42A448BDA20C5EC0DB /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
E9C1BC8EC1312B0CCEF66A2F /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABE8F592F84AD947269C79F /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
F4022ECAAC6BEA543556B428 /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E2AD103B6A164CA10779A2C /* libktxreader.xcframework */; };
|
||||
FB7DB6BC4ADAEA3F02731E73 /* libmeshoptimizer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F9B29DDB1D323E259E5EDBE4 /* libmeshoptimizer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
FBC7DAEE0262EB58EC6BADC9 /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8947E0E5B74BA8785FE2158D /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
FD9CF0E054C901D1D3E7D6B2 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9555C4935AFD98E079719C07 /* libfilabridge.xcframework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
D5C4D57398FACAA29F2C2549 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
41E74598143C17C5C2037D67 /* libfilament.xcframework in Embed Frameworks */,
|
||||
357279930C4271E22C329E27 /* libbackend.xcframework in Embed Frameworks */,
|
||||
FBC7DAEE0262EB58EC6BADC9 /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
153DF9C7D86AB76EDBEB3AC4 /* libktxreader.xcframework in Embed Frameworks */,
|
||||
C609C4B4BD4082A399517524 /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
2101923AA53D391D871C0BCF /* libutils.xcframework in Embed Frameworks */,
|
||||
916F7A5DE5031D7523FB1FA1 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
6057DA6A016889B23EE6410F /* libgeometry.xcframework in Embed Frameworks */,
|
||||
DC96354994E844E3730CBEB7 /* libibl.xcframework in Embed Frameworks */,
|
||||
E9C1BC8EC1312B0CCEF66A2F /* libabseil.xcframework in Embed Frameworks */,
|
||||
CFADC7EF16411309B0CF08D8 /* libzstd.xcframework in Embed Frameworks */,
|
||||
6D84A7C1AA03C171F01A044D /* libgltfio_core.xcframework in Embed Frameworks */,
|
||||
B9E63A561CEE77D5D0D29A0E /* libuberarchive.xcframework in Embed Frameworks */,
|
||||
3153490EB02DE914E6C7B16B /* libimage.xcframework in Embed Frameworks */,
|
||||
7BFDB88EAFC7B8CE0B571A35 /* libdracodec.xcframework in Embed Frameworks */,
|
||||
FB7DB6BC4ADAEA3F02731E73 /* libmeshoptimizer.xcframework in Embed Frameworks */,
|
||||
0023225ED0F6344A42FDF021 /* libbasis_transcoder.xcframework in Embed Frameworks */,
|
||||
53C4CFCFC54929CEDE416EC5 /* libstb.xcframework in Embed Frameworks */,
|
||||
CE0DC84646DB51D505E521E9 /* libuberzlib.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
06B530A8294DD5CBAD41DB51 /* libgltfio_core.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgltfio_core.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgltfio_core.xcframework"; sourceTree = "<group>"; };
|
||||
07D735319AF2DC69DB8981FE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
0AF0F63216DE40C526ABFABF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
0BEC8295652B68CF0854F861 /* libuberarchive.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libuberarchive.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberarchive.xcframework"; sourceTree = "<group>"; };
|
||||
18129A9C5FC10A170625F0DF /* libbasis_transcoder.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbasis_transcoder.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbasis_transcoder.xcframework"; sourceTree = "<group>"; };
|
||||
190D6FD76C902A52E8C71DF7 /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
2ABE8F592F84AD947269C79F /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
31A71C869E24044EA5F802D5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
3259514676E5E799670D0F86 /* CameraManipulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CameraManipulator.h; sourceTree = "<group>"; };
|
||||
3AF77884F45974610F79F92F /* App.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = App.cpp; sourceTree = "<group>"; };
|
||||
3F8FDA2F8F0B257A1364E302 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
4544E7FD3EC9BC5C5E4487B7 /* FilamentViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentViewController.mm; sourceTree = "<group>"; };
|
||||
47B161015D23D464253ABAF1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
481A41C1DE19D71E21CA17C0 /* libimage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libimage.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework"; sourceTree = "<group>"; };
|
||||
4A955859FB96A0B4AA15C36D /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
4B9CD116AEF8BD291A123F2A /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
51E07CB7D191EE70C8393733 /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
5E33DC0C95B9B0260504E357 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
6238AED51F5F46CCFBE6892D /* CameraManipulator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CameraManipulator.cpp; sourceTree = "<group>"; };
|
||||
6842BC9C9A130CE658B642CB /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
6E2AD103B6A164CA10779A2C /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
83035F42A448BDA20C5EC0DB /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
84D7269DBC8441140F7F8905 /* FilamentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FilamentView.m; sourceTree = "<group>"; };
|
||||
8947E0E5B74BA8785FE2158D /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
8AE9C8F3B16EEC02C00FC462 /* libuberzlib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libuberzlib.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberzlib.xcframework"; sourceTree = "<group>"; };
|
||||
9555C4935AFD98E079719C07 /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
A37B936423E3B1BF1CA137E0 /* hello-gltf.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "hello-gltf.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A40EBFD944F94426FBCEDB82 /* libstb.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libstb.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libstb.xcframework"; sourceTree = "<group>"; };
|
||||
A52D063A6C24A885D52E2F79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
B1B470F3CDEE0D4A60B11C72 /* Resources.S */ = {isa = PBXFileReference; path = Resources.S; sourceTree = "<group>"; };
|
||||
B299B19218E1CF7B2D13ABB8 /* DamagedHelmet.glb */ = {isa = PBXFileReference; path = DamagedHelmet.glb; sourceTree = "<group>"; };
|
||||
BAEAC7786B3EA7E47855A56B /* FilamentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentViewController.h; sourceTree = "<group>"; };
|
||||
CC1A326E7C2E54A8F3227045 /* libdracodec.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libdracodec.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libdracodec.xcframework"; sourceTree = "<group>"; };
|
||||
D3A6F9906B0647549CF53196 /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
EC3FAC405D5790391F3AE4FB /* App.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = App.h; sourceTree = "<group>"; };
|
||||
F534BD31E8FB84B3925B0402 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
F9B29DDB1D323E259E5EDBE4 /* libmeshoptimizer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libmeshoptimizer.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
0F4486CC8242411EE5C50136 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
415CBC815DE6A370EE6DD502 /* libfilament.xcframework in Frameworks */,
|
||||
6DFCBA84E571F0C5B1683640 /* libbackend.xcframework in Frameworks */,
|
||||
8309D337274D6920F81FDFED /* libfilaflat.xcframework in Frameworks */,
|
||||
F4022ECAAC6BEA543556B428 /* libktxreader.xcframework in Frameworks */,
|
||||
FD9CF0E054C901D1D3E7D6B2 /* libfilabridge.xcframework in Frameworks */,
|
||||
1A4585E6153963D89D838344 /* libutils.xcframework in Frameworks */,
|
||||
6535EDC4F6D3BBCA745C453F /* libsmol-v.xcframework in Frameworks */,
|
||||
A8004A31F0068178EF0557DA /* libgeometry.xcframework in Frameworks */,
|
||||
872251D9846351641FFE1EDB /* libibl.xcframework in Frameworks */,
|
||||
0C4676263C3C6F429DE8E1E7 /* libabseil.xcframework in Frameworks */,
|
||||
372DC481D060CF95FDFA9DD7 /* libzstd.xcframework in Frameworks */,
|
||||
ABF42D2B7081EB39CEC1B43B /* libgltfio_core.xcframework in Frameworks */,
|
||||
7FD7B7E760C10ACDA64F0890 /* libuberarchive.xcframework in Frameworks */,
|
||||
A38DF6C8EA6292F62E9D5F68 /* libimage.xcframework in Frameworks */,
|
||||
B69E7A38F3A58F7DB4002219 /* libdracodec.xcframework in Frameworks */,
|
||||
3370EF2CC0CD0D08F69CC581 /* libmeshoptimizer.xcframework in Frameworks */,
|
||||
872990CD06765549CBE6EB85 /* libbasis_transcoder.xcframework in Frameworks */,
|
||||
272268CA1B14AE98DFACDD33 /* libstb.xcframework in Frameworks */,
|
||||
12FA790CDCF4048A3B3D816B /* libuberzlib.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
213197BBE06FB8316C6A730F /* DamagedHelmet */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -174,7 +56,6 @@
|
||||
children = (
|
||||
213197BBE06FB8316C6A730F /* DamagedHelmet */,
|
||||
A57096EADC8A05A97A275513 /* hello-gltf */,
|
||||
F6A35BB32F71E5F5DC464FCC /* Frameworks */,
|
||||
E24AFBD404D0689AD84371D6 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -197,10 +78,10 @@
|
||||
children = (
|
||||
3F8FDA2F8F0B257A1364E302 /* Assets.xcassets */,
|
||||
A52D063A6C24A885D52E2F79 /* Info.plist */,
|
||||
47B161015D23D464253ABAF1 /* main.m */,
|
||||
B1B470F3CDEE0D4A60B11C72 /* Resources.S */,
|
||||
FEA341C442B210CFD35E4663 /* LaunchScreen.storyboard */,
|
||||
47B161015D23D464253ABAF1 /* main.m */,
|
||||
59032D070D1641AA60F6CC2D /* Main.storyboard */,
|
||||
B1B470F3CDEE0D4A60B11C72 /* Resources.S */,
|
||||
);
|
||||
path = SupportFiles;
|
||||
sourceTree = "<group>";
|
||||
@@ -226,32 +107,6 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F6A35BB32F71E5F5DC464FCC /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2ABE8F592F84AD947269C79F /* libabseil.xcframework */,
|
||||
4A955859FB96A0B4AA15C36D /* libbackend.xcframework */,
|
||||
18129A9C5FC10A170625F0DF /* libbasis_transcoder.xcframework */,
|
||||
CC1A326E7C2E54A8F3227045 /* libdracodec.xcframework */,
|
||||
9555C4935AFD98E079719C07 /* libfilabridge.xcframework */,
|
||||
8947E0E5B74BA8785FE2158D /* libfilaflat.xcframework */,
|
||||
4B9CD116AEF8BD291A123F2A /* libfilament.xcframework */,
|
||||
6842BC9C9A130CE658B642CB /* libgeometry.xcframework */,
|
||||
06B530A8294DD5CBAD41DB51 /* libgltfio_core.xcframework */,
|
||||
83035F42A448BDA20C5EC0DB /* libibl.xcframework */,
|
||||
481A41C1DE19D71E21CA17C0 /* libimage.xcframework */,
|
||||
6E2AD103B6A164CA10779A2C /* libktxreader.xcframework */,
|
||||
F9B29DDB1D323E259E5EDBE4 /* libmeshoptimizer.xcframework */,
|
||||
5E33DC0C95B9B0260504E357 /* libsmol-v.xcframework */,
|
||||
A40EBFD944F94426FBCEDB82 /* libstb.xcframework */,
|
||||
0BEC8295652B68CF0854F861 /* libuberarchive.xcframework */,
|
||||
8AE9C8F3B16EEC02C00FC462 /* libuberzlib.xcframework */,
|
||||
51E07CB7D191EE70C8393733 /* libutils.xcframework */,
|
||||
190D6FD76C902A52E8C71DF7 /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -262,8 +117,6 @@
|
||||
434C630C7F01B07ABD7545B4 /* Build Resources */,
|
||||
30FFFB72D409D092136A7E09 /* Sources */,
|
||||
143100B2FF97ACD9B03A078A /* Resources */,
|
||||
0F4486CC8242411EE5C50136 /* Frameworks */,
|
||||
D5C4D57398FACAA29F2C2549 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -284,10 +137,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = C7514DDCFDA3C5F803E239F9 /* Build configuration list for PBXProject "hello-gltf" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -296,8 +148,7 @@
|
||||
);
|
||||
mainGroup = 74FBC1573C79190CC198A030;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = E24AFBD404D0689AD84371D6 /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -337,7 +188,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-gltf app requires two resources:\n# 1. The IBL image\n# 2. The skybox image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nresgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_skybox.ktx\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\"\n\n# App.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-gltf/FilamentView/App.cpp\"\ntouch \"${PROJECT_DIR}/hello-gltf/SupportFiles/Resources.S\"\n";
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-gltf app requires two resources:\n# 1. The IBL image\n# 2. The skybox image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nresgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_skybox.ktx\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\"\n\n# App.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-gltf/FilamentView/App.cpp\"\ntouch \"${PROJECT_DIR}/hello-gltf/SupportFiles/Resources.S\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -384,7 +235,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -447,17 +298,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-gltf/SupportFiles/Info.plist";
|
||||
@@ -466,6 +312,32 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lbasis_transcoder",
|
||||
"-lstb",
|
||||
"-lzstd",
|
||||
"-luberzlib",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-gltf";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -480,17 +352,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-gltf/SupportFiles/Info.plist";
|
||||
@@ -499,6 +366,32 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lbasis_transcoder",
|
||||
"-lstb",
|
||||
"-lzstd",
|
||||
"-luberzlib",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-gltf";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -512,7 +405,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -574,7 +467,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -629,7 +522,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -685,17 +578,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-gltf/SupportFiles/Info.plist";
|
||||
@@ -704,6 +592,32 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lbasis_transcoder",
|
||||
"-lstb",
|
||||
"-lzstd",
|
||||
"-luberzlib",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-gltf";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -718,17 +632,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-gltf/SupportFiles/Info.plist";
|
||||
@@ -737,6 +646,32 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lgltfio_core",
|
||||
"-luberarchive",
|
||||
"-limage",
|
||||
"-ldracodec",
|
||||
"-lmeshoptimizer",
|
||||
"-lbasis_transcoder",
|
||||
"-lstb",
|
||||
"-lzstd",
|
||||
"-luberzlib",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-gltf";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
|
||||
@@ -10,15 +10,10 @@ targets:
|
||||
buildPhase: resources
|
||||
templates:
|
||||
- FilamentApp
|
||||
dependencies:
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgltfio_core.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberarchive.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libdracodec.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbasis_transcoder.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libstb.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libuberzlib.xcframework
|
||||
settings:
|
||||
base:
|
||||
OTHER_LDFLAGS: ["-lgltfio_core", "-luberarchive", "-limage", "-ldracodec", "-lmeshoptimizer",
|
||||
"-lbasis_transcoder", "-lstb", "-lzstd", "-luberzlib"]
|
||||
preBuildScripts:
|
||||
- path: build-resources.sh
|
||||
name: Build Resources
|
||||
|
||||
@@ -13,10 +13,10 @@ set -e
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
|
||||
filamesh_path=`find -L ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`
|
||||
matc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
resgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
filamesh_path=`find ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`
|
||||
matc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
resgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`
|
||||
cmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`
|
||||
|
||||
# Ensure that the required tools are present in the out/ directory.
|
||||
# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.
|
||||
|
||||
@@ -3,136 +3,43 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
06156526AD22EF2AD34A6E63 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A17327655C031D575A522AD1 /* main.m */; };
|
||||
0B2B31A41B31D3D9592809BE /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A1DC71CABF5B4C9A99EA62D8 /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1F86261681826B617D56A65A /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9FD2FF109F8EDD63D2DAB37 /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
253D85057959A92D9C3FF638 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE951DB3A83CC5BD589751BC /* libfilabridge.xcframework */; };
|
||||
29861FFCDF2A0BCF3C5C35E2 /* libmeshoptimizer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6BBA4C3095CCF35600F500B8 /* libmeshoptimizer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
3386B37A2A36AAE2D1A7EEA3 /* libfilameshio.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3DAD80BE7693C1D70E06675 /* libfilameshio.xcframework */; };
|
||||
3CE3011F1556DF145D8D5641 /* libfilameshio.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3DAD80BE7693C1D70E06675 /* libfilameshio.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
3D7229A87468A795596F67E5 /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9FD2FF109F8EDD63D2DAB37 /* libutils.xcframework */; };
|
||||
3F24E10B5F119498FEC839BD /* libimage.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB7CEED84501DA291C801893 /* libimage.xcframework */; };
|
||||
47C387BD3672FED21E46A5CB /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 37522F0B15C029FD4127180C /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4E2366C19FC594E529713AFD /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C379E4CC0D2A41B53A494804 /* libgeometry.xcframework */; };
|
||||
4E4E761A4D37F2479672E9CB /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37522F0B15C029FD4127180C /* libibl.xcframework */; };
|
||||
4F76C2B304B91E3396FB9BE0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43FDC2D4E6776749006FF5E8 /* Main.storyboard */; };
|
||||
5507E62B8924EAD813F76A12 /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D2E61F2554690ADAD89442FA /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
612E11B0F5513B4426B753E3 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 35C7020A906FD87045CA9188 /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
774BE86075C3087EE3E973F2 /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1DC71CABF5B4C9A99EA62D8 /* libzstd.xcframework */; };
|
||||
7C7FE778A73B60FEF2A3E87B /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 503D2F0E98B22FD99D9C4B32 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7FADC9D9565BFFBE23EE2B19 /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3FC6071B5A7CDAE7AC8F9F6A /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
80797782FC992AB6AC57F689 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503D2F0E98B22FD99D9C4B32 /* libsmol-v.xcframework */; };
|
||||
909A5210FF76323C0162AC03 /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE479671EAC6847969DCCA35 /* libbackend.xcframework */; };
|
||||
9ADC886BBE230370776B1CF3 /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2E61F2554690ADAD89442FA /* libktxreader.xcframework */; };
|
||||
9F723250641BA99F8DAFEDFB /* libimage.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB7CEED84501DA291C801893 /* libimage.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
9FB8B786881C0C4C0CFBC55D /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FC6071B5A7CDAE7AC8F9F6A /* libabseil.xcframework */; };
|
||||
A702E1AB94B19F53E55A946B /* CameraManipulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D57C53C47A84D05D23B65278 /* CameraManipulator.cpp */; };
|
||||
B127450573BCB07E794547F3 /* FilamentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 42B9073CE652C53E7F0A4602 /* FilamentView.mm */; };
|
||||
BD8BEB81AFF4F10D2CC14D3D /* libmeshoptimizer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BBA4C3095CCF35600F500B8 /* libmeshoptimizer.xcframework */; };
|
||||
CD584D8F302B74996AB93340 /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4939E8DA8B4093E147961B /* libfilaflat.xcframework */; };
|
||||
CEA57549E5C487794BD5351D /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C379E4CC0D2A41B53A494804 /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D15F2C7D58D8FC89CE6116E1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1CAE8879115ECEC53FA0F052 /* Assets.xcassets */; };
|
||||
D66BEC047A004E63BD105F94 /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA4939E8DA8B4093E147961B /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D760F404EE39FF9CA3DB15EF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45C71AD43B55E58E07243647 /* LaunchScreen.storyboard */; };
|
||||
DD28C38B1BA7DC985D18010F /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE479671EAC6847969DCCA35 /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
E6438E524A7CA8B4ADCD6BB8 /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE951DB3A83CC5BD589751BC /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
F036B4FF12A2B4005547C01F /* FilamentApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F01D34676A81F3F367B9F6AF /* FilamentApp.cpp */; };
|
||||
F7A5CF35639D0528CCD03908 /* Resources.S in Sources */ = {isa = PBXBuildFile; fileRef = AC02B019CB36611A7BCE5773 /* Resources.S */; };
|
||||
FAF09598FE02F9B10459EB34 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C7020A906FD87045CA9188 /* libfilament.xcframework */; };
|
||||
FCEE5B4DF0074DCD841DFF12 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DACB12BFCAAA3222E7D1E9BB /* ViewController.m */; };
|
||||
FEA410A98CE28689BEF2251F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FE9A0CE98FB055F3478E1CC /* AppDelegate.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
8E3DFDFC69EBD646F294582B /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
612E11B0F5513B4426B753E3 /* libfilament.xcframework in Embed Frameworks */,
|
||||
DD28C38B1BA7DC985D18010F /* libbackend.xcframework in Embed Frameworks */,
|
||||
D66BEC047A004E63BD105F94 /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
5507E62B8924EAD813F76A12 /* libktxreader.xcframework in Embed Frameworks */,
|
||||
E6438E524A7CA8B4ADCD6BB8 /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
1F86261681826B617D56A65A /* libutils.xcframework in Embed Frameworks */,
|
||||
7C7FE778A73B60FEF2A3E87B /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
CEA57549E5C487794BD5351D /* libgeometry.xcframework in Embed Frameworks */,
|
||||
47C387BD3672FED21E46A5CB /* libibl.xcframework in Embed Frameworks */,
|
||||
7FADC9D9565BFFBE23EE2B19 /* libabseil.xcframework in Embed Frameworks */,
|
||||
0B2B31A41B31D3D9592809BE /* libzstd.xcframework in Embed Frameworks */,
|
||||
3CE3011F1556DF145D8D5641 /* libfilameshio.xcframework in Embed Frameworks */,
|
||||
29861FFCDF2A0BCF3C5C35E2 /* libmeshoptimizer.xcframework in Embed Frameworks */,
|
||||
9F723250641BA99F8DAFEDFB /* libimage.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
17ADA23252FA61486B05D5BA /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
1CAE8879115ECEC53FA0F052 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
35C7020A906FD87045CA9188 /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
37522F0B15C029FD4127180C /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
37CB2FCA6711AE57BD4B39F7 /* hello-pbr.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "hello-pbr.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3FC6071B5A7CDAE7AC8F9F6A /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
42B9073CE652C53E7F0A4602 /* FilamentView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentView.mm; sourceTree = "<group>"; };
|
||||
4618C7511DE661F89B114734 /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
503D2F0E98B22FD99D9C4B32 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
6BBA4C3095CCF35600F500B8 /* libmeshoptimizer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libmeshoptimizer.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework"; sourceTree = "<group>"; };
|
||||
7D60AE7BAB964978FAA0C84C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
7FE9A0CE98FB055F3478E1CC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
A17327655C031D575A522AD1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
A1DC71CABF5B4C9A99EA62D8 /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
A3680F594905261290AEDB79 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
A9FD2FF109F8EDD63D2DAB37 /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
AC02B019CB36611A7BCE5773 /* Resources.S */ = {isa = PBXFileReference; path = Resources.S; sourceTree = "<group>"; };
|
||||
ADF252527D202BB9D53E29C8 /* clear_coat.mat */ = {isa = PBXFileReference; path = clear_coat.mat; sourceTree = "<group>"; };
|
||||
B35CDFC5B6E5142B5E57BE33 /* FilamentApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentApp.h; sourceTree = "<group>"; };
|
||||
B3DAD80BE7693C1D70E06675 /* libfilameshio.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilameshio.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilameshio.xcframework"; sourceTree = "<group>"; };
|
||||
C379E4CC0D2A41B53A494804 /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
CE479671EAC6847969DCCA35 /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
CE951DB3A83CC5BD589751BC /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
D2E61F2554690ADAD89442FA /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
D57C53C47A84D05D23B65278 /* CameraManipulator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CameraManipulator.cpp; sourceTree = "<group>"; };
|
||||
DA4939E8DA8B4093E147961B /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
DACB12BFCAAA3222E7D1E9BB /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
E176563EAAB0B36EFA7D67FD /* CameraManipulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CameraManipulator.h; sourceTree = "<group>"; };
|
||||
EC2A85E8863E17F68089B198 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
ED2321CED4601521B7D1D849 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
F01D34676A81F3F367B9F6AF /* FilamentApp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FilamentApp.cpp; sourceTree = "<group>"; };
|
||||
FB7CEED84501DA291C801893 /* libimage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libimage.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
464CABCAA933FAA2A5568882 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FAF09598FE02F9B10459EB34 /* libfilament.xcframework in Frameworks */,
|
||||
909A5210FF76323C0162AC03 /* libbackend.xcframework in Frameworks */,
|
||||
CD584D8F302B74996AB93340 /* libfilaflat.xcframework in Frameworks */,
|
||||
9ADC886BBE230370776B1CF3 /* libktxreader.xcframework in Frameworks */,
|
||||
253D85057959A92D9C3FF638 /* libfilabridge.xcframework in Frameworks */,
|
||||
3D7229A87468A795596F67E5 /* libutils.xcframework in Frameworks */,
|
||||
80797782FC992AB6AC57F689 /* libsmol-v.xcframework in Frameworks */,
|
||||
4E2366C19FC594E529713AFD /* libgeometry.xcframework in Frameworks */,
|
||||
4E4E761A4D37F2479672E9CB /* libibl.xcframework in Frameworks */,
|
||||
9FB8B786881C0C4C0CFBC55D /* libabseil.xcframework in Frameworks */,
|
||||
774BE86075C3087EE3E973F2 /* libzstd.xcframework in Frameworks */,
|
||||
3386B37A2A36AAE2D1A7EEA3 /* libfilameshio.xcframework in Frameworks */,
|
||||
BD8BEB81AFF4F10D2CC14D3D /* libmeshoptimizer.xcframework in Frameworks */,
|
||||
3F24E10B5F119498FEC839BD /* libimage.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
4A44033C70281A0FC58A64FE /* hello-pbr */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -147,43 +54,21 @@
|
||||
4618C7511DE661F89B114734 /* FilamentView.h */,
|
||||
42B9073CE652C53E7F0A4602 /* FilamentView.mm */,
|
||||
EC2A85E8863E17F68089B198 /* Info.plist */,
|
||||
45C71AD43B55E58E07243647 /* LaunchScreen.storyboard */,
|
||||
A17327655C031D575A522AD1 /* main.m */,
|
||||
43FDC2D4E6776749006FF5E8 /* Main.storyboard */,
|
||||
AC02B019CB36611A7BCE5773 /* Resources.S */,
|
||||
17ADA23252FA61486B05D5BA /* ViewController.h */,
|
||||
DACB12BFCAAA3222E7D1E9BB /* ViewController.m */,
|
||||
45C71AD43B55E58E07243647 /* LaunchScreen.storyboard */,
|
||||
43FDC2D4E6776749006FF5E8 /* Main.storyboard */,
|
||||
);
|
||||
path = "hello-pbr";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6CD8748D8B4DAD182A726DC0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3FC6071B5A7CDAE7AC8F9F6A /* libabseil.xcframework */,
|
||||
CE479671EAC6847969DCCA35 /* libbackend.xcframework */,
|
||||
CE951DB3A83CC5BD589751BC /* libfilabridge.xcframework */,
|
||||
DA4939E8DA8B4093E147961B /* libfilaflat.xcframework */,
|
||||
35C7020A906FD87045CA9188 /* libfilament.xcframework */,
|
||||
B3DAD80BE7693C1D70E06675 /* libfilameshio.xcframework */,
|
||||
C379E4CC0D2A41B53A494804 /* libgeometry.xcframework */,
|
||||
37522F0B15C029FD4127180C /* libibl.xcframework */,
|
||||
FB7CEED84501DA291C801893 /* libimage.xcframework */,
|
||||
D2E61F2554690ADAD89442FA /* libktxreader.xcframework */,
|
||||
6BBA4C3095CCF35600F500B8 /* libmeshoptimizer.xcframework */,
|
||||
503D2F0E98B22FD99D9C4B32 /* libsmol-v.xcframework */,
|
||||
A9FD2FF109F8EDD63D2DAB37 /* libutils.xcframework */,
|
||||
A1DC71CABF5B4C9A99EA62D8 /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8B171658B4A1227B9CA44459 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4A44033C70281A0FC58A64FE /* hello-pbr */,
|
||||
D92946BE29B34E951A7E0714 /* Materials */,
|
||||
6CD8748D8B4DAD182A726DC0 /* Frameworks */,
|
||||
A90A4582D4144797492F5C08 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -214,8 +99,6 @@
|
||||
18BC4E25ED5FC66EC7B77F97 /* Build Resources */,
|
||||
4EAE126B59B0A66AD866406A /* Sources */,
|
||||
4C132EE193B59194A5C7572B /* Resources */,
|
||||
464CABCAA933FAA2A5568882 /* Frameworks */,
|
||||
8E3DFDFC69EBD646F294582B /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -236,10 +119,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 0479354FB8D9A411347D91A6 /* Build configuration list for PBXProject "hello-pbr" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -248,8 +130,7 @@
|
||||
);
|
||||
mainGroup = 8B171658B4A1227B9CA44459;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = A90A4582D4144797492F5C08 /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -288,7 +169,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-pbr app requires four resources:\n# 1. The material sphere mesh\n# 2. The Filament material definition\n# 3. The IBL image\n# 4. The skybox image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nfilamesh_path=`find -L ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`\nmatc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\nresgen_path=`find -L ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find -L ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${filamesh_path}\" ]]; then\n echo \"No filamesh binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# The filamesh tool converts the .obj file into a Filament-specific filamesh file that has been\n# optimized for loading into Filament.\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${filamesh_path}\" \\\n \"${PROJECT_DIR}/../../../assets/models/material_sphere/material_sphere.obj\" \\\n \"${PROJECT_DIR}/generated/material_sphere.filamesh\"\n\n# The matc tool compiles the clear_coat.mat material into a Filament material BLOB.\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/Materials/clear_coat.mat\"\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/material_sphere.filamesh\" \\\n \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_skybox.ktx\"\n\n# FilamentApp.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-pbr/FilamentApp.cpp\"\ntouch \"${PROJECT_DIR}/hello-pbr/Resources.S\"\n";
|
||||
shellScript = "#/usr/bin/env/bash\n\nset -e\n\n# Compile resources.\n\n# The hello-pbr app requires four resources:\n# 1. The material sphere mesh\n# 2. The Filament material definition\n# 3. The IBL image\n# 4. The skybox image\n# These will be compiled into the final binary via the resgen tool.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\n\nfilamesh_path=`find ${HOST_TOOLS_PATH} -name filamesh -type f | head -n 1`\nmatc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\nresgen_path=`find ${HOST_TOOLS_PATH} -name resgen -type f | head -n 1`\ncmgen_path=`find ${HOST_TOOLS_PATH} -name cmgen -type f | head -n 1`\n\n# Ensure that the required tools are present in the out/ directory.\n# These can be built by running ./build.sh -p desktop -i release at Filament's root directory.\n\nif [[ ! -e \"${filamesh_path}\" ]]; then\n echo \"No filamesh binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${resgen_path}\" ]]; then\n echo \"No resgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nif [[ ! -e \"${cmgen_path}\" ]]; then\n echo \"No cmgen binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\n# The filamesh tool converts the .obj file into a Filament-specific filamesh file that has been\n# optimized for loading into Filament.\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${filamesh_path}\" \\\n \"${PROJECT_DIR}/../../../assets/models/material_sphere/material_sphere.obj\" \\\n \"${PROJECT_DIR}/generated/material_sphere.filamesh\"\n\n# The matc tool compiles the clear_coat.mat material into a Filament material BLOB.\n\"${matc_path}\" \\\n --api all \\\n --platform mobile \\\n -o \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/Materials/clear_coat.mat\"\n\n# cmgen consumes an HDR environment map and generates two mipmapped KTX files (IBL and skybox)\n\"${cmgen_path}\" \\\n --quiet \\\n --deploy=\"${PROJECT_DIR}/generated/venetian_crossroads_2k\" \\\n --format=ktx --size=256 --extract-blur=0.1 \\\n \"${PROJECT_DIR}/../../../third_party/environments/venetian_crossroads_2k.hdr\"\n\n# The resgen tool generates an assembly file, resources.apple.S that gets compiled and linked\n# into the final binary. It contains all the resources consumed by the app.\n\"${resgen_path}\" \\\n --deploy=\"${PROJECT_DIR}/generated\" \\\n \"${PROJECT_DIR}/generated/material_sphere.filamesh\" \\\n \"${PROJECT_DIR}/generated/clear_coat.filamat\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_ibl.ktx\" \\\n \"${PROJECT_DIR}/generated/venetian_crossroads_2k/venetian_crossroads_2k_skybox.ktx\"\n\n# FilamentApp.cpp and Resources.S include files generated by resgen.\n# Touch them to force Xcode to recompile.\ntouch \"${PROJECT_DIR}/hello-pbr/FilamentApp.cpp\"\ntouch \"${PROJECT_DIR}/hello-pbr/Resources.S\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -335,7 +216,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -398,17 +279,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-pbr/Info.plist";
|
||||
@@ -417,6 +293,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-pbr";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -431,17 +327,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-pbr/Info.plist";
|
||||
@@ -450,6 +341,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-pbr";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -464,17 +375,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-pbr/Info.plist";
|
||||
@@ -483,6 +389,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-pbr";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -496,7 +422,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -551,7 +477,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -607,17 +533,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-pbr/Info.plist";
|
||||
@@ -626,6 +547,26 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
"-lfilameshio",
|
||||
"-lmeshoptimizer",
|
||||
"-limage",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-pbr";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -639,7 +580,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
||||
@@ -6,10 +6,9 @@ targets:
|
||||
hello-pbr:
|
||||
templates:
|
||||
- FilamentApp
|
||||
dependencies:
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilameshio.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libmeshoptimizer.xcframework
|
||||
- framework: ../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libimage.xcframework
|
||||
settings:
|
||||
base:
|
||||
OTHER_LDFLAGS: ["-lfilameshio", "-lmeshoptimizer", "-limage"]
|
||||
preBuildScripts:
|
||||
- path: build-resources.sh
|
||||
name: Build Resources
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Compile bakedColor material.
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
matc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
matc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
|
||||
if [[ ! -e "${matc_path}" ]]; then
|
||||
echo "No matc binary could be found in ${HOST_TOOLS_PATH}."
|
||||
|
||||
@@ -3,113 +3,35 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0A3A34EAB98A45D1D4355A52 /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3BA0FF5017E4FECD94CF3F2 /* libbackend.xcframework */; };
|
||||
0F0218402B9C73D7B3775497 /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0F16339A5D96AB6AAF03A4C /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
12A40CB70167F2609E428EC6 /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3BA0FF5017E4FECD94CF3F2 /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1326DEBB610801CD041AE322 /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED0BAF80B49E29533E492727 /* libibl.xcframework */; };
|
||||
291EA8BF9E335683AD324451 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA668D9E9DC67AD1FA16422A /* libfilabridge.xcframework */; };
|
||||
2DE5F1C322D1B8288CF6F1A9 /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 44224172FC58D500DEFE7A7D /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
34826A3819309F25EAF82B78 /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ED0BAF80B49E29533E492727 /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
371FE9F805A6B436B22EF70D /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C4952E6805DB5E7B871DF61C /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4715F63AF782F1A15A37EFA8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 45FE9476D47ECFFEA65D7146 /* AppDelegate.m */; };
|
||||
4B0C2B6E7D4BF89D8EDEB84F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2620C967534D81CFFAB5D3FF /* ViewController.m */; };
|
||||
5B76FEB9522BC17E14EF3270 /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3604FD7E74C46AC4FAB12BFA /* libutils.xcframework */; };
|
||||
67B75B37DC3FFFE6BDD91455 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DDE4A219AEB5B4507F51B873 /* Main.storyboard */; };
|
||||
68822E4B9059C8A1E67EF062 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E36164E9425CAABBE17EF153 /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
6BBD88355CE6932E706CE45C /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8D062C70EFE8916B7656BB4E /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7A4FA872EA928DB67BBF9351 /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4952E6805DB5E7B871DF61C /* libfilaflat.xcframework */; };
|
||||
8897619E0912B69F232FCC88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 524293A0A8CDE9047347EF48 /* Assets.xcassets */; };
|
||||
915E0D1FE043E873C17EB0AB /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44224172FC58D500DEFE7A7D /* libgeometry.xcframework */; };
|
||||
966626FAF79F36B16F9AE201 /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0F16339A5D96AB6AAF03A4C /* libabseil.xcframework */; };
|
||||
96FBF778C4E3563A7C8D3A47 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 727785EA0395D939E6804AF4 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
978AB6421E245452AD8D9AE0 /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AC6CC7E260B2F20D0EA171E2 /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A05C6F2172B5C29D9A056E39 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 46A2FAD3D476FDADF45F70F8 /* LaunchScreen.storyboard */; };
|
||||
AC1320F672694ABEF53EFAC8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E56C70616FF30C50DFA8238B /* main.m */; };
|
||||
AD9F281E6F4F05A4B98FD437 /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3604FD7E74C46AC4FAB12BFA /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
B156789E3EC8798928C58BD2 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 727785EA0395D939E6804AF4 /* libsmol-v.xcframework */; };
|
||||
BED52BA49D882353BBCEA4F4 /* FilamentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0CDCD26337640C57D07E41ED /* FilamentView.mm */; };
|
||||
CF4322AB55566F31A284739B /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC6CC7E260B2F20D0EA171E2 /* libktxreader.xcframework */; };
|
||||
D5837AE122E300682E245E00 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E36164E9425CAABBE17EF153 /* libfilament.xcframework */; };
|
||||
ECA5B4596C78D6B18043153D /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA668D9E9DC67AD1FA16422A /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
ECE38C7FF5D52E4222C22216 /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D062C70EFE8916B7656BB4E /* libzstd.xcframework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
C514B8F3AF16FEA064256123 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
68822E4B9059C8A1E67EF062 /* libfilament.xcframework in Embed Frameworks */,
|
||||
12A40CB70167F2609E428EC6 /* libbackend.xcframework in Embed Frameworks */,
|
||||
371FE9F805A6B436B22EF70D /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
978AB6421E245452AD8D9AE0 /* libktxreader.xcframework in Embed Frameworks */,
|
||||
ECA5B4596C78D6B18043153D /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
AD9F281E6F4F05A4B98FD437 /* libutils.xcframework in Embed Frameworks */,
|
||||
96FBF778C4E3563A7C8D3A47 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
2DE5F1C322D1B8288CF6F1A9 /* libgeometry.xcframework in Embed Frameworks */,
|
||||
34826A3819309F25EAF82B78 /* libibl.xcframework in Embed Frameworks */,
|
||||
0F0218402B9C73D7B3775497 /* libabseil.xcframework in Embed Frameworks */,
|
||||
6BBD88355CE6932E706CE45C /* libzstd.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0CDCD26337640C57D07E41ED /* FilamentView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentView.mm; sourceTree = "<group>"; };
|
||||
2620C967534D81CFFAB5D3FF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
350DC65C7EE8D98D8FE181DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
3604FD7E74C46AC4FAB12BFA /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
3BB2247EC7FE4EFB2C3ED10A /* hello-triangle.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "hello-triangle.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
41033B581E89DF4B33A2EB53 /* bakedColor.mat */ = {isa = PBXFileReference; path = bakedColor.mat; sourceTree = "<group>"; };
|
||||
44224172FC58D500DEFE7A7D /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
45FE9476D47ECFFEA65D7146 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
524293A0A8CDE9047347EF48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
727785EA0395D939E6804AF4 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
761A2C7D6295697614AD3434 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D062C70EFE8916B7656BB4E /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
AC6CC7E260B2F20D0EA171E2 /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
C16E9A84F33BDFAEDC1E4837 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
C311F8DEBEFEB185F0A7E4CC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
C4952E6805DB5E7B871DF61C /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
CDBB6BE341D1C708FCB68750 /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
D0F16339A5D96AB6AAF03A4C /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
DA668D9E9DC67AD1FA16422A /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
E36164E9425CAABBE17EF153 /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
E36D17DB3F44ADF8EFBEDBAF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
E56C70616FF30C50DFA8238B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
ED0BAF80B49E29533E492727 /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
F3BA0FF5017E4FECD94CF3F2 /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
3691C25600B8D42B8E9BC308 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D5837AE122E300682E245E00 /* libfilament.xcframework in Frameworks */,
|
||||
0A3A34EAB98A45D1D4355A52 /* libbackend.xcframework in Frameworks */,
|
||||
7A4FA872EA928DB67BBF9351 /* libfilaflat.xcframework in Frameworks */,
|
||||
CF4322AB55566F31A284739B /* libktxreader.xcframework in Frameworks */,
|
||||
291EA8BF9E335683AD324451 /* libfilabridge.xcframework in Frameworks */,
|
||||
5B76FEB9522BC17E14EF3270 /* libutils.xcframework in Frameworks */,
|
||||
B156789E3EC8798928C58BD2 /* libsmol-v.xcframework in Frameworks */,
|
||||
915E0D1FE043E873C17EB0AB /* libgeometry.xcframework in Frameworks */,
|
||||
1326DEBB610801CD041AE322 /* libibl.xcframework in Frameworks */,
|
||||
966626FAF79F36B16F9AE201 /* libabseil.xcframework in Frameworks */,
|
||||
ECE38C7FF5D52E4222C22216 /* libzstd.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
39FD47E0213E1FFE59609A06 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -119,30 +41,11 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
554175C148AC5EDE93591BB3 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D0F16339A5D96AB6AAF03A4C /* libabseil.xcframework */,
|
||||
F3BA0FF5017E4FECD94CF3F2 /* libbackend.xcframework */,
|
||||
DA668D9E9DC67AD1FA16422A /* libfilabridge.xcframework */,
|
||||
C4952E6805DB5E7B871DF61C /* libfilaflat.xcframework */,
|
||||
E36164E9425CAABBE17EF153 /* libfilament.xcframework */,
|
||||
44224172FC58D500DEFE7A7D /* libgeometry.xcframework */,
|
||||
ED0BAF80B49E29533E492727 /* libibl.xcframework */,
|
||||
AC6CC7E260B2F20D0EA171E2 /* libktxreader.xcframework */,
|
||||
727785EA0395D939E6804AF4 /* libsmol-v.xcframework */,
|
||||
3604FD7E74C46AC4FAB12BFA /* libutils.xcframework */,
|
||||
8D062C70EFE8916B7656BB4E /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5B3E3AAF5C75644908492410 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C54ABC8D31D1863EF16253A0 /* hello-triangle */,
|
||||
8F55D652979868A470D724FA /* Materials */,
|
||||
554175C148AC5EDE93591BB3 /* Frameworks */,
|
||||
39FD47E0213E1FFE59609A06 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -164,11 +67,11 @@
|
||||
CDBB6BE341D1C708FCB68750 /* FilamentView.h */,
|
||||
0CDCD26337640C57D07E41ED /* FilamentView.mm */,
|
||||
761A2C7D6295697614AD3434 /* Info.plist */,
|
||||
46A2FAD3D476FDADF45F70F8 /* LaunchScreen.storyboard */,
|
||||
E56C70616FF30C50DFA8238B /* main.m */,
|
||||
DDE4A219AEB5B4507F51B873 /* Main.storyboard */,
|
||||
C311F8DEBEFEB185F0A7E4CC /* ViewController.h */,
|
||||
2620C967534D81CFFAB5D3FF /* ViewController.m */,
|
||||
46A2FAD3D476FDADF45F70F8 /* LaunchScreen.storyboard */,
|
||||
DDE4A219AEB5B4507F51B873 /* Main.storyboard */,
|
||||
);
|
||||
path = "hello-triangle";
|
||||
sourceTree = "<group>";
|
||||
@@ -183,8 +86,6 @@
|
||||
668105208CE7DFC4DC55F8EC /* Build Materials */,
|
||||
7B94E1FEEC48280815A91021 /* Sources */,
|
||||
471869BF4E82B6ADC791072D /* Resources */,
|
||||
3691C25600B8D42B8E9BC308 /* Frameworks */,
|
||||
C514B8F3AF16FEA064256123 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -205,10 +106,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 69A012BABE82CB5D1986B1BB /* Build configuration list for PBXProject "hello-triangle" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -217,8 +117,7 @@
|
||||
);
|
||||
mainGroup = 5B3E3AAF5C75644908492410;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = 39FD47E0213E1FFE59609A06 /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -257,7 +156,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Compile bakedColor material.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\nmatc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${matc_path}\" \\\n --api all \\\n -f header \\\n -o \"${PROJECT_DIR}/generated/bakedColor.inc\" \\\n \"${PROJECT_DIR}/Materials/bakedColor.mat\"\n\n# FilamentView.mm includes bakedColor.filamat, so touch it to force Xcode to\n# recompile it.\ntouch \"${PROJECT_DIR}/hello-triangle/FilamentView.mm\"\n";
|
||||
shellScript = "# Compile bakedColor material.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\nmatc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${matc_path}\" \\\n --api all \\\n -f header \\\n -o \"${PROJECT_DIR}/generated/bakedColor.inc\" \\\n \"${PROJECT_DIR}/Materials/bakedColor.mat\"\n\n# FilamentView.mm includes bakedColor.filamat, so touch it to force Xcode to\n# recompile it.\ntouch \"${PROJECT_DIR}/hello-triangle/FilamentView.mm\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -302,17 +201,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-triangle/Info.plist";
|
||||
@@ -321,6 +215,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-triangle";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -334,7 +245,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -397,17 +308,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-triangle/Info.plist";
|
||||
@@ -416,6 +322,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-triangle";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -430,17 +353,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-triangle/Info.plist";
|
||||
@@ -449,6 +367,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-triangle";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -462,7 +397,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -517,7 +452,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -573,17 +508,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "hello-triangle/Info.plist";
|
||||
@@ -592,6 +522,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.hello-triangle";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -605,7 +552,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Compile bakedColor material.
|
||||
|
||||
HOST_TOOLS_PATH="${HOST_TOOLS_PATH:-../../../out/release/filament/bin}"
|
||||
matc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
matc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`
|
||||
|
||||
if [[ ! -e "${matc_path}" ]]; then
|
||||
echo "No matc binary could be found in ${HOST_TOOLS_PATH}."
|
||||
|
||||
+82
-135
@@ -3,112 +3,34 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1277F800D6D46E364FC36888 /* libgeometry.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 567E8EB7B4914540B082DA80 /* libgeometry.xcframework */; };
|
||||
1E31EA1A79A550407E4A39BB /* libzstd.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2AF349D32EBA154923EABB5 /* libzstd.xcframework */; };
|
||||
23318D8F70A6E13214CF15E0 /* libutils.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91DE2DCC79C7DD9D830D883B /* libutils.xcframework */; };
|
||||
243D3B219322B6BD829F39F8 /* libktxreader.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6D7469820FD760B1040BFD2 /* libktxreader.xcframework */; };
|
||||
3A1A568B3431D8FB66F60DB3 /* libabseil.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B254EC414E4905EC4CA22173 /* libabseil.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
527FF7B484BA83BCC248B097 /* libfilabridge.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 393E02B47C7710AB8B1F257A /* libfilabridge.xcframework */; };
|
||||
593638720D5E6F09E52ECB01 /* libibl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1C8DFBE4D515753D5B51FF1 /* libibl.xcframework */; };
|
||||
5F8AE993649815236EC665EB /* libibl.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E1C8DFBE4D515753D5B51FF1 /* libibl.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
60C0A11E074409CE5F88B4FE /* libbackend.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6EB7C2D5C91942D2B1EA056D /* libbackend.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
616A1B9A177BA2F02C920165 /* libfilaflat.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0202CBA0AE1EAA3EE3DE0FFC /* libfilaflat.xcframework */; };
|
||||
643749757FD9F8A609A336C7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E749A05E4E5F36757FB9399C /* Assets.xcassets */; };
|
||||
65FE8CD16998C5D479C9858E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C8CF5D9EB8BA11B44F639DFE /* AppDelegate.m */; };
|
||||
6B53BDEF1DAB8E4AD8CE754B /* libfilabridge.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 393E02B47C7710AB8B1F257A /* libfilabridge.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
7032AB98BE03DFE8E3071FD0 /* libbackend.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EB7C2D5C91942D2B1EA056D /* libbackend.xcframework */; };
|
||||
715FFF9658000B58BFEC22C6 /* libutils.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 91DE2DCC79C7DD9D830D883B /* libutils.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
740AB9277340CDD2222020E2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AA728ADDAAE09D3A5FD80C82 /* main.m */; };
|
||||
7F65E29DE4BF2CAA0D0759AA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 959043C1F56EAAE872B0FF05 /* Main.storyboard */; };
|
||||
80F7D25E275FE8C31AF9196E /* libzstd.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E2AF349D32EBA154923EABB5 /* libzstd.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
852D4BD096E865D7263928C8 /* libabseil.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = B254EC414E4905EC4CA22173 /* libabseil.xcframework */; };
|
||||
8DA900E9A495C25262F78773 /* libgeometry.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 567E8EB7B4914540B082DA80 /* libgeometry.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
9F3C8B197C22178413BBAA37 /* libfilaflat.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0202CBA0AE1EAA3EE3DE0FFC /* libfilaflat.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
A0FCB25FCDAE129BB6369957 /* libfilament.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF18A248DCF11412DDFAB5AE /* libfilament.xcframework */; };
|
||||
A9C3D93FE47802953C8A0868 /* FilamentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A807B46A326F19ABCEE0D62 /* FilamentView.mm */; };
|
||||
BA514AFE134AFD317CD71AA1 /* libsmol-v.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 26B0C9089541BEB14FE28934 /* libsmol-v.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
C8F443E4A5064C2D1F755954 /* libsmol-v.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26B0C9089541BEB14FE28934 /* libsmol-v.xcframework */; };
|
||||
CAB4734A7E608F3C36C4C9C8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D9072BB2A497EEE9A7B662 /* ViewController.m */; };
|
||||
CDF7D87AB0D036A143F37946 /* libfilament.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DF18A248DCF11412DDFAB5AE /* libfilament.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
DF6374DDCFE55DD536B52033 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96B770972E0F353852755AB3 /* LaunchScreen.storyboard */; };
|
||||
F6EEC66B42DF66E5C4CEC17C /* libktxreader.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A6D7469820FD760B1040BFD2 /* libktxreader.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
89F6975F74EBC72BCCA1074F /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
CDF7D87AB0D036A143F37946 /* libfilament.xcframework in Embed Frameworks */,
|
||||
60C0A11E074409CE5F88B4FE /* libbackend.xcframework in Embed Frameworks */,
|
||||
9F3C8B197C22178413BBAA37 /* libfilaflat.xcframework in Embed Frameworks */,
|
||||
F6EEC66B42DF66E5C4CEC17C /* libktxreader.xcframework in Embed Frameworks */,
|
||||
6B53BDEF1DAB8E4AD8CE754B /* libfilabridge.xcframework in Embed Frameworks */,
|
||||
715FFF9658000B58BFEC22C6 /* libutils.xcframework in Embed Frameworks */,
|
||||
BA514AFE134AFD317CD71AA1 /* libsmol-v.xcframework in Embed Frameworks */,
|
||||
8DA900E9A495C25262F78773 /* libgeometry.xcframework in Embed Frameworks */,
|
||||
5F8AE993649815236EC665EB /* libibl.xcframework in Embed Frameworks */,
|
||||
3A1A568B3431D8FB66F60DB3 /* libabseil.xcframework in Embed Frameworks */,
|
||||
80F7D25E275FE8C31AF9196E /* libzstd.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0202CBA0AE1EAA3EE3DE0FFC /* libfilaflat.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilaflat.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilaflat.xcframework"; sourceTree = "<group>"; };
|
||||
023105B81B6C662A3BABDC92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
0A8B371B11D177469DFEBB86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
1A807B46A326F19ABCEE0D62 /* FilamentView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilamentView.mm; sourceTree = "<group>"; };
|
||||
26B0C9089541BEB14FE28934 /* libsmol-v.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "libsmol-v.xcframework"; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libsmol-v.xcframework"; sourceTree = "<group>"; };
|
||||
2F32AE4C99AA8AE39BB09F0A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
393E02B47C7710AB8B1F257A /* libfilabridge.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilabridge.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilabridge.xcframework"; sourceTree = "<group>"; };
|
||||
567E8EB7B4914540B082DA80 /* libgeometry.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgeometry.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libgeometry.xcframework"; sourceTree = "<group>"; };
|
||||
6EB7C2D5C91942D2B1EA056D /* libbackend.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libbackend.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libbackend.xcframework"; sourceTree = "<group>"; };
|
||||
7ED3EBFE01876351CFF9AD1A /* transparent-rendering.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "transparent-rendering.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
91DE2DCC79C7DD9D830D883B /* libutils.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libutils.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libutils.xcframework"; sourceTree = "<group>"; };
|
||||
952B0BE8EFAEF9B6FCB77798 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
A5E8D7CA26C338BF3D9D1932 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
A6D7469820FD760B1040BFD2 /* libktxreader.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libktxreader.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libktxreader.xcframework"; sourceTree = "<group>"; };
|
||||
AA728ADDAAE09D3A5FD80C82 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
B254EC414E4905EC4CA22173 /* libabseil.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libabseil.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libabseil.xcframework"; sourceTree = "<group>"; };
|
||||
BD21E933E2F77EE5ACBCDD5F /* FilamentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilamentView.h; sourceTree = "<group>"; };
|
||||
C8CF5D9EB8BA11B44F639DFE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
DF18A248DCF11412DDFAB5AE /* libfilament.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libfilament.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libfilament.xcframework"; sourceTree = "<group>"; };
|
||||
E1C8DFBE4D515753D5B51FF1 /* libibl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libibl.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libibl.xcframework"; sourceTree = "<group>"; };
|
||||
E2AF349D32EBA154923EABB5 /* libzstd.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libzstd.xcframework; path = "../../../out/$(FILAMENT_OUT_NAME)/filament/lib/libzstd.xcframework"; sourceTree = "<group>"; };
|
||||
E6D9072BB2A497EEE9A7B662 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
E749A05E4E5F36757FB9399C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
9267558086B89E5F350ADDC4 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A0FCB25FCDAE129BB6369957 /* libfilament.xcframework in Frameworks */,
|
||||
7032AB98BE03DFE8E3071FD0 /* libbackend.xcframework in Frameworks */,
|
||||
616A1B9A177BA2F02C920165 /* libfilaflat.xcframework in Frameworks */,
|
||||
243D3B219322B6BD829F39F8 /* libktxreader.xcframework in Frameworks */,
|
||||
527FF7B484BA83BCC248B097 /* libfilabridge.xcframework in Frameworks */,
|
||||
23318D8F70A6E13214CF15E0 /* libutils.xcframework in Frameworks */,
|
||||
C8F443E4A5064C2D1F755954 /* libsmol-v.xcframework in Frameworks */,
|
||||
1277F800D6D46E364FC36888 /* libgeometry.xcframework in Frameworks */,
|
||||
593638720D5E6F09E52ECB01 /* libibl.xcframework in Frameworks */,
|
||||
852D4BD096E865D7263928C8 /* libabseil.xcframework in Frameworks */,
|
||||
1E31EA1A79A550407E4A39BB /* libzstd.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0B098038EF2CFAC88AFE0F18 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -122,7 +44,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6E33B6C4EE9FFF8BBCE5DD20 /* transparent-rendering */,
|
||||
C5AF8AD86B58EF5D0BD7B0B2 /* Frameworks */,
|
||||
0B098038EF2CFAC88AFE0F18 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -136,33 +57,15 @@
|
||||
BD21E933E2F77EE5ACBCDD5F /* FilamentView.h */,
|
||||
1A807B46A326F19ABCEE0D62 /* FilamentView.mm */,
|
||||
952B0BE8EFAEF9B6FCB77798 /* Info.plist */,
|
||||
96B770972E0F353852755AB3 /* LaunchScreen.storyboard */,
|
||||
AA728ADDAAE09D3A5FD80C82 /* main.m */,
|
||||
959043C1F56EAAE872B0FF05 /* Main.storyboard */,
|
||||
2F32AE4C99AA8AE39BB09F0A /* ViewController.h */,
|
||||
E6D9072BB2A497EEE9A7B662 /* ViewController.m */,
|
||||
96B770972E0F353852755AB3 /* LaunchScreen.storyboard */,
|
||||
959043C1F56EAAE872B0FF05 /* Main.storyboard */,
|
||||
);
|
||||
path = "transparent-rendering";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C5AF8AD86B58EF5D0BD7B0B2 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B254EC414E4905EC4CA22173 /* libabseil.xcframework */,
|
||||
6EB7C2D5C91942D2B1EA056D /* libbackend.xcframework */,
|
||||
393E02B47C7710AB8B1F257A /* libfilabridge.xcframework */,
|
||||
0202CBA0AE1EAA3EE3DE0FFC /* libfilaflat.xcframework */,
|
||||
DF18A248DCF11412DDFAB5AE /* libfilament.xcframework */,
|
||||
567E8EB7B4914540B082DA80 /* libgeometry.xcframework */,
|
||||
E1C8DFBE4D515753D5B51FF1 /* libibl.xcframework */,
|
||||
A6D7469820FD760B1040BFD2 /* libktxreader.xcframework */,
|
||||
26B0C9089541BEB14FE28934 /* libsmol-v.xcframework */,
|
||||
91DE2DCC79C7DD9D830D883B /* libutils.xcframework */,
|
||||
E2AF349D32EBA154923EABB5 /* libzstd.xcframework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -173,8 +76,6 @@
|
||||
31596072423F6FB0A84C97A0 /* Build Materials */,
|
||||
EE3B63E6A11EDDBC48502B27 /* Sources */,
|
||||
A676D3A853739CDAB454587E /* Resources */,
|
||||
9267558086B89E5F350ADDC4 /* Frameworks */,
|
||||
89F6975F74EBC72BCCA1074F /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -195,10 +96,9 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1430;
|
||||
TargetAttributes = {
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 8A22BD23DB15965551506480 /* Build configuration list for PBXProject "transparent-rendering" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@@ -207,8 +107,7 @@
|
||||
);
|
||||
mainGroup = 4C27390036DEB15C67D5A664;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = 0B098038EF2CFAC88AFE0F18 /* Products */;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -247,7 +146,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Compile bakedColor material.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\nmatc_path=`find -L ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${matc_path}\" \\\n --api all \\\n -f header \\\n -o \"${PROJECT_DIR}/generated/bakedColor.inc\" \\\n \"${PROJECT_DIR}/Materials/bakedColor.mat\"\n\n# FilamentView.mm includes bakedColor.filamat, so touch it to force Xcode to\n# recompile it.\ntouch \"${PROJECT_DIR}/transparent-rendering/FilamentView.mm\"\n";
|
||||
shellScript = "# Compile bakedColor material.\n\nHOST_TOOLS_PATH=\"${HOST_TOOLS_PATH:-../../../out/release/filament/bin}\"\nmatc_path=`find ${HOST_TOOLS_PATH} -name matc -type f | head -n 1`\n\nif [[ ! -e \"${matc_path}\" ]]; then\n echo \"No matc binary could be found in ${HOST_TOOLS_PATH}.\"\n echo \"Ensure Filament has been built/installed before building this app.\"\n exit 1\nfi\n\nmkdir -p \"${PROJECT_DIR}/generated/\"\n\"${matc_path}\" \\\n --api all \\\n -f header \\\n -o \"${PROJECT_DIR}/generated/bakedColor.inc\" \\\n \"${PROJECT_DIR}/Materials/bakedColor.mat\"\n\n# FilamentView.mm includes bakedColor.filamat, so touch it to force Xcode to\n# recompile it.\ntouch \"${PROJECT_DIR}/transparent-rendering/FilamentView.mm\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -291,7 +190,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -346,7 +245,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -408,7 +307,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -464,17 +363,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "transparent-rendering/Info.plist";
|
||||
@@ -483,6 +377,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.transparent-rendering";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -497,17 +408,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "transparent-rendering/Info.plist";
|
||||
@@ -516,6 +422,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.transparent-rendering";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -530,17 +453,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-debug";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_OPENGL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-debug/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "transparent-rendering/Info.plist";
|
||||
@@ -549,6 +467,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-debug/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-debug/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.transparent-rendering";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -563,17 +498,12 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
ENABLE_BITCODE = NO;
|
||||
FILAMENT_OUT_NAME = "ios-release";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"../../../out/$(FILAMENT_OUT_NAME)/filament/lib\"",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"FILAMENT_APP_USE_METAL=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../../out/$(FILAMENT_OUT_NAME)/filament/include",
|
||||
"../../../out/ios-release/filament/include",
|
||||
generated,
|
||||
);
|
||||
INFOPLIST_FILE = "transparent-rendering/Info.plist";
|
||||
@@ -582,6 +512,23 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"../../../out/ios-release/filament/lib/$(CURRENT_ARCH)",
|
||||
"../../../out/ios-release/filament/lib/universal",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lfilament",
|
||||
"-lbackend",
|
||||
"-lfilaflat",
|
||||
"-lktxreader",
|
||||
"-lfilabridge",
|
||||
"-lutils",
|
||||
"-lsmol-v",
|
||||
"-lgeometry",
|
||||
"-libl",
|
||||
"-labseil",
|
||||
"-lzstd",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "${SAMPLE_CODE_DISAMBIGUATOR}.google.filament.transparent-rendering";
|
||||
SAMPLE_CODE_DISAMBIGUATOR = "${DEVELOPMENT_TEAM}";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -595,7 +542,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
||||
@@ -50,7 +50,7 @@ install(DIRECTORY ${PUBLIC_HDR_DIR}/camutils DESTINATION include)
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
add_executable(test_${TARGET} tests/test_camutils.cpp)
|
||||
target_link_libraries(test_${TARGET} PRIVATE camutils gtest)
|
||||
set_target_properties(test_${TARGET} PROPERTIES FOLDER Tests)
|
||||
|
||||
@@ -881,6 +881,14 @@ utils::io::sstream& CodeGenerator::generateSpecializationConstant(utils::io::sst
|
||||
|
||||
static const char* types[] = { "int", "float", "bool" };
|
||||
|
||||
// Spec constants aren't fully supported in Tint,
|
||||
// workaround until https://issues.chromium.org/issues/42250586 is resolved
|
||||
if (mTargetApi == TargetApi::WEBGPU) {
|
||||
std::string const variableName = "FILAMENT_SPEC_CONST_" + std::to_string(id) + "_" + name;
|
||||
out << " const " << types[value.index()] << " " << variableName << " = " << constantString << ";\n";
|
||||
out << types[value.index()] << " " << name << " = " << variableName << ";\n";
|
||||
return out;
|
||||
}
|
||||
if (mTargetLanguage == MaterialBuilderBase::TargetLanguage::SPIRV) {
|
||||
out << "layout (constant_id = " << id << ") const "
|
||||
<< types[value.index()] << " " << name << " = " << constantString << ";\n";
|
||||
|
||||
@@ -37,7 +37,7 @@ install(FILES ${DIST_HDRS} DESTINATION include/${TARGET})
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (FILAMENT_BUILD_TESTING AND NOT IOS AND NOT WASM AND NOT ANDROID)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT IOS AND NOT WEBGL AND NOT ANDROID)
|
||||
add_executable(test_${TARGET} tests/test_filamesh.cpp )
|
||||
target_link_libraries(test_${TARGET} PRIVATE filameshio gtest)
|
||||
set_target_properties(test_${TARGET} PROPERTIES FOLDER Tests)
|
||||
|
||||
@@ -46,7 +46,7 @@ if (MSVC)
|
||||
set(OPTIMIZATION_FLAGS
|
||||
/fp:fast
|
||||
)
|
||||
elseif (WASM)
|
||||
elseif(WEBGL)
|
||||
# Avoid strict-vtable-pointers here, it is broken in WebAssembly.
|
||||
set(OPTIMIZATION_FLAGS -fvisibility-inlines-hidden)
|
||||
else()
|
||||
|
||||
@@ -73,7 +73,7 @@ install(FILES "${GEOMETRY_COMBINED_OUTPUT}" DESTINATION lib/${DIST_DIR} RENAME $
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
set(TARGET test_transcoder)
|
||||
add_executable(${TARGET} tests/test_transcoder.cpp)
|
||||
target_link_libraries(${TARGET} PRIVATE geometry gtest)
|
||||
|
||||
@@ -198,13 +198,13 @@ set_target_properties(gltfio_core PROPERTIES FOLDER Libs)
|
||||
target_compile_definitions(gltfio_core PUBLIC -DGLTFIO_DRACO_SUPPORTED=1)
|
||||
target_link_libraries(gltfio_core PUBLIC dracodec meshoptimizer ${WEBP_DECODER_LIB_TARGET})
|
||||
|
||||
if (WASM_PTHREADS)
|
||||
if (WEBGL_PTHREADS)
|
||||
target_compile_definitions(gltfio_core PUBLIC -DFILAMENT_WASM_THREADS)
|
||||
endif()
|
||||
|
||||
target_compile_options(gltfio_core PRIVATE ${FILAMENT_WARNINGS})
|
||||
|
||||
if (NOT WASM AND NOT ANDROID AND NOT IOS)
|
||||
if (NOT WEBGL AND NOT ANDROID AND NOT IOS)
|
||||
|
||||
# ==================================================================================================
|
||||
# Link the core library with additional dependencies to create the "full" library
|
||||
@@ -246,7 +246,7 @@ if (FILAMENT_BUILD_TESTING)
|
||||
|
||||
# The following tests rely on private APIs that are stripped
|
||||
# away in Release builds
|
||||
if (TNT_DEV AND NOT WASM AND NOT ANDROID AND NOT IOS)
|
||||
if (TNT_DEV AND NOT WEBGL AND NOT ANDROID AND NOT IOS)
|
||||
set(TEST_TARGET test_gltfio)
|
||||
|
||||
add_executable(${TEST_TARGET} test/gltfio_test.cpp)
|
||||
|
||||
@@ -99,7 +99,7 @@ if (MSVC)
|
||||
set(OPTIMIZATION_FLAGS
|
||||
/fp:fast
|
||||
)
|
||||
elseif (WASM)
|
||||
elseif(WEBGL)
|
||||
# Avoid strict-vtable-pointers here, it is broken in WebAssembly.
|
||||
set(OPTIMIZATION_FLAGS -fvisibility-inlines-hidden)
|
||||
else()
|
||||
|
||||
@@ -53,7 +53,7 @@ install(DIRECTORY ${PUBLIC_HDR_DIR}/image DESTINATION include)
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WASM AND NOT IOS AND NOT FILAMENT_SKIP_SDL2)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WEBGL AND NOT IOS AND NOT FILAMENT_SKIP_SDL2)
|
||||
add_executable(test_${TARGET} tests/test_image.cpp)
|
||||
target_link_libraries(test_${TARGET} PRIVATE imageio gtest)
|
||||
set_target_properties(test_${TARGET} PROPERTIES FOLDER Tests)
|
||||
|
||||
@@ -17,9 +17,9 @@ target_link_libraries(imagediff PRIVATE
|
||||
)
|
||||
|
||||
|
||||
if (NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
add_executable(test_imagediff tests/test_ImageDiff.cpp)
|
||||
target_link_libraries(test_imagediff PRIVATE imagediff gtest image utils)
|
||||
endif()
|
||||
|
||||
install(TARGETS imagediff ARCHIVE DESTINATION lib/${DIST_DIR} LIBRARY DESTINATION lib/${DIST_DIR})
|
||||
install(TARGETS imagediff ARCHIVE DESTINATION lib/${DIST_ARCH} LIBRARY DESTINATION lib/${DIST_ARCH})
|
||||
|
||||
@@ -45,7 +45,7 @@ install(DIRECTORY ${PUBLIC_HDR_DIR}/imageio-lite DESTINATION include)
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
add_executable(test_${TARGET} tests/test_imageio-lite.cpp)
|
||||
target_link_libraries(test_${TARGET} PRIVATE ${TARGET} image gtest)
|
||||
set_target_properties(test_${TARGET} PROPERTIES FOLDER Tests)
|
||||
|
||||
@@ -169,7 +169,7 @@ BasisEncoder* Builder::build() {
|
||||
// an annotation that gets stored in the KTX2 file, which enables the app to choose the right
|
||||
// format when it loads and transcodes the texture. Technically however, the transcoder
|
||||
// SHOULD know about this, since in some scenarios it needs to interpolate between colors.
|
||||
params.m_ktx2_srgb_transfer_func = !mImpl->linear;
|
||||
params.m_ktx2_and_basis_srgb_transfer_function = !mImpl->linear;
|
||||
|
||||
// Select the same quality that the basis tool selects by default (midpoint of range).
|
||||
params.m_quality_level = 128;
|
||||
@@ -181,7 +181,7 @@ BasisEncoder* Builder::build() {
|
||||
params.m_read_source_images = false;
|
||||
|
||||
// We do not want basis to write the file, we want to manually dump "get_output_ktx2_file()"
|
||||
params.m_write_output_basis_files = false;
|
||||
params.m_write_output_basis_or_ktx2_files = false;
|
||||
|
||||
basisu::basis_compressor* encoder = new basisu::basis_compressor();
|
||||
|
||||
@@ -238,7 +238,7 @@ bool BasisEncoder::encode() {
|
||||
case basis_compressor::cECFailedFrontEnd:
|
||||
puts("Compressor frontend stage failed!");
|
||||
break;
|
||||
case basis_compressor::cECFailedFontendExtract:
|
||||
case basis_compressor::cECFailedFrontendExtract:
|
||||
puts("Compressor frontend data extraction failed!");
|
||||
break;
|
||||
case basis_compressor::cECFailedBackend:
|
||||
|
||||
@@ -60,7 +60,7 @@ endfunction()
|
||||
add_testfile(color_grid_uastc_zstd.ktx2)
|
||||
add_testfile(lightroom_ibl.ktx)
|
||||
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
add_executable(test_ktxreader tests/test_ktxreader.cpp ${TESTFILES})
|
||||
target_link_libraries(test_ktxreader PRIVATE ${TARGET} gtest)
|
||||
set_target_properties(test_ktxreader PROPERTIES FOLDER Tests)
|
||||
|
||||
@@ -135,7 +135,7 @@ static Result transcodeImageLevel(ktx2_transcoder& transcoder,
|
||||
if (formatInfo.isCompressed) {
|
||||
const uint32_t qwordsPerBlock = basisu::get_qwords_per_block(destFormat);
|
||||
const size_t byteCount = (size_t)sizeof(uint64_t) * (size_t)qwordsPerBlock * (size_t)levelInfo.m_total_blocks;
|
||||
|
||||
|
||||
if (qwordsPerBlock != 0 && levelInfo.m_total_blocks != 0 &&
|
||||
byteCount / qwordsPerBlock / sizeof(uint64_t) != levelInfo.m_total_blocks) {
|
||||
return Result::COMPRESSED_TRANSCODE_FAILURE;
|
||||
@@ -156,13 +156,13 @@ static Result transcodeImageLevel(ktx2_transcoder& transcoder,
|
||||
|
||||
const uint32_t rowCount = levelInfo.m_orig_height;
|
||||
const uint32_t bytesPerPix = basis_get_bytes_per_block_or_pixel(formatInfo.basisFormat);
|
||||
|
||||
|
||||
if (bytesPerPix == 0) {
|
||||
return Result::UNCOMPRESSED_TRANSCODE_FAILURE;
|
||||
}
|
||||
|
||||
const size_t byteCount = (size_t)bytesPerPix * (size_t)levelInfo.m_orig_width * (size_t)rowCount;
|
||||
|
||||
|
||||
if (levelInfo.m_orig_width != 0 &&
|
||||
byteCount / bytesPerPix / levelInfo.m_orig_width != rowCount) {
|
||||
return Result::UNCOMPRESSED_TRANSCODE_FAILURE;
|
||||
@@ -400,7 +400,7 @@ Texture* Ktx2Reader::createTexture(ktx2_transcoder* transcoder, const void* data
|
||||
if (!info.isSupported || info.transferFunction != transfer) {
|
||||
continue;
|
||||
}
|
||||
if (!basis_is_format_supported(info.basisFormat, transcoder->get_format())) {
|
||||
if (!basis_is_format_supported(info.basisFormat, transcoder->get_basis_tex_format())) {
|
||||
continue;
|
||||
}
|
||||
const uint32_t layerIndex = 0;
|
||||
|
||||
@@ -115,7 +115,7 @@ if (APPLE)
|
||||
list(APPEND SRCS src/darwin/Systrace.cpp)
|
||||
list(APPEND SRCS src/darwin/Tracing.cpp)
|
||||
endif()
|
||||
if (WASM)
|
||||
if (WEBGL)
|
||||
list(APPEND SRCS src/web/Path.cpp)
|
||||
endif()
|
||||
|
||||
@@ -208,12 +208,12 @@ if (FILAMENT_BUILD_TESTING)
|
||||
test/test_Status.cpp
|
||||
)
|
||||
|
||||
if (WASM_PTHREADS)
|
||||
if (WEBGL_PTHREADS)
|
||||
target_compile_definitions(${TARGET} PUBLIC -DFILAMENT_WASM_THREADS)
|
||||
endif()
|
||||
|
||||
# The Path tests are platform-specific
|
||||
if (NOT WASM)
|
||||
if (NOT WEBGL)
|
||||
if (WIN32)
|
||||
list(APPEND TEST_SRCS test/test_WinPath.cpp)
|
||||
else()
|
||||
@@ -231,7 +231,7 @@ endif()
|
||||
# Benchmarks
|
||||
# ==================================================================================================
|
||||
|
||||
if (FILAMENT_BUILD_TESTING AND NOT WASM)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT WEBGL)
|
||||
|
||||
add_library(benchmark_${TARGET}_callee SHARED benchmark/benchmark_callee.cpp)
|
||||
set_target_properties(benchmark_${TARGET}_callee PROPERTIES FOLDER Benchmarks)
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
virtual ~Listener() noexcept;
|
||||
};
|
||||
|
||||
using ChangeCallback = std::function<void(Slice<const Entity>)>;
|
||||
using ChangeCallback = std::function<void(utils::Slice<const Entity>)>;
|
||||
|
||||
/**
|
||||
* Registers a callback to be triggered when entities are destroyed.
|
||||
@@ -105,7 +105,10 @@ public:
|
||||
|
||||
// Return whether the given Entity has been destroyed (false) or not (true).
|
||||
// Thread safe.
|
||||
bool isAlive(Entity e) const noexcept;
|
||||
bool isAlive(Entity const e) const noexcept {
|
||||
assert(getIndex(e) < RAW_INDEX_COUNT);
|
||||
return (!e.isNull()) && (getGeneration(e) == mGens[getIndex(e)]);
|
||||
}
|
||||
|
||||
// Registers a listener to be called when an entity is destroyed. Thread safe.
|
||||
// If the listener is already registered, this method has no effect.
|
||||
@@ -115,9 +118,13 @@ public:
|
||||
void unregisterListener(Listener* l) noexcept;
|
||||
|
||||
|
||||
|
||||
/* no user serviceable parts below */
|
||||
|
||||
// current generation of the given index. Use for debugging and testing.
|
||||
uint8_t getGenerationForIndex(size_t const index) const noexcept {
|
||||
return mGens[index];
|
||||
}
|
||||
|
||||
// singleton, can't be copied
|
||||
EntityManager(const EntityManager& rhs) = delete;
|
||||
EntityManager& operator=(const EntityManager& rhs) = delete;
|
||||
@@ -150,6 +157,9 @@ private:
|
||||
static Entity::Type makeIdentity(Entity::Type const g, Entity::Type const i) noexcept {
|
||||
return (g << GENERATION_SHIFT) | (i & INDEX_MASK);
|
||||
}
|
||||
|
||||
// stores the generation of each index.
|
||||
uint8_t* const mGens;
|
||||
};
|
||||
|
||||
} // namespace utils
|
||||
|
||||
@@ -18,21 +18,21 @@
|
||||
|
||||
#include "EntityManagerImpl.h"
|
||||
|
||||
#include <utils/Entity.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <mutex>
|
||||
#include <new>
|
||||
#include <utility>
|
||||
|
||||
namespace utils {
|
||||
|
||||
EntityManager::Listener::~Listener() noexcept = default;
|
||||
|
||||
EntityManager::EntityManager() = default;
|
||||
EntityManager::EntityManager()
|
||||
: mGens(new uint8_t[RAW_INDEX_COUNT]) {
|
||||
// initialize all the generations to 0
|
||||
std::fill_n(mGens, RAW_INDEX_COUNT, 0);
|
||||
}
|
||||
|
||||
EntityManager::~EntityManager() = default;
|
||||
EntityManager::~EntityManager() {
|
||||
delete [] mGens;
|
||||
}
|
||||
|
||||
EntityManager& EntityManager::get() noexcept {
|
||||
// note: we leak the EntityManager because it's more important that it survives everything else
|
||||
@@ -41,11 +41,11 @@ EntityManager& EntityManager::get() noexcept {
|
||||
return *instance;
|
||||
}
|
||||
|
||||
void EntityManager::create(size_t const n, Entity* entities) {
|
||||
void EntityManager::create(size_t n, Entity* entities) {
|
||||
static_cast<EntityManagerImpl *>(this)->create(n, entities);
|
||||
}
|
||||
|
||||
void EntityManager::destroy(size_t const n, Entity* entities) noexcept {
|
||||
void EntityManager::destroy(size_t n, Entity* entities) noexcept {
|
||||
static_cast<EntityManagerImpl *>(this)->destroy(n, entities);
|
||||
}
|
||||
|
||||
@@ -84,8 +84,4 @@ void EntityManager::dumpActiveEntities(utils::io::ostream& out) const {
|
||||
|
||||
#endif
|
||||
|
||||
bool EntityManager::isAlive(Entity const e) const noexcept {
|
||||
return static_cast<EntityManagerImpl const *>(this)->isAlive(e);
|
||||
}
|
||||
|
||||
} // namespace utils
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <mutex> // for std::lock_guard
|
||||
#include <new>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -50,38 +49,15 @@ static constexpr size_t MIN_FREE_INDICES = 1024;
|
||||
|
||||
class UTILS_PRIVATE EntityManagerImpl : public EntityManager {
|
||||
public:
|
||||
friend class EntityManager;
|
||||
|
||||
using EntityManager::getGeneration;
|
||||
using EntityManager::getIndex;
|
||||
using EntityManager::makeIdentity;
|
||||
using EntityManager::create;
|
||||
using EntityManager::destroy;
|
||||
|
||||
EntityManagerImpl() noexcept
|
||||
: mGens(new(std::nothrow) uint8_t[RAW_INDEX_COUNT]) {
|
||||
// initialize all the generations to 0
|
||||
std::fill_n(mGens, RAW_INDEX_COUNT, 0);
|
||||
}
|
||||
|
||||
~EntityManagerImpl() noexcept {
|
||||
delete [] mGens;
|
||||
}
|
||||
|
||||
bool isAlive(Entity const e) const noexcept {
|
||||
assert(getIndex(e) < RAW_INDEX_COUNT);
|
||||
if (e.isNull()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::lock_guard const lock(mFreeListLock);
|
||||
bool const alive = (getGeneration(e) == mGens[getIndex(e)]);
|
||||
return alive;
|
||||
}
|
||||
|
||||
UTILS_NOINLINE
|
||||
size_t getEntityCount() const noexcept {
|
||||
std::lock_guard const lock(mFreeListLock);
|
||||
std::lock_guard<Mutex> const lock(mFreeListLock);
|
||||
if (mCurrentIndex < RAW_INDEX_COUNT) {
|
||||
return (mCurrentIndex - 1) - mFreeList.size();
|
||||
} else {
|
||||
@@ -90,13 +66,13 @@ public:
|
||||
}
|
||||
|
||||
UTILS_NOINLINE
|
||||
void create(size_t const n, Entity* entities) {
|
||||
void create(size_t n, Entity* entities) {
|
||||
Entity::Type index{};
|
||||
auto& freeList = mFreeList;
|
||||
uint8_t const* const gens = mGens;
|
||||
|
||||
// this must be thread-safe, acquire the free-list mutex
|
||||
std::lock_guard const lock(mFreeListLock);
|
||||
std::lock_guard<Mutex> const lock(mFreeListLock);
|
||||
Entity::Type currentIndex = mCurrentIndex;
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
if (UTILS_UNLIKELY(currentIndex >= RAW_INDEX_COUNT || freeList.size() >= MIN_FREE_INDICES)) {
|
||||
@@ -122,11 +98,11 @@ public:
|
||||
}
|
||||
|
||||
UTILS_NOINLINE
|
||||
void destroy(size_t const n, Entity* entities) noexcept {
|
||||
void destroy(size_t n, Entity* entities) noexcept {
|
||||
auto& freeList = mFreeList;
|
||||
uint8_t* const gens = mGens;
|
||||
|
||||
std::unique_lock lock(mFreeListLock);
|
||||
std::unique_lock<Mutex> lock(mFreeListLock);
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
if (!entities[i]) {
|
||||
// behave like free(), ok to free null Entity.
|
||||
@@ -134,15 +110,19 @@ public:
|
||||
}
|
||||
|
||||
// it's an error to delete an Entity twice...
|
||||
bool const isAlive = getGeneration(entities[i]) == mGens[getIndex(entities[i])];
|
||||
assert(isAlive);
|
||||
assert(isAlive(entities[i]));
|
||||
|
||||
// ... deleting a dead Entity will corrupt the internal state, so we protect ourselves
|
||||
// against it. We don't guarantee anything about external state -- e.g. the listeners
|
||||
// will be called.
|
||||
if (UTILS_LIKELY(isAlive)) {
|
||||
if (isAlive(entities[i])) {
|
||||
Entity::Type const index = getIndex(entities[i]);
|
||||
freeList.push_back(index);
|
||||
|
||||
// The generation update doesn't require the lock because it's only used for isAlive()
|
||||
// and entities work as weak references -- it just means that isAlive() could return
|
||||
// true a little longer than expected in some other threads.
|
||||
// We do need a memory fence though, it is provided by the mFreeListLock.unlock() below.
|
||||
gens[index]++;
|
||||
|
||||
#if FILAMENT_UTILS_TRACK_ENTITIES
|
||||
@@ -171,22 +151,22 @@ public:
|
||||
}
|
||||
|
||||
void registerListener(Listener* l) noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
mListeners.insert(l);
|
||||
}
|
||||
|
||||
void unregisterListener(Listener* l) noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
mListeners.erase(l);
|
||||
}
|
||||
|
||||
void registerChangeCallback(void const* token, ChangeCallback callback) noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
mChangeCallbacks.push_back({token, std::move(callback)});
|
||||
}
|
||||
|
||||
void unregisterChangeCallback(void const* token) noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
mChangeCallbacks.erase(
|
||||
std::remove_if(mChangeCallbacks.begin(), mChangeCallbacks.end(),
|
||||
[token](auto const& info) { return info.token == token; }),
|
||||
@@ -194,7 +174,7 @@ public:
|
||||
}
|
||||
|
||||
void flushNotifications() noexcept {
|
||||
std::unique_lock lock(mFreeListLock);
|
||||
std::unique_lock<Mutex> lock(mFreeListLock);
|
||||
if (mDirtyCount > 0) {
|
||||
Entity localBuffer[MAX_DIRTY_COUNT];
|
||||
assert_invariant(mDirtyCount <= MAX_DIRTY_COUNT);
|
||||
@@ -228,7 +208,7 @@ public:
|
||||
|
||||
private:
|
||||
std::vector<ChangeCallback> getChangeCallbacks() const noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
std::vector<ChangeCallback> result;
|
||||
result.reserve(mChangeCallbacks.size());
|
||||
for (auto const& info : mChangeCallbacks) {
|
||||
@@ -237,7 +217,7 @@ private:
|
||||
return result;
|
||||
}
|
||||
|
||||
void triggerChangeCallbacks(Entity const* entities, size_t const n) const noexcept {
|
||||
void triggerChangeCallbacks(Entity const* entities, size_t n) const noexcept {
|
||||
auto const callbacks = getChangeCallbacks();
|
||||
Slice const slice(entities, n);
|
||||
for (auto const& callback : callbacks) {
|
||||
@@ -246,7 +226,7 @@ private:
|
||||
}
|
||||
|
||||
FixedCapacityVector<Listener*> getListeners() const noexcept {
|
||||
std::lock_guard const lock(mListenerLock);
|
||||
std::lock_guard<Mutex> const lock(mListenerLock);
|
||||
tsl::robin_set<Listener*> const& listeners = mListeners;
|
||||
FixedCapacityVector<Listener*> result(listeners.size());
|
||||
result.resize(result.capacity()); // unfortunately this memset()
|
||||
@@ -254,20 +234,22 @@ private:
|
||||
return result; // the c++ standard guarantees a move
|
||||
}
|
||||
|
||||
static constexpr size_t MAX_DIRTY_COUNT = 16;
|
||||
uint32_t mCurrentIndex = 1;
|
||||
|
||||
// stores indices that got freed
|
||||
mutable Mutex mFreeListLock;
|
||||
std::deque<Entity::Type> mFreeList;
|
||||
|
||||
mutable Mutex mListenerLock;
|
||||
tsl::robin_set<Listener*> mListeners;
|
||||
|
||||
struct CallbackInfo {
|
||||
void const* token;
|
||||
ChangeCallback callback;
|
||||
};
|
||||
|
||||
mutable Mutex mFreeListLock;
|
||||
uint32_t mCurrentIndex = 1;
|
||||
std::deque<Entity::Type> mFreeList; // stores indices that got freed
|
||||
uint8_t* const mGens; // stores the generation of each index.
|
||||
|
||||
mutable Mutex mListenerLock;
|
||||
tsl::robin_set<Listener*> mListeners;
|
||||
std::vector<CallbackInfo> mChangeCallbacks;
|
||||
|
||||
static constexpr size_t MAX_DIRTY_COUNT = 16;
|
||||
Entity mDirtyEntities[MAX_DIRTY_COUNT];
|
||||
size_t mDirtyCount = 0;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ install(DIRECTORY ${PUBLIC_HDR_DIR}/viewer DESTINATION include)
|
||||
# ==================================================================================================
|
||||
# Tests
|
||||
# ==================================================================================================
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WASM AND NOT IOS)
|
||||
if (FILAMENT_BUILD_TESTING AND NOT ANDROID AND NOT WEBGL AND NOT IOS)
|
||||
add_executable(test_settings tests/test_settings.cpp)
|
||||
target_link_libraries(test_settings PRIVATE ${TARGET} gtest)
|
||||
set_target_properties(test_settings PROPERTIES FOLDER Tests)
|
||||
|
||||
Vendored
+1
-1
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2019-2026 Binomial LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
Vendored
+428
-203
@@ -1,227 +1,489 @@
|
||||
# basis_universal
|
||||
Basis Universal Supercompressed GPU Texture Codec
|
||||
<!-- Copyright 2016-2026 Binomial LLC -->
|
||||
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
||||
|
||||
<sub>(This software is available under a free and permissive license (Apache 2.0), but like many other large open source projects it needs financial support to sustain its continued security, bug fixes and improvements. In addition to maintenance and stability there are many desirable features and new interchange formats we would like to add. If your company is using Basis Universal in a product, please consider reaching out.)</sub>
|
||||
# basis_universal v2.1
|
||||
An LDR/HDR portable GPU supercompressed texture transcoding system.
|
||||
|
||||
Businesses: support continued development and maintenance via invoiced technical support, maintenance, or sponsoring contracts:
|
||||
<br> _E-mail: info @ binomial dot info_ or contact us on [Twitter](https://twitter.com/_binomial)
|
||||
|
||||
Also see the [Sponsors](https://github.com/BinomialLLC/basis_universal/wiki/Sponsors-and-Supporters) wiki page.
|
||||
[](https://ci.appveyor.com/project/BinomialLLC/basis-universal)
|
||||
|
||||
----
|
||||
|
||||
[](https://ci.appveyor.com/project/BinomialLLC/basis-universal)
|
||||
Intro
|
||||
-----
|
||||
|
||||
Basis Universal is a ["supercompressed"](http://gamma.cs.unc.edu/GST/gst.pdf) GPU texture data interchange system that supports two highly compressed intermediate file formats (.basis or the [.KTX2 open standard from the Khronos Group](https://github.khronos.org/KTX-Specification/)) that can be quickly transcoded to a [very wide variety](https://github.com/BinomialLLC/basis_universal/wiki/OpenGL-texture-format-enums-table) of GPU compressed and uncompressed pixel formats: ASTC 4x4 L/LA/RGB/RGBA, PVRTC1 4bpp RGB/RGBA, PVRTC2 RGB/RGBA, BC7 mode 6 RGB, BC7 mode 5 RGB/RGBA, BC1-5 RGB/RGBA/X/XY, ETC1 RGB, ETC2 RGBA, ATC RGB/RGBA, ETC2 EAC R11 and RG11, FXT1 RGB, and uncompressed raster image formats 8888/565/4444.
|
||||
Basis Universal™ v2.1 is an open source [supercompressed](http://gamma.cs.unc.edu/GST/gst.pdf) LDR/HDR GPU compressed texture interchange system from Binomial LLC that supports two intermediate file formats: the [.KTX2 open standard from the Khronos Group](https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html), and our own ".basis" file format. These file formats support rapid transcoding to virtually any compressed [GPU texture format](https://grokipedia.com/page/texture_compression) released over the past quarter century.
|
||||
|
||||
The system now supports two modes: a high quality mode which is internally based off the [UASTC compressed texture format](https://richg42.blogspot.com/2020/01/uastc-block-format-encoding.html), and the original lower quality mode which is based off a subset of ETC1 called "ETC1S". UASTC is for extremely high quality (similar to BC7 quality) textures, and ETC1S is for very small files. The ETC1S system includes built-in data compression, while the UASTC system includes an optional Rate Distortion Optimization (RDO) post-process stage that conditions the encoded UASTC texture data in the .basis file so it can be more effectively LZ compressed by the end user. More technical details about UASTC integration are [here](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-implementation-details).
|
||||
## GPU Textures are Infrastructure
|
||||
|
||||
Basis files support non-uniform texture arrays, so cubemaps, volume textures, texture arrays, mipmap levels, video sequences, or arbitrary texture "tiles" can be stored in a single file. The compressor is able to exploit color and pattern correlations across the entire file, so multiple images with mipmaps can be stored very efficiently in a single file.
|
||||
Our overall goal is to simplify the encoding and efficient distribution of *portable* LDR and HDR GPU texture, image, and short [texture video](https://github.com/BinomialLLC/basis_universal/wiki/Encoding-ETC1S-and-XUASTC-LDR-Texture-Video) content in a way that is compatible with any GPU or rendering/graphics API.
|
||||
|
||||
The system's bitrate depends on the quality setting and image content, but common usable ETC1S bitrates are .3-1.25 bits/texel. ETC1S .basis files are typically 10-25% smaller than using RDO texture compression of the internal texture data stored in the .basis file followed by LZMA. For UASTC files, the bitrate is fixed at 8bpp, but with RDO post-processing and user-provided LZ compression on the .basis file the effective bitrate can be as low as 2bpp for video or for individual textures approximately 4-6bpp.
|
||||
The system supports seven modes (or codecs). In the order they were implemented:
|
||||
1. **ETC1S**: A supercompressed subset of ETC1 designed for very fast transcoding to other LDR texture formats, low/medium quality but high compression, slightly faster transcoding to other LDR texture formats vs. libjpeg.
|
||||
2. **UASTC LDR 4x4 (with or without RDO)**: Custom ASTC 4x4-like format designed for very fast transcoding to other LDR texture formats, high quality
|
||||
3. **UASTC HDR 4x4**: Standard ASTC HDR 4x4 texture data, but constrained for very fast transcoding to BC6H
|
||||
4. **ASTC HDR 6x6 (with or without RDO)**: Standard ASTC HDR 6x6
|
||||
5. **UASTC HDR 6x6 Intermediate ("GPU Photo HDR")**: Supercompressed ASTC HDR 6x6
|
||||
6. **ASTC LDR 4x4-12x12 (all 14 standard ASTC block sizes, with or without basic windowed RDO)**: Standard ASTC LDR 4x4-12x12
|
||||
7. **XUASTC LDR 4x4-12x12 (all 14 standard ASTC block sizes, "GPU Photo LDR/SDR")**: Latent-space supercompressed ASTC LDR with Weight Grid DCT ([Discrete Cosine Transform](https://grokipedia.com/page/Discrete_cosine_transform)) for very high quality, extreme bitrate scalability, optional adaptive deblocking (CPU or using a [simple GPU pixel shader](https://github.com/BinomialLLC/basis_universal/tree/master/shader_deblocking) compatible with mipmapping and filtering), three entropy coding profiles (Zstd, arithmetic or hybrid). See [JPEG for ASTC](https://github.com/BinomialLLC/basis_universal/wiki/JPEG-for-ASTC), and the [ASTC and XUASTC LDR Usage Guide](https://github.com/BinomialLLC/basis_universal/wiki/ASTC-and-XUASTC-LDR-Usage-Guide).
|
||||
|
||||
The .basis and .KTX2 transcoders have been fuzz tested using [zzuf](https://www.linux.com/news/fuzz-testing-zzuf).
|
||||
The C/C++ encoder and transcoder libraries can be compiled to native code or WebAssembly (web or WASI), and all encoder/transcoder features can be accessed from JavaScript via a C++ wrapper library which optionally supports [WASM multithreading](https://web.dev/articles/webassembly-threads) for fast encoding in the browser. [WASM WASI](https://wasi.dev/) builds, for the command line tool and the encoder/transcoder as a WASI module using a pure C API, are also supported.
|
||||
|
||||
So far, we've compiled the code using MSVC 2019, under Ubuntu 18.04 and 20 x64 using cmake with either clang 3.8 or gcc 5.4, and emscripten 1.35 to asm.js. (Be sure to use this version or later of emcc, as earlier versions fail with internal errors/exceptions during compilation.)
|
||||
Full Python support for encoding/transcoding is now available, supporting native or WASM modules, but is still in the early stages of development.
|
||||
|
||||
Basis Universal supports "skip blocks" in ETC1S compressed texture arrays, which makes it useful for basic [compressed texture video](http://gamma.cs.unc.edu/MPTC/) applications. Note that Basis Universal is still at heart a GPU texture compression system, not a dedicated video codec, so bitrates will be larger than even MPEG1.
|
||||
1/10/21 release notes:
|
||||
License/Legal
|
||||
-------------
|
||||
|
||||
For v1.13, we've added numerous ETC1S encoder optimizations designed to greatly speed up single threaded encoding time, as well as greatly reducing overall CPU utilization when multithreading is enabled. For benchmarking, we're using "-q 128 -no_multithreading -mip_fast". The encoder now uses approximately 1/3rd as much total CPU time for the same PSNR. The encoder can now optionally utilize SSE 4.1 - see the "-no_sse" command line option.
|
||||
The reference encoder library, transcoder, and most specification documents in this repo (unless otherwise explictly indicated) are Copyright © 2016–2026 Binomial LLC. All rights reserved except as granted under the [Apache 2.0 LICENSE](https://github.com/BinomialLLC/basis_universal/blob/master/LICENSE). Basis Universal™ is a trademark of Binomial LLC. KTX™ is a trademark of [The Khronos Group Inc.](https://www.khronos.org/ktx/) See our Apache 2.0 [NOTICE file](https://github.com/BinomialLLC/basis_universal/wiki/NOTICE). If you modify the Basis Universal reference source code, specifications, or wiki documents and redistribute the files, you must cause any modified files to carry prominent notices stating that you changed the files (see Apache 2.0 §4(b)).
|
||||
|
||||
[Release Notes](https://github.com/BinomialLLC/basis_universal/wiki/Release-Notes)
|
||||
See our [DEP5 file](https://github.com/BinomialLLC/basis_universal/blob/master/.reuse/dep5) for the complete list of software and their licenses in this repo. The encoder library is Apache 2.0, but it utilizes some open source 3rd party modules (in 'encoder/3rdparty' and in the 'Zstd' directory) to load [.QOI](https://qoiformat.org/), [.DDS](https://github.com/DeanoC/tiny_dds), [.EXR](https://github.com/syoyo/tinyexr) images, to handle [Zstd](https://github.com/facebook/zstd) compression, and to unpack ASTC texture blocks. See the [LICENSES](https://github.com/BinomialLLC/basis_universal/tree/master/LICENSES) folder. The transcoder utilizes no 3rd party libraries or dependencies, other than Zstd (which is optional but limits the transcoder to non-Zstd utilizing codecs).
|
||||
|
||||
### The first texture (and possibly image/video) compression codec developed without "Lena"
|
||||
Links
|
||||
-----
|
||||
|
||||
We retired Lena years ago. No testing is done with this image:
|
||||
- [Wiki/Specifications](https://github.com/BinomialLLC/basis_universal/wiki)
|
||||
- [Release Notes](https://github.com/BinomialLLC/basis_universal/wiki/Release-Notes)
|
||||
- [Live Compression/Transcoding Testbed](https://subquantumtech.com/xu/ktx2_encode_test/) - A WASM64 compatible browser is recommended (such as Chrome/Edge/Firefox), especially for XUASTC LDR compression, but it works under plain WASM too (with resolution limits due to less available memory).
|
||||
- [Live WebGL Examples](https://subquantumtech.com/xu/)
|
||||
- [JavaScript API/WASM/WebGL info](https://github.com/BinomialLLC/basis_universal/tree/master/webgl)
|
||||
- [XUASTC LDR Specification](https://github.com/BinomialLLC/basis_universal/wiki/XUASTC-LDR-Specification-v1.0)
|
||||
|
||||
https://www.losinglena.com/
|
||||
### UASTC HDR 4x4/6x6 Specific Links:
|
||||
|
||||
### Quick Introduction
|
||||
- [UASTC HDR 4x4 Example Images](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-Examples)
|
||||
- [UASTC HDR 6x6 Example Images](https://github.com/BinomialLLC/basis_universal/wiki/ASTC-HDR-6x6-Example-Images)
|
||||
- [UASTC HDR 6x6 Support Notes](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Support-Notes)
|
||||
- [Quick comparison of ARM's astcenc HDR 6x6 encoder vs. ours](https://github.com/richgel999/junkdrawer/wiki/ASTC-HDR-6x6-Encoder-Comparisons)
|
||||
|
||||
Probably the most important concept to understand about Basis Universal before using it: The system supports **two** very different universal texture modes: The original "ETC1S" mode is low/medium quality, but the resulting file sizes are very small because the system has built-in compression for ETC1S texture format files. This is the command line encoding tool's default mode. ETC1S textures work best on images, photos, map data, or albedo/specular/etc. textures, but don't work as well on normal maps.
|
||||
----
|
||||
|
||||
There's the second "UASTC" mode, which is significantly higher quality (comparable to BC7 and highest quality LDR ASTC 4x4), and is usable on all texture types including complex normal maps. UASTC mode purposely does not have built-in file compression like ETC1S mode does, so the resulting files are quite large (8-bits/texel - same as BC7) compared to ETC1S mode. The UASTC encoder has an optional Rate Distortion Optimization (RDO) encoding mode (implemented as a post-process over the encoded UASTC texture data), which conditions the output texture data in a way that results in better lossless compression when UASTC .basis files are compressed with Deflate/Zstd, etc. In UASTC mode, you must losslessly compress .basis files yourself. .KTX2 files have built-in lossless compression support using [Zstandard](https://facebook.github.io/zstd/), which is used by default on UASTC textures.
|
||||
Supported LDR GPU Texture Formats
|
||||
---------------------------------
|
||||
|
||||
Basis Universal is not an image compression codec, but a GPU texture compression codec. It can be used just like an image compression codec, but that's not the only use case. Here's a [good intro](http://renderingpipeline.com/2012/07/texture-compression/) to GPU texture compression. If you're looking to primarily use the system as an image compression codec on sRGB photographic content, use the default ETC1S mode, because it has built-in compression.
|
||||
ETC1S, UASTC LDR 4x4, XUASTC LDR 4x4-12x12 and ASTC LDR 4x4-12x12 files can be transcoded to:
|
||||
- ASTC LDR 4x4 L/LA/RGB/RGBA 8bpp
|
||||
- ASTC LDR 4x4-12x12 (XUASTC/ASTC), 0.89-8bpp
|
||||
- BC1-5 RGB/RGBA/X/XY
|
||||
- BC7 RGB/RGBA
|
||||
- ETC1 RGB, ETC2 RGBA, and ETC2 EAC R11/RG11
|
||||
- PVRTC1 4bpp RGB/RGBA and PVRTC2 RGB/RGBA
|
||||
- ATC RGB/RGBA and FXT1 RGB
|
||||
- Uncompressed LDR raster image formats: 8888/565/4444
|
||||
|
||||
**The "-q X" option controls the output quality in ETC1S mode.** The default is quality level 128. "-q 255" will increase quality quite a bit. If you want even higher quality, try "-max_selectors 16128 -max_endpoints 16128" instead of -q. -q internally tries to set the codebook sizes (or the # of quantization intervals for endpoints/selectors) for you. You need to experiment with the quality level on your content.
|
||||
Supported HDR GPU Texture Formats
|
||||
---------------------------------
|
||||
|
||||
For tangent space normal maps, you should separate X into RGB and Y into Alpha, and provide the compressor with 32-bit/pixel input images. Or use the "-separate_rg_to_color_alpha" command line option which does this for you. The internal texture format that Basis Universal uses (ETC1S) doesn't handle tangent space normal maps encoded into RGB well. You need to separate the channels and recover Z in the pixel shader using z=sqrt(1-x^2-y^2).
|
||||
UASTC HDR 4x4, ASTC HDR 6x6, and UASTC HDR 6x6 files can be transcoded to:
|
||||
- ASTC HDR 4x4 (8bpp, UASTC HDR 4x4 only)
|
||||
- ASTC HDR 6x6 RGB (3.56bpp, ASTC HDR 6x6 or UASTC HDR 6x6 intermediate only)
|
||||
- BC6H RGB (8bpp, either UASTC HDR 4x4 or UASTC HDR 6x6)
|
||||
- Uncompressed HDR raster image formats: RGB_16F/RGBA_16F (half float/FP16 RGB, 48 or 64bpp), or 32-bit/pixel shared exponent [RGB_9E5](https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt)
|
||||
|
||||
### License and 3rd party code dependencies
|
||||
----
|
||||
|
||||
Detailed legal, license, and IP information is [here](https://github.com/BinomialLLC/basis_universal/wiki/Legal-IP-License-Information). Basis Universal itself uses the Apache 2.0 licenses, but it also utilizes some optional BSD code (Zstandard). The supported texture formats are [open Khronos Group standards](https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.html).
|
||||
Supported Texture Compression/Supercompression Modes
|
||||
----------------------------------------------------
|
||||
|
||||
All C/C++ code dependencies are present inside the Basis Universal repo itself to simplify building.
|
||||
1. **[ETC1S](https://github.com/BinomialLLC/basis_universal/wiki/.basis-File-Format-and-ETC1S-Texture-Video-Specification)**: A roughly .3-3bpp low to medium quality supercompressed mode based on a subset of [ETC1](https://en.wikipedia.org/wiki/Ericsson_Texture_Compression) called "ETC1S". This mode supports variable quality vs. file size levels (like JPEG), alpha channels, built-in compression, and texture arrays optionally compressed as a video sequence using skip blocks ([Conditional Replenishment](https://en.wikipedia.org/wiki/MPEG-1)). This mode can be rapidly transcoded to all of the supported LDR texture formats.
|
||||
|
||||
The encoder optionally uses Zstandard's single source file compressor (in zstd/zstd.c) to support compressing supercompressed KTX2 files. The stand-alone transcoder (in the "transcoder" directory) is a single .cpp source file library which has no 3rd party code dependencies apart from zstd/zstddeclib.c, which is also technically optional. It's only used for decompressing UASTC KTX2 files that use Zstandard.
|
||||
2. **[UASTC LDR 4x4](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-LDR-4x4-Texture-Specification)**: An 8 bits/pixel LDR high quality mode. UASTC LDR is a 19 mode subset of the standard [ASTC LDR](https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression) 4x4 (8bpp) texture format, but with a custom block format containing transcoding hints. Transcoding UASTC LDR to ASTC LDR and BC7 is particularly fast and simple, because UASTC LDR is a common subset of both BC7 and ASTC. The transcoders for the other texture formats are accelerated by several format-specific hint bits present in each UASTC LDR block.
|
||||
|
||||
### Command Line Compression Tool
|
||||
This mode supports an optional [Rate-Distortion Optimized (RDO)](https://en.wikipedia.org/wiki/Rate%E2%80%93distortion_optimization) post-process stage that conditions the encoded UASTC LDR texture data in the .KTX2/.basis file so it can be more effectively LZ compressed. More details [here](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-implementation-details).
|
||||
|
||||
The command line tool used to create, validate, and transcode/unpack .basis/.KTX2 files is named "basisu". Run basisu without any parameters for help.
|
||||
Here is the [UASTC LDR 4x4 specification document](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-LDR-4x4-Texture-Specification).
|
||||
|
||||
The library and command line tool have no other 3rd party dependencies (that are not already in the repo), so it's pretty easy to build.
|
||||
3. **[UASTC HDR 4x4](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-4x4-Texture-Specification)**: An 8 bits/pixel HDR high quality mode. This is a 24 mode subset of the standard [ASTC HDR](https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression) 4x4 (8bpp) texture format. It's designed to be high quality, supporting the 27 partition patterns in common between BC6H and ASTC, and fast to transcode with very little loss (typically a fraction of a dB PSNR) to the BC6H HDR texture format. Notably, **UASTC HDR 4x4 data is 100% standard ASTC texture data**, so no transcoding at all is required on devices or APIs that support ASTC HDR. This mode can also be transcoded to various 32-64bpp uncompressed HDR texture/image formats.
|
||||
|
||||
To build basisu (without SSE 4.1 support - the default):
|
||||
Here is the [UASTC HDR 4x4 specification document](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-4x4-Texture-Specification-v1.0), and here are some compressed [example images](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-Examples).
|
||||
|
||||
4. **ASTC HDR 6x6 or RDO ASTC HDR 6x6**: A 3.56 bits/pixel (or less with RDO+Zstd) HDR high quality mode. Just like mode #3, **ASTC HDR 6x6 data is 100% standard ASTC texture data**. Here's a [page with details](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Support-Notes). The current encoder supports weight grid upsampling, 1-3 subsets, single or dual planes, CEM's 7 and 11, and all unique ASTC partition patterns.
|
||||
|
||||
The ASTC HDR decoder, used in the transcoder module, supports the entire ASTC HDR format.
|
||||
|
||||
5. **UASTC HDR 6x6 Intermediate ("GPU Photo HDR")**: A custom compressed intermediate format that can be rapidly transcoded to ASTC HDR 6x6, BC6H, and various uncompressed HDR formats. The custom compressed file format is [described here](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Intermediate-File-Format-(Basis-GPU-Photo-6x6)). The format supports 75 unique ASTC configurations, weight grid upsampling, 1-3 subsets, single or dual planes, CEM's 7 and 11, and all unique ASTC partition patterns. One of the first HDR GPU texture codecs supporting the [delta E ITP (ICtCp) colorspace metric](https://www.portrait.com/resource-center/about-deltae-e/) and perceptual saliency maps.
|
||||
|
||||
6. **Standard ASTC LDR-4x4-12x12**. Supports all standard 14 ASTC block sizes. Transcodable from any ASTC block size to any other supported LDR texture format with adaptive deblocking, including BC7 using the [bc7f "one-shot" analytical BC7 encoder](https://github.com/BinomialLLC/basis_universal/wiki/Transcoder-Internals-Analytical-Real-Time-Encoders) (supporting all BC7 modes/features) and ETC1 (using etc1f, which also supports the entire ETC1 format).
|
||||
|
||||
The ASTC LDR decoder, used in the transcoder module, supports the entire standard ASTC LDR format (i.e. not just ASTC texture blocks generated using our encoder). The ASTC LDR transcoder can transcode any block size ASTC (4x4 - 12x12) to the other LDR texture formats.
|
||||
|
||||
7. **XUASTC LDR 4x4-12x12 ("GPU Photo LDR/SDR")**: Supercompressed ASTC with **Weight Grid DCT**, supporting all 14 standard ASTC block sizes, with adaptive deblocking when transcoding to other texture/pixel formats. Bitrates range from approximately 0.3–5.7 bpp, depending on content, profile, block size, windowed RDO, and Weight Grid DCT quality settings. Typical XUASTC LDR 4×4 (**8 bpp in memory**) transmission/on-disk bitrate with Weight Grid DCT (where it is least effective) is **1.15–3.5 bpp (typical ≈2.25 bpp)**, with larger block sizes achieving even lower usable bitrates, down to approximately 0.3 bpp. Like ASTC LDR, the XUASTC LDR transcoder can transcode any block size ASTC (4x4 - 12x12) to the other LDR texture formats, but with additional block-size specific optimizations.
|
||||
|
||||
Supports three profiles: context-based range/arithmetic coding (for higher compression ratios), Zstd (for faster and simpler transcoding), or a hybrid profile using both approaches. Transcodable to all other supported LDR texture formats, including fully featured (all 8 modes, all dual-plane channel configurations, all mode settings) BC7. Certain common block sizes (4×4, 6×6, and 8×6) have specializations for particularly fast transcoding directly to BC7, bypassing analytical BC7 encoding (using [bc7f](https://github.com/BinomialLLC/basis_universal/wiki/Transcoder-Internals-Analytical-Real-Time-Encoders)) entirely for the most common ASTC configurations (solid color and single-subset CEMs).
|
||||
|
||||
Weight Grid DCT can be disabled; however, supercompression remains available with optional, configurable windowed RDO. Compatible with all major image and texture content types, including photographic images, lightmaps, albedo/specular textures, various types of normal maps, luminance-only maps, and geospatial mapping signals.
|
||||
|
||||
Supports adaptive deblocking when transcoding from larger block sizes; this can be disabled using a transcoder flag.
|
||||
|
||||
One interesting use of XUASTC LDR which works with any of the 14 block sizes: the efficient distribution of texture content compressed to very low bitrates vs. older systems, resulting in game-changing download time reductions. Using the larger XUASTC block sizes (beyond 6x6) with Weight Grid DCT and adaptive deblocking on either the CPU or [GPU using a simple shader](https://github.com/BinomialLLC/basis_universal/tree/master/shader_deblocking), **any developer can now distribute texture and image content destined for BC7 at .35-1.5 bpp**, and **cache the transcoded BC7 data on a modern Gen 4 or 5 (10+ GB/sec.) SSD**.
|
||||
|
||||
XUASTC LDR supports the following ASTC configurations: L/LA/RGB/RGBA CEMs; base+scale or RGB/RGBA direct; base+offset CEMs; Blue Contraction encoding; 1–3 subsets; all partition patterns; and single- or dual-plane modes. Here is the [XUASTC LDR specification](https://github.com/BinomialLLC/basis_universal/wiki/XUASTC-LDR-Specification-v1.0). Also see the [ASTC and XUASTC LDR Usage Guide](https://github.com/BinomialLLC/basis_universal/wiki/ASTC-and-XUASTC-LDR-Usage-Guide).
|
||||
|
||||
Notes:
|
||||
- Mode #1 (ETC1S) has special support and optimizations for basic temporal supercompression ([texture video](https://github.com/BinomialLLC/basis_universal/wiki/Encoding-ETC1S-and-XUASTC-LDR-Texture-Video)).
|
||||
- Modes #3 (UASTC HDR 4x4) and #4 (RDO ASTC HDR 6x6), and #6 (ASTC LDR 4x4-12x12) output 100% standard ASTC texture data (with or without RDO), like any other ASTC encoder. The .KTX2 files are just plain textures.
|
||||
- The other modes (#1, #2, #5, #7) output compressed data in various custom supercompressed formats, which our transcoder library can convert in real-time to various GPU texture or pixel formats.
|
||||
- Modes #4 (ASTC HDR 6x6) and #5 (UASTC HDR 6x6) internally use the same unified ASTC HDR 6x6 encoder.
|
||||
- Modes #6 (ASTC LDR 4x4-12x12) and #7 (XUASTC LDR 4x4-12x12) internally use the same unified ASTC LDR ASTC encoder.
|
||||
|
||||
### Other Features
|
||||
|
||||
Both .basis and .KTX2 files support mipmap levels, texture arrays, cubemaps, cubemap arrays, and texture video, in all modes. Additionally, .basis files support non-uniform texture arrays, where each image in the file can have a different resolution or number of mipmap levels.
|
||||
|
||||
In ETC1S mode, the compressor is able to exploit color and pattern correlations across all the images in the entire file using global endpoint/selector codebooks, so multiple images with mipmaps can be stored efficiently in a single file. The ETC1S mode also supports skip blocks (Conditional Replenishment) for short video sequences, to prevent sending blocks which haven't changed relative to the previous frame.
|
||||
|
||||
The LDR image formats supported for reading are .PNG, [.DDS with mipmaps](https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide), .TGA, .QOI, and .JPG. The HDR image formats supported for reading are .EXR, .HDR, and .DDS with mipmaps. The library can write .basis, .KTX2, .DDS, .KTX (v1), .ASTC, .OUT, .EXR, and .PNG files.
|
||||
|
||||
The system now supports loading basic 2D .DDS files with optional mipmaps, but the .DDS file must be in one of the supported uncompressed formats: 24bpp RGB, 32bpp RGBA/BGRA, half-float RGBA, or float RGBA. Using .DDS files allows the user to control exactly how the mipmaps are generated before compression.
|
||||
|
||||
----
|
||||
|
||||
Building (Native)
|
||||
-----------------
|
||||
|
||||
The encoding library and command line tool have no required 3rd party dependencies that are not already in the repo itself. The transcoder is a single .cpp source file (in `transcoder/basisu_transcoder.cpp`) which has no 3rd party dependencies.
|
||||
|
||||
We build and test under:
|
||||
- Windows x86/x64 using Visual Studio 2026, MSVC or clang
|
||||
- Windows ARM using Visual Studio 2022 ARM 17.13.0
|
||||
- Ubuntu Linux 24.04.3 LTS (noble) with gcc 13.3.0 or clang 18.1.3
|
||||
- macOS (M1) with clang 16.0.0
|
||||
- Arch Linux ARM, on a [Pinebook Pro](https://pine64.org/devices/pinebook_pro/), with gcc 12.1.
|
||||
- Ubuntu Linux 24.04 on RISC-V (Orange PI RV2)
|
||||
- cmake: 3.28.3, emcc: 4.0.19
|
||||
|
||||
Under Windows with Visual Studio you can use the included `basisu.sln` file. Alternatively, you can use cmake to create new VS solution/project files.
|
||||
|
||||
To build, first [install cmake](https://cmake.org/), then:
|
||||
|
||||
```
|
||||
cmake CMakeLists.txt
|
||||
make
|
||||
```
|
||||
To build with SSE 4.1 support on x86/x64 systems (encoding is roughly 15-30% faster):
|
||||
```
|
||||
cmake -D SSE=TRUE CMakeLists.txt
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
For Visual Studio 2019, you can now either use the CMakeLists.txt file or the included `basisu.sln` file. Earlier versions of Visual Studio (particularly 2017) should work but aren't actively tested. We develop with the most up to date version of 2019.
|
||||
To build with SSE 4.1 support on x86/x64 systems (ETC1S encoding is roughly 15-30% faster), add `-DBASISU_SSE=TRUE` to the cmake command line. Add `-DBASISU_OPENCL=TRUE` to build with (optional) OpenCL support. Use `-DCMAKE_BUILD_TYPE=Debug` to build in debug. To build 32-bit executables, add `-DBASISU_BUILD_X64=FALSE`.
|
||||
|
||||
To compress a sRGB PNG/BMP/TGA/JPEG image to an ETC1S .KTX2 file:
|
||||
After building, the native command line tool used to create, validate, and transcode/unpack .KTX2/.basis files is `bin/basisu`.
|
||||
|
||||
`basisu -ktx2 x.png`
|
||||
*Note we use C++17 for compiling the software. Anything later is too new for us. Compiling the software with a newer C++ version is not supported by us yet.*
|
||||
|
||||
To compress a sRGB PNG/BMP/TGA/JPEG image to an UASTC .KTX2 file:
|
||||
----
|
||||
|
||||
`basisu -ktx2 -uastc x.png`
|
||||
Running the Precompiled WASM WASI Executables
|
||||
---------------------------------------------
|
||||
|
||||
To compress a sRGB PNG/BMP/TGA/JPEG image to an RDO UASTC .KTX2 file with mipmaps:
|
||||
For smaller images/textures (~4 megatexels or less), there are precompiled, secure, cross-platform 32-bit .WASM WASI executables checked into the `bin` directory: `basisu_mt.wasm` (multithreaded) and `basisu_st.wasm` (single threaded). Quick testing - ETC1S/UASTC LDR 4x4 (all platforms) - multithreaded and single threaded, using [wasmtime](https://wasmtime.dev/):
|
||||
|
||||
`basisu -ktx2 -uastc -uastc_rdo_l 1.0 -mipmap x.png`
|
||||
Tested with wasmtime v39.0.0:
|
||||
|
||||
To compress a sRGB PNG/BMP/TGA/JPEG image to an ETC1S .basis file:
|
||||
```
|
||||
cd bin
|
||||
wasmtime run --dir=. --dir=../test_files --wasm threads=yes --wasi threads=yes ./basisu_mt.wasm -test
|
||||
wasmtime run --dir=. --dir=../test_files ./basisu_st.wasm -test
|
||||
```
|
||||
|
||||
`basisu x.png`
|
||||
For newer versions of wasmtime such as v42.0.1 add `--wasm shared-memory=yes`:
|
||||
|
||||
To compress a image to a higher quality UASTC .basis file:
|
||||
```
|
||||
wasmtime run --dir=. --dir=../test_files --wasm threads=yes --wasm shared-memory=yes --wasi threads=yes ./basisu_mt.wasm -test
|
||||
```
|
||||
|
||||
`basisu -uastc -uastc_level 2 x.png`
|
||||
See the `runwt.sh`, `runwt.bat`, `runw.sh`, or `runw.bat` scripts for examples on how to run the WASM executables using wasmtime. Windows example for XUASTC LDR 6x6 compression using the arithmetic profile, with Weight Grid DCT level 70:
|
||||
|
||||
To compress a image to a higher quality UASTC .basis file with RDO post processing, so the .basis file is more compressible:
|
||||
```
|
||||
cd bin
|
||||
runwt.bat ../test_files/tough.png -xuastc_ldr_6x6 -quality 70 -xuastc_arith
|
||||
runwt.bat tough.ktx2
|
||||
```
|
||||
|
||||
`basisu -uastc -uastc_level 2 -uastc_rdo_l .75 x.png`
|
||||
Linux/macOS:
|
||||
|
||||
-uastc_level X ranges from 0-4 and controls the UASTC encoder's performance vs. quality tradeoff. Level 0 is very fast, but low quality, level 2 is the default quality, while level 3 is the highest practical quality. Level 4 is impractically slow, but highest quality.
|
||||
```
|
||||
cd bin
|
||||
chmod +x runwt.sh
|
||||
./runwt.sh ../test_files/tough.png -xuastc_ldr_6x6 -quality 70 -xuastc_arith
|
||||
./runwt.sh tough.ktx2
|
||||
```
|
||||
|
||||
-uastc_rdo_l X controls the rate distortion stage's quality setting. The lower this value, the higher the quality, but the larger the compressed file size. Good values to try are between .2-3.0. The default is 1.0. RDO post-processing is currently pretty slow, but we'll be optimizing it over time.
|
||||
Unfortunately, 32-bit WASM WASI executables have tradeoffs vs. native executables: Limited memory, and slower performance (somewhat mitigatable using WASM threading, which we support). **32-bit WASM WASI memory constraints limit the maximum image/texture size that can be compressed to ASTC LDR or XUASTC LDR to around 4 megapixels.** (The other codecs have lower memory requirements.) For Web, we support both WASM and WASM64 (with or without threading), which greatly improves the WASM memory situation. As far as we know as of 2/2026, wasmtime supports WASM64, but the WASI SDK still [doesn't officially support the wasm64-wasi target](https://github.com/WebAssembly/wasi-sdk/issues/212), but once it does we'll support it.
|
||||
|
||||
UASTC texture video is supported and has been tested. In RDO mode with 7zip LZMA, we've seen average bitrates between 1-2 bpp. ETC1S mode is recommended for texture video, which gets bitrates around .25-.3 bpp.
|
||||
Building (WASM WASI)
|
||||
--------------------
|
||||
|
||||
Note that basisu defaults to sRGB colorspace metrics. If the input is a normal map, or some other type of non-sRGB (non-photographic) texture content, be sure to use -linear to avoid extra unnecessary artifacts. (Note: Currently, UASTC mode always uses linear colorspace metrics. sRGB and angulate metrics are comming soon.)
|
||||
To build the WASM WASI executables, you will need the [WASM WASI SDK](https://github.com/WebAssembly/wasi-sdk) installed. The `WASI_SDK_PATH` environment variable must be set to the correct path where the SDK is installed.
|
||||
|
||||
To add automatically generated mipmaps to the .basis file, at a higher than default quality level (which ranges from [1,255]):
|
||||
Multithreaded:
|
||||
```
|
||||
mkdir build_wasm_mt
|
||||
cd build_wasm_mt
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PATH/share/cmake/wasi-sdk-pthread.cmake -DCMAKE_BUILD_TYPE=Release -DBASISU_WASM_THREADING=ON ..
|
||||
make
|
||||
```
|
||||
|
||||
`basisu -mipmap -q 190 x.png`
|
||||
Single threaded:
|
||||
```
|
||||
mkdir build_wasm_st
|
||||
cd build_wasm_st
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PATH/share/cmake/wasi-sdk.cmake -DCMAKE_BUILD_TYPE=Release -DBASISU_WASM_THREADING=OFF ..
|
||||
make
|
||||
```
|
||||
|
||||
There are several mipmap options that allow you to change the filter kernel, the filter colorspace for the RGB channels (linear vs. sRGB), the smallest mipmap dimension, etc. The tool also supports generating cubemap files, 2D/cubemap texture arrays, etc.
|
||||
The WASM WASI executables will be placed in the `bin` directory. These platform-independent executables are fully functional, and can be executed using a WASM WASI runtime such as [wasmtime](https://github.com/bytecodealliance/wasmtime).
|
||||
|
||||
To create a slightly higher quality ETC1S .basis file (one with better codebooks) at the default quality level (128) - note this is much slower to encode:
|
||||
----
|
||||
|
||||
### Testing the Codec
|
||||
|
||||
The command line tool includes some automated LDR/HDR encoding/transcoding tests:
|
||||
|
||||
```
|
||||
cd ../bin
|
||||
basisu -test
|
||||
basisu -test_hdr_4x4
|
||||
basisu -test_hdr_6x6
|
||||
basisu -test_hdr_6x6i
|
||||
basisu -test_xuastc_ldr
|
||||
```
|
||||
|
||||
To test the codec in OpenCL mode (must have OpenCL libs/headers/drivers installed and have compiled OpenCL support in by running cmake with `-DBASISU_OPENCL=TRUE`):
|
||||
|
||||
```
|
||||
basisu -test -opencl
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
Compressing and Unpacking .KTX2/.basis Files
|
||||
--------------------------------------------
|
||||
|
||||
- To compress an LDR sRGB PNG/QOI/TGA/JPEG/DDS image to a supercompressed XUASTC LDR 6x6 .KTX2 file, at quality level 75 (**valid quality levels 1-100, where higher values=higher quality**), effort level 4 (**valid effort levels 0-10, higher values=slower compression, default effort is 3**):
|
||||
|
||||
`basisu -xuastc_ldr_6x6 -quality 75 -effort 4 x.png`
|
||||
|
||||
`-quality 100` disables Weight Grid DCT, leaving just lossless supercompression of ASTC. An alias for `-xuastc_ldr_6x6` is `-ldr_6x6i` (where 'i'="intermediate"). All **[14 standard ASTC block sizes](https://developer.nvidia.com/astc-texture-compression-for-game-assets) are supported, from 4x4-12x12**: 4x4, 5x4, 5x5, 6x5, 6x6, 8x5, 8x6, 10x5, 10x6, 8x8, 10x8, 10x10, 12x10 and 12x12. The **XUASTC LDR to BC7 transcoder has special optimizations for several common block sizes: 4x4, 6x6 and 8x6**. When transcoding XUASTC LDR at these particular block sizes, most XUASTC blocks are *directly* transcoded to BC7 (i.e. directly from the XUASTC latent to the BC7 latent), skipping the real-time analytical bc7f encoding step.
|
||||
|
||||
More XUASTC LDR specific options (many of these also apply to standard ASTC - see our [ASTC/XUASTC Usage Guide](https://github.com/BinomialLLC/basis_universal/wiki/ASTC-and-XUASTC-LDR-Usage-Guide)):
|
||||
|
||||
- The options `-xuastc_arith`, `-xuastc_zstd` (the default), and `-xuastc_hybrid` control the **XUASTC LDR profile used**. The arithmetic profile trades off transcoding throughput for roughly 5-18% better compression vs. the Zstd profile, and the hybrid profile is a balance between the two.
|
||||
|
||||
- `-ts` or `-srgb` enables the **sRGB profile (the default)**, and `-tl` or `-linear` **enables the linear profile**. Ideally this setting will match how the ASTC texture is sampled by the GPU. Use linear on normal maps.
|
||||
|
||||
- `-weights X Y Z W` sets the unsigned integer **channel error weights**, used to favor certain channels during compression.
|
||||
|
||||
- Another set of XUASTC specific options overrides the **windowed RDO behavior** (windowed or bounded RDO is a separate and optional perceptual optimization vs. Weight Grid DCT): `-xy` enables and `-xyd` disables windowed RDO. By default, if Weight Grid DCT is not enabled (i.e. `-quality` isn't specified, or is set to 100), windowed RDO is disabled. Windowed RDO is automatically enabled if the quality level is less than 100, unless `-xyd` is specified. Also see the tool's [help text](https://github.com/BinomialLLC/basis_universal/blob/master/cmd_help/cmd_help.txt) for additional windowed RDO options: `-ls_min_psnr`, `-ls_min_alpha_psnr`, `-ls_thresh_psnr`, `-ls_thresh_alpha_psnr`, etc.
|
||||
|
||||
- `-xs` disables 2-3 subset usage, and `-xp` disables dual plane usage (slightly higher compression, faster direct transcoding to BC7 will occur more often)
|
||||
- `-higher_quality_transcoding`: Permits slower but higher quality transcoding
|
||||
- `-no_deblocking`: Disables adaptive deblocking on ASTC block sizes > 8x6 (faster)
|
||||
- `-force_deblocking`: Always use adaptive deblocking filter, even for block sizes <= 8x6 (slower)
|
||||
- `-stronger_deblocking`: Use stronger deblocking when it's enabled (same performance)
|
||||
- `-fast_xuastc_ldr_bc7_transcoding` and `-no_fast_xuastc_ldr_bc7_transcoding`: Controls faster direct XUASTC->BC7 transcoding (defaults to enabled, which is slightly lower quality)
|
||||
|
||||
- To compress an LDR sRGB image to a standard ASTC LDR 6x6 .KTX2 file, using effort level 4 (valid effort levels 0-10):
|
||||
|
||||
`basisu -astc_ldr_6x6 -effort 4 x.png`
|
||||
|
||||
An alias for `-astc_ldr_6x6` is `-ldr_6x6`.
|
||||
|
||||
Just like XUASTC LDR, all 14 standard ASTC block sizes are supported, from 4x4-12x12. Internally the XUASTC LDR encoder is used, but standard ASTC block data is output, instead of supercompressed XUASTC LDR. Most XUASTC LDR options also work in ASTC LDR mode.
|
||||
|
||||
- To compress an LDR sRGB image to an ETC1S .KTX2 file, at quality level 100 (the highest):
|
||||
|
||||
`basisu -quality 100 x.png`
|
||||
|
||||
- For a linear LDR image, in ETC1S mode, at default quality (`-quality 50`, or the older `-q 128`):
|
||||
|
||||
`basisu -linear x.png`
|
||||
|
||||
- To compress to UASTC LDR 4x4, which is much higher quality than ETC1S, but lower maximum quality vs. ASTC/XUASTC LDR 4x4:
|
||||
|
||||
`basisu -uastc x.png`
|
||||
|
||||
- To compress an [.EXR](https://en.wikipedia.org/wiki/OpenEXR), [Radiance .HDR](https://paulbourke.net/dataformats/pic/), or .DDS HDR image to a UASTC HDR 4x4 .KTX2 file:
|
||||
|
||||
`basisu x.exr`
|
||||
|
||||
- To compress a standard ASTC HDR 6x6 file (~3.56 bpp):
|
||||
|
||||
```
|
||||
basisu -hdr_6x6 x.exr
|
||||
basisu -hdr_6x6 -lambda 500 x.exr
|
||||
basisu -hdr_6x6_level 5 -lambda 500 x.exr
|
||||
```
|
||||
|
||||
- To compress a UASTC HDR 6x6i file (using the compressed intermediate format) for smaller files (~1.75-3.0 bpp):
|
||||
|
||||
```
|
||||
basisu -hdr_6x6i x.exr
|
||||
basisu -hdr_6x6i -lambda 500 x.exr
|
||||
basisu -hdr_6x6i_level 5 -lambda 500 x.exr
|
||||
```
|
||||
|
||||
Note the unified `-quality` and `-effort` options work in HDR, too. These examples use the older non-unified options, which allow more direct/precise control.
|
||||
|
||||
Be aware that the .EXR reader we use is [TinyEXR's](https://github.com/syoyo/tinyexr), which doesn't support all possible .EXR compression modes. Tools like [ImageMagick](https://imagemagick.org/) can be used to create .EXR files that TinyEXR can read.
|
||||
|
||||
Alternatively, LDR images (such as .PNG) can be compressed to an HDR format by specifying `-hdr`, `-hdr_6x6`, or `-hdr_6x6i`. By default LDR images, when compressed to an HDR format, are first upconverted to HDR by converting them from sRGB to linear light and scaled to 100 [nits - candela per sq. meter, cd/m²](https://grokipedia.com/page/Candela_per_square_metre). The sRGB conversion step can be disabled by specifying `-hdr_ldr_no_srgb_to_linear`, and the normalized RGB linear light to nit multiplier can be changed by specifying `-hdr_ldr_upconversion_nit_multiplier X`.
|
||||
|
||||
Note: If you're compressing LDR/SDR image files to an HDR format, the codec's default behavior is to convert the 8-bit image data to linear light (by undoing the sRGB transfer function). It then multiplies the linear light RGB values by the LDR->HDR upconversion multiplier, which is in nits. In previous versions of the codec, this multiplier was effectively 1 nit, but it now defaults to 100 nits in all modes. (The typical luminance of LDR monitors is 80-100 nits.) To change this, use the "-hdr_ldr_upconversion_nit_multiplier X" command line option. (This is done because the HDR 6x6 codecs function internally in the [ICtCp HDR colorspace](https://en.wikipedia.org/wiki/ICtCp). LDR/SDR images must be upconverted to linear light HDR images scaled to a proper max. luminance based on how the image data will be displayed on actual SDR/HDR monitors.)
|
||||
|
||||
### Some Useful Command Line Options
|
||||
|
||||
- All codecs now support simple unified "quality" and "effort" settings. `-effort X` [0,10] controls how much of the search space (and how slowly) compression proceeds, and `-quality X` [1,100] controls the quality vs. bitrate tradeoff. Internally these settings will be mapped to each codec's specific configuration settings. Almost all the older settings still work, however. Previously, `-q X`, where X ranged from [1,255], controlled the ETC1S quality setting. This option is still available, but `-quality` is preferred now.
|
||||
|
||||
- `-debug` causes the encoder to print internal and developer-oriented verbose debug information.
|
||||
|
||||
- `-stats` to see various quality (PSNR) statistics.
|
||||
|
||||
- `-linear`: ETC1S defaults to sRGB colorspace metrics, UASTC LDR currently always uses linear metrics, and UASTC HDR defaults to weighted RGB metrics (with 2,3,1 weights). If the input is a normal map, or some other type of non-sRGB (non-photographic) texture content, be sure to use `-linear` to avoid extra unnecessary artifacts. (Angular normal map metrics for UASTC LDR/HDR are definitely doable and on our TODO list.)
|
||||
|
||||
- Specifying `-opencl` enables OpenCL mode, which currently only accelerates ETC1S encoding if it's been enabled at compile time.
|
||||
|
||||
- The compressor is multithreaded by default, which can be disabled using the `-no_multithreading` command line option. The transcoder is currently single threaded, although it is thread safe (i.e. it supports decompressing multiple texture slices in parallel).
|
||||
|
||||
More Example Command Lines
|
||||
--------------------------
|
||||
|
||||
- To compress an sRGB PNG/QOI/TGA/JPEG/DDS image to an RDO (Rate-Distortion Optimization) UASTC LDR .KTX2 file with mipmaps:
|
||||
|
||||
`basisu -uastc -uastc_rdo_l 1.0 -mipmap x.png`
|
||||
|
||||
`-uastc_rdo_l X` controls the RDO ([Rate-Distortion Optimization](https://en.wikipedia.org/wiki/Rate%E2%80%93distortion_optimization)) quality setting. The lower this value, the higher the quality, but the larger the compressed file size. Good values to try are between .2-3.0. The default is 1.0.
|
||||
|
||||
- To add automatically generated mipmaps to an ETC1S .KTX2 file:
|
||||
|
||||
`basisu -mipmap -quality 75 x.png`
|
||||
|
||||
There are several mipmap options to change the filter kernel, the filter colorspace for the RGB channels (linear vs. sRGB), the smallest mipmap dimension, etc. The tool also supports generating cubemap files, 2D/cubemap texture arrays, etc. To bypass the automatic mipmap generator, you can create LDR or HDR uncompressed [.DDS texture files](https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide) and feed them to the compressor.
|
||||
|
||||
- To create a slightly higher quality ETC1S .KTX2 file (one with higher quality endpoint/selector codebooks) at the default quality level (128) - note this is much slower to encode:
|
||||
|
||||
`basisu -comp_level 2 x.png`
|
||||
|
||||
On some rare images (ones with blue sky gradients come to bind), you may need to increase the ETC1S `-comp_level` setting. This controls the amount of overall effort the encoder uses to optimize the ETC1S codebooks (palettes) and compressed data stream. Higher comp_level's are *significantly* slower, and shouldn't be used unless necessary:
|
||||
On some rare images (ones with blue sky gradients come to mind), you may need to increase the ETC1S `-comp_level` setting, which ranges from 1 to 6. This controls the amount of overall effort the encoder uses to optimize the ETC1S codebooks and the compressed data stream. Higher -comp_level's are *significantly* slower.
|
||||
|
||||
`basisu -ktx2 x.png -comp_level 5 -q 255`
|
||||
- To manually set the ETC1S codebook sizes (instead of using -quality, or the older -q options), with a higher codebook generation level (this is useful with texture video):
|
||||
|
||||
Or try:
|
||||
`basisu -ktx2 x.png -comp_level 5 -max_endpoints 16128 -max_selectors 16128`
|
||||
`basisu x.png -comp_level 2 -max_endpoints 16128 -max_selectors 16128`
|
||||
|
||||
Note `-comp_level`'s 3-4 are almost as good as 5 and are a lot faster.
|
||||
- To [tonemap](https://en.wikipedia.org/wiki/Tone_mapping) an HDR .EXR or .HDR image file to multiple LDR .PNG files at different exposures, using the Reinhard tonemap operator:
|
||||
|
||||
The compressor is multithreaded by default, but this can be disabled using the `-no_multithreading` command line option. The transcoder is currently single threaded although it supports multithreading decompression of multiple texture slices in parallel.
|
||||
`basisu -tonemap x.exr`
|
||||
|
||||
### Unpacking .basis/.KTX2 files to .PNG/.KTX files
|
||||
- To compare two LDR images and print PSNR statistics:
|
||||
|
||||
You can either use the command line tool or [call the transcoder directly](https://github.com/BinomialLLC/basis_universal/wiki/How-to-Use-and-Configure-the-Transcoder) from JavaScript or C/C++ code to decompress .basis/.KTX2 files to GPU texture data or uncompressed images.
|
||||
`basisu -compare a.png b.png`
|
||||
|
||||
To use the command line tool to unpack a .basis or .KTX2 file to multiple .png/.ktx files:
|
||||
- To compare two HDR .EXR/.HDR images and print FP16 PSNR statistics:
|
||||
|
||||
`basisu x.basis`
|
||||
`basisu -compare_hdr a.exr b.exr`
|
||||
|
||||
Use the `-no_ktx` and `-etc1_only` options to unpack to less files. `-info` and `-validate` will just display file information and not output any files. The output .KTX1 files are currently in the KTX1 file format, not KTX2.
|
||||
See the help text for a complete listing of the tool's command line options. The command line tool is just a thin wrapper on top of the encoder library.
|
||||
|
||||
The mipmapped or cubemap .KTX files will be in a wide variety of compressed GPU texture formats (PVRTC1 4bpp, ETC1-2, BC1-5, BC7, etc.), and to my knowledge there is no single .KTX viewer tool that correctly and reliably supports every GPU texture format that we support. BC1-5 and BC7 files are viewable using AMD's Compressonator, ETC1/2 using Mali's Texture Compression Tool, and PVRTC1 using Imagination Tech's PVRTexTool. Links:
|
||||
Unpacking .KTX2/.basis files to .PNG/.EXR/.KTX/.DDS files
|
||||
---------------------------------------------------------
|
||||
|
||||
[Mali Texture Compression Tool](https://developer.arm.com/tools-and-software/graphics-and-gaming/graphics-development-tools/mali-texture-compression-tool)
|
||||
You can either use the command line tool or [call the transcoder directly](https://github.com/BinomialLLC/basis_universal/wiki/How-to-Use-and-Configure-the-Transcoder) from JavaScript or C/C++ code to decompress .KTX2/.basis files to GPU texture data or uncompressed image data. To unpack a .KTX2 or .basis file to multiple .png/.exr/.ktx/.dds files:
|
||||
|
||||
[Compressonator](https://gpuopen.com/gaming-product/compressonator/)
|
||||
`basisu x.ktx2`
|
||||
|
||||
[PVRTexTool](https://www.imgtec.com/developers/powervr-sdk-tools/pvrtextool/)
|
||||
Use the `-no_ktx` and `-etc1_only`/`-format_only` options to unpack to less files.
|
||||
|
||||
After compression, the compressor transcodes all slices in the output .basis file to validate that the file decompresses correctly. It also validates all header, compressed data, and slice data CRC16's.
|
||||
`-info` and `-validate` will just display file information and not output any files.
|
||||
|
||||
For best quality, you must **supply basisu with original uncompressed source images**. Any other type of lossy compression applied before basisu (including ETC1/BC1-5, BC7, JPEG, etc.) will cause multi-generational artifacts to appear in the final output textures.
|
||||
The written mipmapped, cubemap, or texture array .KTX/.DDS files will be in a wide variety of compressed GPU texture formats (PVRTC1 4bpp, ETC1-2, BC1-5, BC7, etc.), and to our knowledge there is unfortunately (as of 2024) still no single .KTX or .DDS viewer tool that correctly and reliably supports every GPU texture format that we support. BC1-5 and BC7 files are viewable using AMD's Compressonator, ETC1/2 using Mali's Texture Compression Tool, and PVRTC1 using Imagination Tech's PVRTexTool. [RenderDoc](https://renderdoc.org/) has a useful texture file viewer for many formats. The macOS *Finder* app supports previewing .EXR, .ASTC and .KTX files in various GPU formats, including ASTC LDR/ HDR. The Windows 11 Explorer can preview .DDS files. The [online OpenHDR Viewer](https://viewer.openhdr.org/) is useful for viewing .EXR/.HDR image files.
|
||||
|
||||
For the maximum possible achievable ETC1S mode quality with the current format and encoder (completely ignoring encoding speed!), use:
|
||||
----
|
||||
|
||||
`basisu x.png -comp_level 5 -max_endpoints 16128 -max_selectors 16128 -no_selector_rdo -no_endpoint_rdo`
|
||||
Pixel Shader Deblocking Sample: CPU + GPU Deblocking Everywhere
|
||||
---------------------------------------------------------------
|
||||
|
||||
Level 5 is extremely slow, so unless you have a very powerful machine, levels 1-4 are recommended.
|
||||
The [shader_deblocking sample](https://github.com/BinomialLLC/basis_universal/blob/master/shader_deblocking/README.md) in the repo demonstrates how to use a simple pixel shader to deblock sampled textures of any block size between 4x4-12x12, greatly reducing block artifacts. The sample shader is compatible with mipmapping and bilinear or trilinear filtering. Ultimately, shader deblocking enables the usage of larger ASTC block sizes, reducing bitrate and increasing transcoding speeds. Deblocking is a standard feature of modern image and video codecs, and there's no reason why it can't be used while sampling (or transcoding) GPU textures. Using larger ASTC block sizes can significantly reduce GPU memory bandwidth. If bandwidth is the bottleneck — as it often is — the modest ALU and texture sampling cost of deblocking can be effectively free.
|
||||
|
||||
Note that "-no_selector_rdo -no_endpoint_rdo" are optional. Using them hurts rate distortion performance, but increases quality. An alternative is to use -selector_rdo_thresh X and -endpoint_rdo_thresh, with X ranging from [1,2] (higher=lower quality/better compression - see the tool's help text).
|
||||
XUASTC LDR's transcoder supports adaptive deblocking when transcoding to other (non-ASTC) formats like BC7, and GPU shader deblocking can be used for ASTC, resulting in a complete deblocking system for ASTC.
|
||||
|
||||
To compress small video sequences, say using tools like ffmpeg and VirtualDub:
|
||||
----
|
||||
|
||||
`basisu -comp_level 2 -tex_type video -stats -debug -multifile_printf "pic%04u.png" -multifile_num 200 -multifile_first 1 -max_selectors 16128 -max_endpoints 16128 -endpoint_rdo_thresh 1.05 -selector_rdo_thresh 1.05`
|
||||
Python Support
|
||||
--------------
|
||||
|
||||
For video, the more cores your machine has, the better. Basis is intended for smaller videos of a few dozen seconds or so. If you are very patient and have a Threadripper or Xeon workstation, you should be able to encode up to a few thousand 720P frames. The "webgl_videotest" directory contains a very simple video viewer.
|
||||
For texture video, use -comp_level 2 or 3. The default is 1, which isn't quite good enough for texture video. Higher comp_level's result in reduced ETC1S artifacts.
|
||||
All key encoder and all transcoder functionality is now available from Python, but this is still in the early stages of development. See the README files in the python directory for how to build the native SO's/PYD's. The Python support module supports both native and WASM modules, which is used as a fallback if native libraries can't be loaded. Python support has been tested under Ubuntu Linux and Windows 11 so far.
|
||||
|
||||
The .basis file will contain multiple images (all using the same global codebooks), which you can retrieve using the transcoder's image API. The system now supports [conditional replenisment](https://en.wikipedia.org/wiki/MPEG-1) (CR, or "skip blocks"). CR can reduce the bitrate of some videos (highly dependent on how dynamic the content is) by over 50%. For videos using CR, the images must be requested from the transcoder in sequence from first to last, and random access is only allowed to I-Frames.
|
||||
Example:
|
||||
```
|
||||
cd python
|
||||
python3 -m tests.test_backend_loading
|
||||
========== BACKEND LOADING TEST ==========
|
||||
|
||||
If you are doing rate distortion comparisons vs. other similar systems, be sure to experiment with increasing the endpoint RDO threshold (-endpoint_rdo_thresh X). This setting controls how aggressively the compressor's backend will combine together nearby blocks so they use the same block endpoint codebook vectors, for better coding efficiency. X defaults to a modest 1.5, which means the backend is allowed to increase the overall color distance by 1.5x while searching for merge candidates. The higher this setting, the better the compression, with the tradeoff of more block artifacts. Settings up to ~2.25 can work well, and make the codec more competitive. "-endpoint_rdo_thresh 1.75" is a good setting on many textures.
|
||||
Testing native backend...
|
||||
[Encoder] Using native backend
|
||||
[OK] Native backend loaded
|
||||
Hello from basisu_wasm_api.cpp version 200
|
||||
Native get_version() ? 200
|
||||
Native alloc() returned ptr = 190977024
|
||||
Native free() OK
|
||||
[OK] Native basic operations working.
|
||||
|
||||
For video, level 1 should result in decent results on most clips. For less banding, level 2 can make a big difference. This is still an active area of development, and quality/encoding perf. will improve over time.
|
||||
Testing WASM backend...
|
||||
[WASM Encoder] Loaded: /mnt/c/dev/xuastc4/python/basisu_py/wasm/basisu_module_st.wasm
|
||||
[Encoder] Using WASM backend
|
||||
[OK] WASM backend loaded
|
||||
Hello from basisu_wasm_api.cpp version 200
|
||||
WASM get_version() ? 200
|
||||
WASM alloc() returned ptr = 26920160
|
||||
WASM free() OK
|
||||
[OK] WASM basic operations working.
|
||||
|
||||
To control the ETC1S encoder's quality vs. encoding speed tradeoff, see [ETC1S Compression Effort Levels](https://github.com/BinomialLLC/basis_universal/wiki/ETC1S-Compression-Effort-Levels).
|
||||
========== DONE ==========
|
||||
```
|
||||
|
||||
### More Examples
|
||||
----
|
||||
|
||||
`basisu x.png`\
|
||||
Compress sRGB image x.png to a ETC1S format x.basis file using default settings (multiple filenames OK). ETC1S format files are typically very small on disk (around .5-1.5 bits/texel).
|
||||
WebGL Examples
|
||||
--------------
|
||||
|
||||
`basisu -uastc x.png`\
|
||||
Compress image x.png to a UASTC format x.basis file using default settings (multiple filenames OK). UASTC files are the same size as BC7 on disk (8-bpp). Be sure to compress UASTC .basis files yourself using Deflate, zstd, etc. To increase .basis file compressibility (trading off quality for smaller compressed files) use the "-uastc_rdo_q X" command line parameter.
|
||||
The 'WebGL' directory contains several simple WebGL demos that use the transcoder and compressor compiled to [WASM](https://webassembly.org/) with [Emscripten](https://emscripten.org/). These demos are online [here](https://subquantumtech.com/xu/). See more details in the readme file [here](webgl/README.md).
|
||||
|
||||
`basisu -q 255 x.png`\
|
||||
Compress sRGB image x.png to x.basis at max quality level achievable without manually setting the codebook sizes (multiple filenames OK)
|
||||
|
||||
`basisu x.basis`\
|
||||
Unpack x.basis to PNG/KTX files (multiple filenames OK)
|
||||
|
||||
`basisu -validate -file x.basis`\
|
||||
Validate x.basis (check header, check file CRC's, attempt to transcode all slices)
|
||||
|
||||
`basisu -unpack -file x.basis`\
|
||||
Validates, transcodes and unpacks x.basis to mipmapped .KTX and RGB/A .PNG files (transcodes to all supported GPU texture formats)
|
||||
|
||||
`basisu -q 255 -file x.png -mipmap -debug -stats`\
|
||||
Compress sRGB x.png to x.basis at quality level 255 with compressor debug output/statistics
|
||||
|
||||
`basisu -linear -max_endpoints 16128 -max_selectors 16128 -file x.png`\
|
||||
Compress non-sRGB x.png to x.basis using the largest supported manually specified codebook sizes
|
||||
|
||||
`basisu -linear -global_sel_pal -no_hybrid_sel_cb -file x.png`\
|
||||
Compress a non-sRGB image, use virtual selector codebooks for improved compression (but slower encoding)
|
||||
|
||||
`basisu -linear -global_sel_pal -file x.png`\
|
||||
Compress a non-sRGB image, use hybrid selector codebooks for slightly improved compression (but slower encoding)
|
||||
|
||||
`basisu -tex_type video -comp_level 2 -framerate 20 -multifile_printf "x%02u.png" -multifile_first 1 -multifile_count 20 -selector_rdo_thresh 1.05 -endpoint_rdo_thresh 1.05`\
|
||||
Compress a 20 sRGB source image video sequence (x01.png, x02.png, x03.png, etc.) to x01.basis
|
||||
|
||||
`basisu -comp_level 2 -q 255 -file x.png -mipmap -y_flip`\
|
||||
Compress a mipmapped x.basis file from an sRGB image named x.png, Y flip each source image, set encoder to level 2 for slightly higher quality (but slower encoding).
|
||||
|
||||
### WebGL test
|
||||
|
||||
The "WebGL" directory contains three simple WebGL demos that use the transcoder and compressor compiled to wasm with [emscripten](https://emscripten.org/). See more details [here](webgl/README.md).
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### Installation using the vcpkg dependency manager
|
||||
----
|
||||
|
||||
Building the WASM Modules with [Emscripten](https://emscripten.org/)
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Both the transcoder and encoder may be compiled using Emscripten to WebAssembly and used on the web. A set of JavaScript wrappers to the codec, written in C++ with Emscripten extensions, is located in [`webgl/transcoding/basis_wrappers.cpp`](https://github.com/BinomialLLC/basis_universal/blob/master/webgl/transcoder/basis_wrappers.cpp). The JavaScript wrapper supports nearly all features and modes, including texture video. See the [README.md](https://github.com/BinomialLLC/basis_universal/tree/master/webgl) and CMakeLists.txt files in `webgl/transcoder` and `webgl/encoder`.
|
||||
|
||||
To build the WASM transcoder, after installing Emscripten:
|
||||
|
||||
```
|
||||
cd webgl/transcoder/build
|
||||
emcmake cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
To build the WASM encoder:
|
||||
|
||||
```
|
||||
cd webgl/encoder/build
|
||||
emcmake cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
There are several simple encoding/transcoding web demos, located in `webgl/ktx2_encode_test` and `webgl/texture_test`, that show how to use the encoder's and transcoder's JavaScript wrapper APIs. They are [live on the web here](https://subquantumtech.com/xu/).
|
||||
|
||||
----
|
||||
|
||||
Low-level C++ Encoder/Transcoder API Examples
|
||||
---------------------------------------------
|
||||
|
||||
Some simple examples showing how to directly call the C++ encoder and transcoder library APIs are in [`example/example.cpp`](https://github.com/BinomialLLC/basis_universal/blob/master/example/example.cpp).
|
||||
|
||||
----
|
||||
|
||||
Installation using the vcpkg dependency manager
|
||||
-----------------------------------------------
|
||||
|
||||
You can download and install Basis Universal using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
||||
|
||||
@@ -231,88 +493,51 @@ You can download and install Basis Universal using the [vcpkg](https://github.co
|
||||
./vcpkg integrate install
|
||||
vcpkg install basisu
|
||||
|
||||
The Basis Universal port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||
The Basis Universal port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. (9/10/2024: UASTC HDR support is not available here yet.)
|
||||
|
||||
### WebAssembly Support Using Emscripten
|
||||
---
|
||||
|
||||
Both the transcoder and now the compressor (as of 12/17/2020) may be compiled using emscripten to WebAssembly and used on the web. Currently, multithreading is not supported by the compressor when compiled with emscripten. A simple Web compression demo is in webgl/encode_test. All compressor features, including texture video, are supported and fully exposed.
|
||||
Project Policies
|
||||
----------------
|
||||
|
||||
To enable compression support compile the JavaScript wrappers in `webgl/transcoding/basis_wrappers.cpp` with `BASISU_SUPPORT_ENCODING` set to 1. See the webgl/encoding directory.
|
||||
See our wiki page: [Project Policies: PRs, compiler warnings, release cadence etc.](https://github.com/BinomialLLC/basis_universal/wiki/Project-Policies:-PR's,-compiler-warnings,-release-cadence,-etc.).
|
||||
|
||||
### Low-level C++ encoder API
|
||||
----
|
||||
|
||||
You can call the encoder directly, instead of using the command line tool. We'll be adding documentation and some examples by the end of the year. For now, some important notes:
|
||||
KTX2 Support Status
|
||||
-------------------
|
||||
|
||||
First, ALWAYS call ```basisu::basisu_encoder_init()``` to initialize the library. Otherwise, you'll get undefined behavior or black textures.
|
||||
Note as of March 2026 we are working with Khronos on the exact details of how we embed XUASTC LDR supercompressed texture data into the KTX2 file format. KTX2 texture files using our previous codecs (including the recently added UASTC HDR 4x4 and UASTC HDR 6x6i formats) can now be interchanged with other KTX2 tools. See our [KTX2 technical information document](https://github.com/BinomialLLC/basis_universal/wiki/KTX2-File-Format-Support-Technical-Details) for more info.
|
||||
|
||||
Create a job pool, fill in the ```basis_compress_params``` struct, then call ```basisu::basis_compressor::init()```, then ```basisu::basis_compressor::process()```. Like this for UASTC:
|
||||
Whenever possible, we keep full introspection/transcode compatibility with all of our previously written KTX2 files, even if during standardization a file format change is made. We don't expect how we embed XUASTC LDR into KTX2 in basisu v2.1 to change.
|
||||
|
||||
```
|
||||
bool test()
|
||||
{
|
||||
basisu_encoder_init();
|
||||
----
|
||||
|
||||
image img;
|
||||
if (!load_image("test.png", img))
|
||||
{
|
||||
printf("Can't load image\n");
|
||||
return false;
|
||||
}
|
||||
Repository Licensing with REUSE
|
||||
-------------------------------
|
||||
|
||||
basis_compressor_params basisCompressorParams;
|
||||
The repository has been updated to be compliant with the REUSE license
|
||||
checking tool (https://reuse.software/). See the [.reuse](https://github.com/BinomialLLC/basis_universal/tree/master/.reuse) subdirectory.
|
||||
|
||||
basisCompressorParams.m_source_images.push_back(img);
|
||||
basisCompressorParams.m_perceptual = false;
|
||||
basisCompressorParams.m_mip_srgb = false;
|
||||
External Links
|
||||
--------------
|
||||
|
||||
basisCompressorParams.m_write_output_basis_files = true;
|
||||
basisCompressorParams.m_out_filename = "test.basis";
|
||||
- [btx - KTX2 Command Line Tool](https://github.com/BinomialLLC/KTX-Software-Binomial-Fork) - Our fork of KTX-Software with bug fixes, working HDR quality/effort controls, new options, and new codec integrations. This tool can validate, extract, and compress KTX2 files compatible with our project.
|
||||
- [ARM's astcenc](https://github.com/ARM-software/astc-encoder) - Crucial official tool from ARM which can unpack ASTC format LDR/HDR .astc and .ktx files to .png or .exr for testing and verification purposes.
|
||||
- [Online .EXR and .HDR Image File Viewer](https://viewer.openhdr.org/) - OpenHDR Viewer. Has a very well implemented tone mapper, auto-exposure, and HDR histogram.
|
||||
- [Windows HDR + WCG Image Viewer](https://13thsymphony.github.io/hdrimageviewer/) - A true HDR image viewer for Windows which works on HDR monitors. Also see [the github repo](https://github.com/13thsymphony/HDRImageViewer).
|
||||
- [AMD Compressonator](https://gpuopen.com/compressonator/) - .DDS viewer, can view .KTX files in some formats.
|
||||
- [PVRTexTool](https://www.imgtec.com/developers/powervr-sdk-tools/pvrtextool/) - Can view .ASTC and .KTX files in some formats. (Note: .DDS viewer seems busted for BC1, doesn't support BC7 at all.)
|
||||
- [Microsoft's DirectXTex](https://github.com/microsoft/DirectXTex) - Samples contain a basic .DDS viewer. (Note: May still have issues loading .DDS files with texture dimensions that aren't divisible by 4 texels.)
|
||||
- [RenderDoc](https://renderdoc.org/) - Reliable viewer for LDR/HDR .DDS files in BC1-7 formats.
|
||||
- [Paint.NET](https://www.getpaint.net/) - Windows app: built-in [.DDS file loading](https://github.com/0xC0000054/pdn-ddsfiletype-plus), supports BC1-7 and [cubemaps](https://github.com/0xC0000054/pdn-ddsfiletype-plus/wiki/Cube-Maps)
|
||||
- [Mali Texture Compression Tool](https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/52390/announcement-mali-texture-compression-tool-end-of-life) - Now deprecated.
|
||||
- [Our GitHub wiki content statically mirrored as HTML](https://subquantumtech.com/basisu_wiki/Home.html), which lags behind the [live GitHub wiki](https://github.com/BinomialLLC/basis_universal/wiki)
|
||||
|
||||
For more useful links, papers, and tools/libraries, see the end of the [UASTC HDR 4x4 texture specification](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-4x4-Texture-Specification#papersfurther-reading).
|
||||
|
||||
basisCompressorParams.m_uastc = true;
|
||||
basisCompressorParams.m_rdo_uastc_multithreading = false;
|
||||
basisCompressorParams.m_multithreading = false;
|
||||
basisCompressorParams.m_debug = true;
|
||||
basisCompressorParams.m_status_output = true;
|
||||
basisCompressorParams.m_compute_stats = true;
|
||||
|
||||
basisu::job_pool jpool(1);
|
||||
basisCompressorParams.m_pJob_pool = &jpool;
|
||||
----
|
||||
|
||||
basisu::basis_compressor basisCompressor;
|
||||
basisu::enable_debug_printf(true);
|
||||
|
||||
bool ok = basisCompressor.init(basisCompressorParams);
|
||||
if (ok)
|
||||
{
|
||||
basisu::basis_compressor::error_code result = basisCompressor.process();
|
||||
|
||||
if (result == basisu::basis_compressor::cECSuccess)
|
||||
printf("Success\n");
|
||||
else
|
||||
{
|
||||
printf("Failure\n");
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
printf("Failure\n");
|
||||
return ok;
|
||||
}
|
||||
```
|
||||
|
||||
The command line tool uses this API too, so you can always look at that to see what it does given a set of command line options.
|
||||
|
||||
### Repository Licensing with REUSE
|
||||
|
||||
The repository has been updated to be compliant with the REUSE licenese
|
||||
checking tool (https://reuse.software/). This was done by adding the complete
|
||||
text of all licenses used under the LICENSES/ directory and adding the
|
||||
.reuse/dep5 file which specifies licenses for files which don't contain
|
||||
them in a form which can be automatically parse by the reuse tool. REUSE
|
||||
does not alter copyrights or licenses, simply captures information about
|
||||
licensing to ensure the entire repository has explicit licensing information.
|
||||
|
||||
To ensure continued REUSE compliance, run `reuse lint` at the root of
|
||||
a clean, checked-out repository periodically, or run it during CI tests
|
||||
before any build artifacts have been created.
|
||||
E-mail: info @ binomial dot info, or contact us on [Twitter](https://twitter.com/_binomial)
|
||||
|
||||
Here's the [Sponsors](https://github.com/BinomialLLC/basis_universal/wiki/Sponsors-and-Supporters) wiki page.
|
||||
|
||||
Vendored
+3927
-2068
File diff suppressed because it is too large
Load Diff
+715
@@ -0,0 +1,715 @@
|
||||
// Don't edit directly - see python script in cmd_help directory.
|
||||
"See project and wiki at: https://github.com/BinomialLLC/basis_universal\n"
|
||||
"\n"
|
||||
"The default processing mode is compression of one or more .PNG/.TGA/.JPG/.QOI/\n"
|
||||
".DDS/.EXR/.HDR files to a LDR or HDR .KTX2 file. Alternate modes:\n"
|
||||
"\n"
|
||||
" -unpack: Use transcoder to unpack a .basis/.KTX2 file to one or more .KTX, \n"
|
||||
" .DDS, .PNG, .ASTC, etc. files.\n"
|
||||
"\n"
|
||||
" -info: Display high-level information about a .basis/.KTX2 file\n"
|
||||
" \n"
|
||||
" -validate: Validate and display information about a .basis/.KTX2 file\n"
|
||||
" \n"
|
||||
" -compare: Compare two LDR PNG/BMP/TGA/JPG/QOI images specified with -file,\n"
|
||||
" output PSNR and SSIM statistics and RGB/A delta images\n"
|
||||
"\n"
|
||||
" -compare_hdr: Compare two HDR .EXR/.HDR images specified with -file, output\n"
|
||||
" PSNR statistics and RGB delta images\n"
|
||||
"\n"
|
||||
" -tonemap: Tonemap an HDR or EXR image to PNG at multiple exposures, use -file\n"
|
||||
" to specify filename\n"
|
||||
"\n"
|
||||
" -peek_astc: Read an .astc file and calculate statistics (for testing/dev)\n"
|
||||
"\n"
|
||||
" -version or --version: Print version and exit\n"
|
||||
"\n"
|
||||
"--- Intro:\n"
|
||||
"\n"
|
||||
"This tool compresses LDR/SDR and HDR images and textures to a Basis Universal\n"
|
||||
"supercompressed GPU texture, which can be written to supercompressed .basis or\n"
|
||||
"standard .KTX2 files. It supports a number of SDR and HDR codecs, each with\n"
|
||||
"different quality, transcoding performance, and bitrate tradeoffs. A SDR/HDR\n"
|
||||
"mipmap generator is also included. This tool can also examine and\n"
|
||||
"unpack .KTX2/.basis files to .PNG, .KTX (v1), .ASTC, or .DDS files using its\n"
|
||||
"single source file transcoder library.\n"
|
||||
"\n"
|
||||
"The list of supported texture/supercompressed texture codecs:\n"
|
||||
" -LDR: ETC1S (SDR default), RDO UASTC LDR 4x4, ASTC or XUASTC LDR 4x4-12x12\n"
|
||||
" -HDR: UASTC HDR 4x4 (HDR default), RDO ASTC HDR 6x6, UASTC HDR 6x6\n"
|
||||
" \n"
|
||||
"RDO=Rate-Distortion Optimization. Two key parameters (quality and effort) have\n"
|
||||
"been unified across all the codecs:\n"
|
||||
"\n"
|
||||
"- The -quality X parameter, where X ranges from [0, 100], controls the\n"
|
||||
"compression quality vs. bitrate (output file size) tradeoff for those codecs\n"
|
||||
"supporting supercompression or RDO (Rate-distortion optimization). 100=max\n"
|
||||
"quality, and lower levels produce smaller files with more distortion.\n"
|
||||
"\n"
|
||||
"- The -effort X parameter, where X ranges from [0, 10], controls the\n"
|
||||
"compression speed (and max CPU usage) vs. max achievable quality tradeoff.\n"
|
||||
"Low efforts result in more distortion/artifacts, but faster compression. Lower\n"
|
||||
"efforts result in less utilization of the underlying GPU block format's\n"
|
||||
"capabilities.\n"
|
||||
"\n"
|
||||
"Key Definitions: \n"
|
||||
"\"Quality\" controls the explicit tradeoff between output distortion and output\n"
|
||||
"file bitrate (in bits per pixel or target). At max quality (100) each\n"
|
||||
"compressor will output the lowest distortion it's capable of at its currently\n"
|
||||
"configured effort level.\n"
|
||||
"\n"
|
||||
"\"Effort\" controls how intensely a compressor uses the CPU to focus on each\n"
|
||||
"block format's encoding capabilities. Low effort levels only target a set of\n"
|
||||
"core or basic capabilities (specific to each output target format), while\n"
|
||||
"higher effort levels allow each compressor to explore more of each target's\n"
|
||||
"features (at the cost of higher CPU time). Lower effort levels result in more\n"
|
||||
"brittle compression (higher distortion on tough image/texture features).\n"
|
||||
"Effort=0 fastest compression, effort=10=extremely slow.\n"
|
||||
"\n"
|
||||
"Unless an explicit mode is specified, if one or more files have the .basis\n"
|
||||
"or .KTX2 extension this tool defaults to unpack mode.\n"
|
||||
"\n"
|
||||
"By default, the compressor assumes the input is in the sRGB colorspace (like\n"
|
||||
"typical photos/albedo textures). If the input is NOT sRGB (like a normal map),\n"
|
||||
"be sure to specify -linear for less artifacts. Depending on the content type,\n"
|
||||
"some experimentation may be needed.\n"
|
||||
"\n"
|
||||
"The TinyEXR library is used to read .EXR images. Crucially, this small library\n"
|
||||
"does not support all .EXR compression methods. For unsupported images, you can\n"
|
||||
"use a tool like ImageMagick to convert them to uncompressed .EXR.\n"
|
||||
"\n"
|
||||
"For .DDS source files: Mipmapped or plain 2D textures (but not cubemaps) are\n"
|
||||
"supported. Only uncompressed 32-bit RGBA/BGRA, half float RGBA, or float\n"
|
||||
"RGBA .DDS files are supported. In -tex_array mode, if a .DDS file is specified,\n"
|
||||
"all source files must be in .DDS format.\n"
|
||||
"\n"
|
||||
"Filenames prefixed with a @ symbol are read as filename listing files. Listing\n"
|
||||
"text files specify which actual filenames to process (one filename per line).\n"
|
||||
"\n"
|
||||
"--- High-Level Texture Mode (Codec) Selection:\n"
|
||||
"\n"
|
||||
" 1. -etc1s: Encode to supercompressed ETC1S LDR (the default for SDR/LDR\n"
|
||||
" inputs). Roughly .8-2.5 bpp. Supports temporal texture supercompression\n"
|
||||
" (texture video) with skip blocks (Conditional Replenishment), with global\n"
|
||||
" codebooks shared across all frames.\n"
|
||||
"\n"
|
||||
" 2. -uastc/-uastc_ldr: UASTC LDR 4x4. Encode to UASTC LDR 4x4, a custom high\n"
|
||||
" quality virtual texture format designed for fast transcoding to numerous\n"
|
||||
" GPU texture formats. Roughly 5-8 bpp. Supports RDO encoding using -lambda X\n"
|
||||
" option - see options below. In this mode the multi-target compressor\n"
|
||||
" optimizes for a balance of transcoded ASTC 4x4 LDR and BC7 quality.\n"
|
||||
"\n"
|
||||
" 3. -hdr/-hdr_4x4: UASTC HDR 4x4. Encode input as UASTC HDR 4x4 (the default if\n"
|
||||
" any input file has the .EXR or .HDR extension, or if any .DDS file is HDR).\n"
|
||||
" Output is standard, but constrained, ASTC HDR 4x4. Roughly 5-8 bpp. In this\n"
|
||||
" mode the dual-target compressor optimizes for a balance of transcoded ASTC\n"
|
||||
" 4x4 HDR and BC6H quality.\n"
|
||||
"\n"
|
||||
" 4. -hdr_6x6: ASTC HDR 6x6. Encode input as RDO or highest quality standard\n"
|
||||
" ASTC HDR 6x6. Use -quality (preferred) or -lambda X (low-level, try\n"
|
||||
" 100-20000 or higher) option to enable RDO ASTC HDR 6x6, where x controls\n"
|
||||
" the quality vs. size tradeoff. Roughly 1.2-3.2 bpp.\n"
|
||||
"\n"
|
||||
" 5. -hdr_6x6i: UASTC HDR 6x6. Encode input as supercompressed UASTC HDR 6x6\n"
|
||||
" intermediate. Use -quality (preferred) or -lambda X (low-level, try\n"
|
||||
" 100-20000 or higher) option to enable RDO UASTC HDR 6x6, where x controls\n"
|
||||
" the quality vs. size tradeoff. Roughly 1-3.2 bpp.\n"
|
||||
"\n"
|
||||
" 6. XUASTC LDR 4x4-12x12: -ldr_4x4i, -ldr_5x4i, -ldr_5x5i, -ldr_6x5i,\n"
|
||||
" -ldr_6x6i, -ldr_8x5i, -ldr_8x6i, -ldr_10x5i, -ldr_10x6i, -ldr_8x8i,\n"
|
||||
" -ldr_10x8i, -ldr_10x10i, -ldr_12x10i, -ldr_12x12i:\n"
|
||||
" Compress to supercompressed XUASTC LDR/SDR using the specific\n"
|
||||
" ASTC block size. See additional ASTC/XUASTC LDR specific options\n"
|
||||
" (-effort, -quality, -xy, -ts, -tl, etc.) below. Roughly .3-5.7 bpp\n"
|
||||
"\n"
|
||||
" 7. ASTC LDR 4x4-12x12: -ldr_4x4, -ldr_5x4, -ldr_5x5, -ldr_6x5, -ldr_6x6,\n"
|
||||
" -ldr_8x5, -ldr_8x6, -ldr_10x5, -ldr_10x6, -ldr_8x8, -ldr_10x8,\n"
|
||||
" -ldr_10x10, -ldr_12x10, -ldr_12x12:\n"
|
||||
" Compress to standard or ZStd supercompressed ASTC LDR/SDR using\n"
|
||||
" the specific ASTC block size. See additional ASTC LDR specific\n"
|
||||
" options (-effort, -quality, -xy, -ts, -tl, etc.) below. .89-8 bpp before\n"
|
||||
" ZStd compression.\n"
|
||||
"\n"
|
||||
"--- Tool Options:\n"
|
||||
"\n"
|
||||
" -ktx2: Write .KTX2 files (the default). By default, UASTC LDR/HDR 4x4 and ASTC\n"
|
||||
" 6x6 files will be compressed using Zstandard unless -ktx2_no_zstandard is\n"
|
||||
" specified.\n"
|
||||
"\n"
|
||||
" -basis: Write .basis files instead of .KTX2 files.\n"
|
||||
"\n"
|
||||
" -file filename.png/tga/jpg/qoi/exr/hdr: Input image filename, multiple images\n"
|
||||
" are OK, use -file X for each input filename (prefixing input filenames\n"
|
||||
" with -file is optional)\n"
|
||||
"\n"
|
||||
" -alpha_file filename.png/tga/jpg/qoi: Input alpha image filename, multiple\n"
|
||||
" images are OK, use -file X for each input filename (must be paired\n"
|
||||
" with -file), images converted to REC709 grayscale and used as input alpha\n"
|
||||
"\n"
|
||||
" -quiet or -no_status_output: Disable compressor's status output to stdout\n"
|
||||
"\n"
|
||||
" -output_file filename: Output .basis/.KTX2 filename\n"
|
||||
"\n"
|
||||
" -output_path: Output .basis/.KTX2 files to specified directory.\n"
|
||||
"\n"
|
||||
" -debug or -verbose: Enable codec debug print to stdout (slightly slower).\n"
|
||||
"\n"
|
||||
" -debug_images: Enable codec debug images (much slower).\n"
|
||||
"\n"
|
||||
" -stats: Compute and display image quality metrics (slightly to much slower).\n"
|
||||
"\n"
|
||||
" -individual: Process input images individually and output\n"
|
||||
" multiple .basis/.KTX2 files (not as a texture array - this is now the default\n"
|
||||
" as of v1.16)\n"
|
||||
"\n"
|
||||
" -parallel: Compress multiple textures simultaneously (one per thread), instead\n"
|
||||
" of one at a time. Compatible with OpenCL mode. This is much faster, but in\n"
|
||||
" OpenCL mode the driver is pushed harder, and the CLI output will be jumbled.\n"
|
||||
"\n"
|
||||
" -linear: Use linear colorspace metrics (instead of the default sRGB or scaled\n"
|
||||
" RGB for HDR), write linear transfer function setting to KTX2/basis file, and\n"
|
||||
" by default linear (not sRGB) mipmap filtering (unless overridden). Same\n"
|
||||
" as -tl.\n"
|
||||
"\n"
|
||||
" -srgb: Use sRGB colorspace metrics, write sRGB transfer function setting to\n"
|
||||
" KTX2/basis file, and by default use sRGB mipmap filtering (unless\n"
|
||||
" overridden). Same as -ts.\n"
|
||||
"\n"
|
||||
" -tex_type <2d, 2darray, 3d, video, cubemap>: Set Basis file header's texture\n"
|
||||
" type field. Cubemap arrays require multiples of 6 images, in X+, X-, Y+, Y-,\n"
|
||||
" Z+, Z- order, each image must be the same resolutions. 2d=arbitrary 2D\n"
|
||||
" images, 2darray=2D array, 3D=volume texture slices, video=video frames,\n"
|
||||
" cubemap=array of faces. For 2darray/3d/cubemaps/video, each source image's\n"
|
||||
" dimensions and # of mipmap levels must be the same. For video, the .basis\n"
|
||||
" file will be written with the first frame being an I-Frame, and subsequent\n"
|
||||
" frames being P-Frames (using conditional replenishment). Playback must always\n"
|
||||
" occur in order from first to last image.\n"
|
||||
"\n"
|
||||
" -cubemap: same as -tex_type cubemap\n"
|
||||
"\n"
|
||||
" -tex_array: Process input images as a single texture array and write a\n"
|
||||
" single .basis/.KTX2 file (the former default before v1.16)\n"
|
||||
"\n"
|
||||
" -fuzz_testing: Use with -validate: Disables CRC16 validation of file contents\n"
|
||||
" before transcoding\n"
|
||||
"\n"
|
||||
" -multifile_printf: printf() format string to use to compose multiple filenames\n"
|
||||
"\n"
|
||||
" -multifile_first: The index of the first file to process, default is 0 (must\n"
|
||||
" specify -multifile_printf and -multifile_num)\n"
|
||||
"\n"
|
||||
" -multifile_num: The total number of files to process.\n"
|
||||
"\n"
|
||||
" -opencl: Enable OpenCL usage (currently only accelerates ETC1S encoding)\n"
|
||||
"\n"
|
||||
" -opencl_serialize: Serialize all calls to the OpenCL driver (to work around\n"
|
||||
" buggy drivers, only useful with -parallel)\n"
|
||||
"\n"
|
||||
"--- ETC1S specific options (-etc1s - the LDR/SDR default):\n"
|
||||
"\n"
|
||||
" -quality X and -effort X: Set quality (1-100) and effort (0-10) levels\n"
|
||||
"\n"
|
||||
" -q X: Low-level ETC1S quality level, 1-255, default is 128, lower=better\n"
|
||||
" compression/lower quality/faster, higher=less compression/higher\n"
|
||||
" quality/slower, default is 128. For even higher quality,\n"
|
||||
" use -max_endpoints/-max_selectors. (-quality is preferred.)\n"
|
||||
"\n"
|
||||
" -comp_level X: Low-level ETC1S speed vs. quality tradeoff. Range is 0-6,\n"
|
||||
" default is 1. Higher values=MUCH slower, but slightly higher quality. Higher\n"
|
||||
" levels intended for videos. (-effort is preferred.)\n"
|
||||
"\n"
|
||||
" -max_endpoints X: ETC1S: Manually set the max number of color endpoint\n"
|
||||
" clusters from 1-16128, use instead of -q\n"
|
||||
"\n"
|
||||
" -max_selectors X: ETC1S: Manually set the max number of color selector\n"
|
||||
" clusters from 1-16128, use instead of -q\n"
|
||||
"\n"
|
||||
"--- UASTC LDR/HDR 4x4 specific options (-uastc or -uastc_ldr):\n"
|
||||
"\n"
|
||||
" -quality X and -effort X: Set quality (1-100) and effort (0-10) levels\n"
|
||||
"\n"
|
||||
" -uastc, -uastc_ldr or -uastc_ldr_4x4: Enable UASTC LDR 4x4 texture mode,\n"
|
||||
" instead of the default ETC1S mode. Significantly higher texture quality, but\n"
|
||||
" much larger (~8bpp) files. (Note that UASTC LDR 4x4 .basis files must be\n"
|
||||
" losslessly compressed by the user.)\n"
|
||||
"\n"
|
||||
" -uastc_level: Set low-level UASTC LDR/HDR 4x4 encoding effort level. LDR Range\n"
|
||||
" is [0,4], default is 2, higher=slower but higher quality. 0=fastest/lowest\n"
|
||||
" quality, 3=slowest practical option, 4=impractically slow/highest achievable\n"
|
||||
" quality. UASTC HDR 4x4 range is [0,4]: higher=slower, but higher quality. HDR\n"
|
||||
" 4x4 default level=1.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_l X: Enable UASTC LDR 4x4 RDO post-processing and set the low-level\n"
|
||||
" UASTC LDR 4x4 RDO quality scalar (lambda) to X. Lower values=higher\n"
|
||||
" quality/larger LZ compressed files, higher values=lower quality/smaller LZ\n"
|
||||
" compressed files. Good range to try is [.25-10]. Note: Previous versons used\n"
|
||||
" the -uastc_rdo_q option, which was removed because the RDO algorithm was\n"
|
||||
" changed.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_d X: Set UASTC LDR 4x4 RDO dictionary size in bytes. Default is\n"
|
||||
" 4096, max is 65536. Lower values=faster, but less compression.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_b X: Set UASTC LDR 4x4 RDO max smooth block error scale. Range is\n"
|
||||
" [1,300]. Default is 10.0, 1.0=disabled. Larger values suppress more artifacts\n"
|
||||
" (and allocate more bits) on smooth blocks.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_s X: Set UASTC LDR 4x4 RDO max smooth block standard deviation.\n"
|
||||
" Range is [.01,65536]. Default is 18.0. Larger values expand the range of\n"
|
||||
" blocks considered smooth.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_f: Don't favor simpler UASTC LDR 4x4 modes in RDO mode.\n"
|
||||
"\n"
|
||||
" -uastc_rdo_m: Disable RDO multithreading (slightly higher compression,\n"
|
||||
" deterministic).\n"
|
||||
"\n"
|
||||
"--- UASTC HDR 4x4 specific options (-hdr or -hdr_4x4 - the HDR default):\n"
|
||||
"\n"
|
||||
" -hdr, -hdr_4x4, or -uastc_hdr_4x4: Enable UASTC HDR 4x4 mode\n"
|
||||
"\n"
|
||||
" -quality X and -effort X: Set quality (1-100) and effort (0-10) levels\n"
|
||||
"\n"
|
||||
" -uastc_level X: Sets the low-level UASTC HDR 4x4 compressor's effort level.\n"
|
||||
" Valid range is [0,4]: higher=slower but higher quality. HDR\n"
|
||||
" default=1. Level 0=fastest/lowest quality, 3=highest practical\n"
|
||||
" setting, 4=exhaustive\n"
|
||||
"\n"
|
||||
" -hdr_uber_mode: Allow the UASTC HDR 4x4 encoder to try varying the CEM 11\n"
|
||||
" selectors more for slightly higher quality (slower). This may negatively\n"
|
||||
" impact BC6H quality, however.\n"
|
||||
"\n"
|
||||
" -hdr_ultra_quant: UASTC HDR 4x4: Try to find better quantized CEM 7/11\n"
|
||||
" endpoint values (slower).\n"
|
||||
"\n"
|
||||
" -hdr_favor_astc: UASTC HDR 4x4: By default the dual-target UASTC HDR 4x4\n"
|
||||
" encoder tries to strike a balance or even slightly favor BC6H quality. If\n"
|
||||
" this option is specified, ASTC HDR 4x4 quality is favored instead.\n"
|
||||
"\n"
|
||||
"--- ASTC/UASTC HDR 6x6 specific options (-hdr_6x6 or -hdr_6x6i):\n"
|
||||
"\n"
|
||||
"Internally both modes use the same compressor which can generate either\n"
|
||||
"standard ASTC HDR 6x6 (with optional RDO) or UASTC HDR 6x6 (supercompressed\n"
|
||||
"with a custom format).\n"
|
||||
"\n"
|
||||
" -hdr_6x6 or -astc_hdr_6x6: Enable RDO ASTC HDR 6x6 mode\n"
|
||||
"\n"
|
||||
" -hdr_6x6i or -uastc_hdr_6x6: Enable UASTC HDR 6x6 mode\n"
|
||||
"\n"
|
||||
" -quality X and -effort X: Set quality (1-100) and effort (0-10) levels\n"
|
||||
"\n"
|
||||
" -lambda X: Low-level option to enable rate distortion optimization (RDO) and\n"
|
||||
" directly control the HDR 6x6 compressor's lambda setting. The\n"
|
||||
" higher this value, the lower the quality, but the smaller the file\n"
|
||||
" size. Try 100-20000, or higher values on some images. Upconverted\n"
|
||||
" SDR images can generally tolerate much higher lambda settings vs.\n"
|
||||
" true HDR images.\n"
|
||||
"\n"
|
||||
" -hdr_6x6_level X: Low-level option to set the codec to 6x6 HDR mode (same\n"
|
||||
" as -hdr_6x6) and controls encoder performance vs. max quality\n"
|
||||
" tradeoff. X may range from [0,12]. Default level is 2. Higher\n"
|
||||
" values result in better quality but slower encoding. Values above\n"
|
||||
" 10 are extremely slow.\n"
|
||||
"\n"
|
||||
" -hdr_6x6i_level X: Low-level option to set the codec to 6x6 HDR intermediate\n"
|
||||
" mode (same as -hdr_6x6i) and controls encoder performance vs. max\n"
|
||||
" quality tradeoff. X may range from [0,12]. Default level is 2.\n"
|
||||
"\n"
|
||||
" -rec_2020: The input image's gamut is Rec. 2020 vs. the default Rec. 709 - for\n"
|
||||
" accurate colorspace error calculations. This value will also be\n"
|
||||
" written to the KTX2 file's header in the DFD.\n"
|
||||
"\n"
|
||||
" -hdr_6x6_jnd X, -hdr_6x6_extra_pats, -hdr_6x6_brute_force_pats,\n"
|
||||
" -hdr_6x6_comp_levels X Y, or -hdr_6x6i_comp_levels X Y: Low-level\n"
|
||||
" control over the encoder's configuration.\n"
|
||||
"\n"
|
||||
" -hdr_6x6i_16_compatibility: Write basisu v1.6 UASTC HDR 6x6i files (default)\n"
|
||||
"\n"
|
||||
" -hdr_6x6i_20_compatibility: Write basisu v2.0 UASTC HDR 6x6i files (slightly\n"
|
||||
" lower bitrate, only compatible with v2.0+ transcoders however.)\n"
|
||||
"\n"
|
||||
"--- SDR/LDR->HDR upconversion options (only used when encoding to HDR formats\n"
|
||||
"from an LDR/SDR source image):\n"
|
||||
"\n"
|
||||
" -hdr_ldr_no_srgb_to_linear: If specified, LDR images will NOT be converted to\n"
|
||||
" normalized linear light (via a sRGB->Linear conversion) during SDR->HDR\n"
|
||||
" upconversion before compressing as HDR.\n"
|
||||
"\n"
|
||||
" -hdr_ldr_upconversion_nit_multiplier X: Specify how many nits (candelas per\n"
|
||||
" sq. meter) LDR/SDR images are converted to after converting to linear\n"
|
||||
" light. Default is 100 nits. Note: Previous builds used 1 nit. Common\n"
|
||||
" values are 80-100 nits.\n"
|
||||
"\n"
|
||||
"--- ASTC LDR/XUASTC LDR specific options (-ldr_4x4 or -ldr_4x4i, up to 12x12):\n"
|
||||
"\n"
|
||||
"Internally both modes (ASTC 4x4-12x12 and XUASTC 4x4-12x12) use the same\n"
|
||||
"core compressor but with different outputs. All 14 standard ASTC block \n"
|
||||
"sizes are supported (see the list below).\n"
|
||||
"\n"
|
||||
" -ldr_4x4-12x12 or -astc_ldr_4x4-12x12: Enable ASTC LDR 4x4-12x12 mode\n"
|
||||
"\n"
|
||||
" -ldr_4x4i-12x12 or -xuastc_ldr_4x4-12x12: Enable XUASTC LDR 4x4-12x12 mode\n"
|
||||
"\n"
|
||||
" -quality X: Enables lossy weight grid DCT and sets DCT quality level [1,100]\n"
|
||||
" (defaults to no DCT). Higher=better quality, but higher bitrate. Good values\n"
|
||||
" to try are 30-90. Default is no weight grid DCT.\n"
|
||||
"\n"
|
||||
" -effort X: Set encoder effort level [0,10]: Encoding speed tradeoff, \n"
|
||||
" higher=slower but potentially higher overall quality. Default=3, 10=Insane.\n"
|
||||
" \n"
|
||||
" -xuastc_arith, -xuastc_hybrid, -xuastc_zstd: Set transcoding speed vs.\n"
|
||||
" compression ratio tradeoff by selecting the output profile/syntax. Default\n"
|
||||
" is -xuastc_zstd (fastest, lowest ratio). ZStd is fastest/lowest ratio, arith\n"
|
||||
" is slowest/highest ratio (3-15% better vs. ZStd).\n"
|
||||
"\n"
|
||||
" -xy: Enables lossy supercompression using windowed/bounded RDO for extra\n"
|
||||
" compression (default is lossless supercompression of the XUASTC texture data\n"
|
||||
" unless DCT is enabled)\n"
|
||||
"\n"
|
||||
" -xyd: Disables lossy supercompression (default, but automatically enabled\n"
|
||||
" if -quality less than 100 is specified )\n"
|
||||
"\n"
|
||||
" -xs: Force disable 2-3 subset usage in all effort levels (lower quality but\n"
|
||||
" faster compression and faster transcoding to BC7 at certain block sizes)\n"
|
||||
"\n"
|
||||
" -xp: Force disable RGB dual plane usage in all effort levels (lower quality\n"
|
||||
" but faster compression and faster transcoding to BC7 at certain block sizes)\n"
|
||||
"\n"
|
||||
" -ts: Use LDR sRGB ASTC decoding profile - the default. This parameter should\n"
|
||||
" match how the developer will decode or sample the ASTC texture data. Inverse\n"
|
||||
" of -tl. Same as -srgb.\n"
|
||||
"\n"
|
||||
" -tl: Use LDR Linear ASTC decoding profile. Inverse of -ts. Same as -linear.\n"
|
||||
"\n"
|
||||
" -weights X Y Z W: Set unsigned integer channel error weights. Defaults are\n"
|
||||
" 1,1,1,1. Useful to favor certain channels during compression.\n"
|
||||
"\n"
|
||||
" -ls_min_psnr X, -ls_min_alpha_psnr X, -ls_thresh_psnr X, -ls_thresh_alpha_psnr\n"
|
||||
" X, -ls_thresh_edge_psnr X, -ls_thresh_edge_alpha_psnr X: Windowed/bounded RDO\n"
|
||||
" settings (Lossy supercompression must be enabled, or -xy.)\n"
|
||||
"\n"
|
||||
" -xuastc_blurring: Experimental - enable blurred block candidates (MUCH slower\n"
|
||||
" compression, higher quality).\n"
|
||||
"\n"
|
||||
"These modes support all the standard ASTC block sizes. The larger the block\n"
|
||||
"size, the lower the bitrate on disk and in memory, but the more noticeable the\n"
|
||||
"artifacts. Some block sizes (4x4, 6x6, and 8x6) have specially optimized direct\n"
|
||||
"transcoding paths to BC7. For faster direct BC7 transcoding at these block\n"
|
||||
"sizes, disable RGB dual plane (-xp) and subset usage (-xs).\n"
|
||||
"\n"
|
||||
" Block Size Base/Memory Size\n"
|
||||
" 1. 4x4 8.00 bpp\n"
|
||||
" 2. 5x4 6.40 bpp\n"
|
||||
" 3. 5x5 5.12 bpp\n"
|
||||
" 4. 6x5 4.27 bpp\n"
|
||||
" 5. 6x6 3.56 bpp\n"
|
||||
" 6. 8x5 3.20 bpp\n"
|
||||
" 7. 8x6 2.67 bpp\n"
|
||||
" 8. 10x5 2.56 bpp\n"
|
||||
" 9. 10x6 2.13 bpp\n"
|
||||
" 10. 8x8 2.00 bpp\n"
|
||||
" 11. 10x8 1.60 bpp\n"
|
||||
" 12. 10x10 1.28 bpp\n"
|
||||
" 13. 12x10 1.07 bpp\n"
|
||||
" 14. 12x12 0.89 bpp\n"
|
||||
"\n"
|
||||
"--- More options:\n"
|
||||
"\n"
|
||||
" -test: Run an automated LDR ETC1S/UASTC LDR 4x4 encoding and transcoding test.\n"
|
||||
" Returns EXIT_FAILURE on any failures.\n"
|
||||
"\n"
|
||||
" -test_hdr_4x4/-test_hdr_6x6/-test_hdr_6x6i: Run automated UASTC HDR encoding\n"
|
||||
" and transcoding tests. Returns EXIT_FAILURE on any failures.\n"
|
||||
"\n"
|
||||
" -test_xuastc: Run an automated XUASTC LDR encoding and transcoding test.\n"
|
||||
" Returns EXIT_FAILURE on any failures.\n"
|
||||
"\n"
|
||||
" -test_dir: Optional directory of test files. Defaults to \"../test_files\".\n"
|
||||
"\n"
|
||||
" -y_flip: Flip input images vertically before compression\n"
|
||||
"\n"
|
||||
" -normal_map: Tunes codec parameters for better quality on normal maps (linear\n"
|
||||
" colorspace metrics, linear mipmap filtering, no selector RDO, no sRGB)\n"
|
||||
"\n"
|
||||
" -no_alpha: Always output non-alpha basis files, even if one or more inputs has\n"
|
||||
" alpha\n"
|
||||
"\n"
|
||||
" -force_alpha: Always output alpha basis files, even if no inputs has alpha\n"
|
||||
"\n"
|
||||
" -separate_rg_to_color_alpha: Separate input R and G channels to RGB and A (for\n"
|
||||
" tangent space XY normal maps)\n"
|
||||
"\n"
|
||||
" -swizzle rgba: Specify swizzle for the 4 input color channels using r, g, b\n"
|
||||
" and a (the -separate_rg_to_color_alpha flag is equivalent to rrrg)\n"
|
||||
"\n"
|
||||
" -renorm: Renormalize each input image before any further\n"
|
||||
" processing/compression\n"
|
||||
"\n"
|
||||
" -no_multithreading: Disable multithreading\n"
|
||||
"\n"
|
||||
" -max_threads X: Use at most X threads total when multithreading is enabled\n"
|
||||
" (this includes the main thread)\n"
|
||||
"\n"
|
||||
" -wasi_threads: Set number of threads to use in WASI threading builds\n"
|
||||
" (default=8, only used in WASI threading builds)\n"
|
||||
"\n"
|
||||
" -no_ktx: Disable KTX writing when unpacking (faster, less output files)\n"
|
||||
"\n"
|
||||
" -ktx_only: Only write KTX files when unpacking (faster, less output files)\n"
|
||||
"\n"
|
||||
" -write_out: Write 3dfx OUT files when unpacking FXT1 textures\n"
|
||||
"\n"
|
||||
" -format_only: Only unpack the specified format, by its numeric code.\n"
|
||||
"\n"
|
||||
" -etc1_only: Only unpack to ETC1, skipping the other texture formats\n"
|
||||
" during -unpack\n"
|
||||
"\n"
|
||||
" -disable_hierarchical_endpoint_codebooks: Disable hierarchical endpoint\n"
|
||||
" codebook usage, slower but higher quality on some compression levels\n"
|
||||
"\n"
|
||||
" -compare_ssim: Compute and display SSIM of image comparison (slow)\n"
|
||||
"\n"
|
||||
" -compare_plot: Display histogram plots in -compare mode\n"
|
||||
"\n"
|
||||
" -bench: UASTC benchmark mode, for development only\n"
|
||||
"\n"
|
||||
" -resample X Y: Resample all input textures to XxY pixels using a box filter\n"
|
||||
"\n"
|
||||
" -resample_factor X: Resample all input textures by scale factor X using a box\n"
|
||||
" filter\n"
|
||||
"\n"
|
||||
" -no_sse: Forbid all SSE instruction set usage\n"
|
||||
"\n"
|
||||
" -validate_etc1s: Validate internal ETC1S compressor's data structures during\n"
|
||||
" compression (slower, intended for development).\n"
|
||||
"\n"
|
||||
" -ktx2_animdata_duration X: Set KTX2animData duration field to integer value X\n"
|
||||
" (only valid/useful for -tex_type video, default is 1)\n"
|
||||
"\n"
|
||||
" -ktx2_animdata_timescale X: Set KTX2animData timescale field to integer value\n"
|
||||
" X (only valid/useful for -tex_type video, default is 15)\n"
|
||||
"\n"
|
||||
" -ktx2_animdata_loopcount X: Set KTX2animData loopcount field to integer value\n"
|
||||
" X (only valid/useful for -tex_type video, default is 0)\n"
|
||||
"\n"
|
||||
" -framerate X: Set framerate in .basis header to X/frames sec.\n"
|
||||
"\n"
|
||||
" -ktx2_no_zstandard: Don't compress UASTC texture data using Zstandard -- store\n"
|
||||
" it uncompressed instead.\n"
|
||||
"\n"
|
||||
" -ktx2_zstandard_level X: Set ZStandard compression level to X (see Zstandard\n"
|
||||
" documentation, default level is 6)\n"
|
||||
"\n"
|
||||
" -tonemap_dither: Dither tonemapper's 8-bit/component output by adding a small\n"
|
||||
" amount of white noise, only used with -tonemap mode\n"
|
||||
"\n"
|
||||
"--- Mipmap Generator Options:\n"
|
||||
"\n"
|
||||
"By default, SDR textures will be converted from sRGB to linear light before\n"
|
||||
"mipmap filtering, then back to sRGB (for the RGB color channels) unless -linear\n"
|
||||
"is specified. You can override this behavior with -mip_srgb/-mip_linear.\n"
|
||||
"\n"
|
||||
" -mipmap: Generate mipmaps for each source image\n"
|
||||
"\n"
|
||||
" -mip_srgb: Convert image to linear before filtering, then back to sRGB.\n"
|
||||
" (This is set automatically by default, unless you override it.)\n"
|
||||
"\n"
|
||||
" -mip_linear: Keep image in linear light during mipmap filtering (i.e. do not\n"
|
||||
" convert to/from sRGB for filtering purposes). (This is set automatically by\n"
|
||||
" default, unless you override it.)\n"
|
||||
"\n"
|
||||
" -mip_scale X: Set mipmap filter kernel's scale, lower=sharper, higher=more\n"
|
||||
" blurry, default is 1.0 (quite conservative).\n"
|
||||
"\n"
|
||||
" -mip_filter X: Set mipmap filter kernel, default is kaiser. Supported filters:\n"
|
||||
" box, tent, bell, b-spline, mitchell, blackman, lanczos3, lanczos4, lanczos6,\n"
|
||||
" lanczos12, kaiser, gaussian, catmullrom, quadratic_interp, quadratic_approx,\n"
|
||||
" quadratic_mix\n"
|
||||
"\n"
|
||||
" -mip_renorm: Renormalize normal map to unit length vectors after filtering\n"
|
||||
"\n"
|
||||
" -mip_clamp: Use clamp addressing on borders, instead of wrapping\n"
|
||||
"\n"
|
||||
" -mip_fast: Use faster mipmap generation (resample from previous mip, not\n"
|
||||
" always first/largest mip level). The default.\n"
|
||||
"\n"
|
||||
" -mip_slow: Always resample each mipmap level starting from the largest mipmap.\n"
|
||||
" Higher quality, but slower. Opposite of -mip_fast. \n"
|
||||
"\n"
|
||||
" -mip_smallest X: Set smallest pixel dimension for generated mipmaps, default\n"
|
||||
" is 1 pixel \n"
|
||||
"\n"
|
||||
"--- Transcoding Options (used while unpacking, validating after compression):\n"
|
||||
"\n"
|
||||
"These settings control the \"decode flags\" used while transcoding:\n"
|
||||
"\n"
|
||||
" -higher_quality_transcoding: Enable higher quality, but slower, transcoding\n"
|
||||
"\n"
|
||||
" -no_deblocking: Always disable adaptive deblocking filter on all block sizes\n"
|
||||
" (XUASTC/ASTC LDR 4x4-12x12 only). By default only block sizes >8x6 are\n"
|
||||
" deblocked while transcoding. (No deblocking ever occurs when transcoding to\n"
|
||||
" ASTC: only when re-encoding ASTC to another format, to lower artifacts.)\n"
|
||||
"\n"
|
||||
" -force_deblocking: Always use adaptive deblocking filter, even for block sizes\n"
|
||||
" <= 8x6 (XUASTC/ASTC LDR 4x4-12x12 only)\n"
|
||||
"\n"
|
||||
" -stronger_deblocking: Use stronger adaptive deblocking filtering (XUASTC/ASTC\n"
|
||||
" LDR 4x4-12x12 only)\n"
|
||||
"\n"
|
||||
" -no_etc1s_chroma_filtering: Disable adaptive ETC1S transcode chroma filter,\n"
|
||||
" for faster transcoding to BC7.\n"
|
||||
"\n"
|
||||
" -fast_xuastc_ldr_bc7_transcoding: Use much faster, but lower quality, XUASTC\n"
|
||||
" LDR 4x4/6x6/8x6 direct BC7 transcoders (the default)\n"
|
||||
"\n"
|
||||
" -no_fast_xuastc_ldr_bc7_transcoding: Disable much faster, but slightly lower\n"
|
||||
" quality, XUASTC LDR 4x4/6x6/8x6 direct BC7 transcoders\n"
|
||||
"\n"
|
||||
"--- Low-Level ETC1S backend endpoint/selector RDO codec options:\n"
|
||||
"\n"
|
||||
" -no_selector_rdo: Disable backend's selector rate distortion optimizations\n"
|
||||
" (slightly faster, less noisy output, but lower quality per output bit)\n"
|
||||
"\n"
|
||||
" -selector_rdo_thresh X: Set selector RDO quality threshold, default is 1.25,\n"
|
||||
" lower is higher quality but less quality per output bit (try 1.0-3.0)\n"
|
||||
"\n"
|
||||
" -no_endpoint_rdo: Disable backend's endpoint rate distortion optimizations\n"
|
||||
" (slightly faster, less noisy output, but lower quality per output bit)\n"
|
||||
"\n"
|
||||
" -endpoint_rdo_thresh X: Set endpoint RDO quality threshold, default is 1.5,\n"
|
||||
" lower is higher quality but less quality per output bit (try 1.0-3.0)\n"
|
||||
"\n"
|
||||
"--- Set various low-level fields in the Basis file header:\n"
|
||||
"\n"
|
||||
" -userdata0 X: Set 32-bit userdata0 field in Basis file header to X (X is a\n"
|
||||
" signed 32-bit int)\n"
|
||||
"\n"
|
||||
" -userdata1 X: Set 32-bit userdata1 field in Basis file header to X (X is a\n"
|
||||
" signed 32-bit int)\n"
|
||||
"\n"
|
||||
"--- Example LDR ETC1S/UASTC LDR 4x4 command lines:\n"
|
||||
"\n"
|
||||
" - basisu x.png : Compress sRGB image x.png to x.ktx2 using default settings\n"
|
||||
" (multiple filenames OK, use -tex_array if you want a tex array vs. multiple\n"
|
||||
" output files)\n"
|
||||
"\n"
|
||||
" - basisu -basis x.qoi : Compress sRGB image x.qoi to x.basis (supports 24-bit\n"
|
||||
" or 32-bit .QOI files)\n"
|
||||
"\n"
|
||||
" - basisu x.ktx2 : Unpack x.basis to PNG/KTX files (multiple filenames OK)\n"
|
||||
"\n"
|
||||
" - basisu x.basis : Unpack x.basis to PNG/KTX files (multiple filenames OK)\n"
|
||||
"\n"
|
||||
" - basisu -uastc x.png -uastc_rdo_l 2.0 -ktx2 -stats : Compress to a\n"
|
||||
" UASTC .KTX2 file with RDO (rate distortion optimization) to reduce .KTX2\n"
|
||||
" compressed file size\n"
|
||||
"\n"
|
||||
" - basisu -file x.png -mipmap -y_flip : Compress a mipmapped x.ktx2 file from\n"
|
||||
" an sRGB image named x.png, Y flip each source image\n"
|
||||
"\n"
|
||||
" - basisu -validate -file x.basis : Validate x.basis (check header, check file\n"
|
||||
" CRC's, attempt to transcode all slices)\n"
|
||||
"\n"
|
||||
" - basisu -unpack -file x.basis : Validates, transcodes and unpacks x.basis to\n"
|
||||
" mipmapped .KTX and RGB/A .PNG files (transcodes to all supported GPU texture\n"
|
||||
" formats)\n"
|
||||
"\n"
|
||||
" - basisu -q 255 -file x.png -mipmap -debug -stats : Compress sRGB x.png to\n"
|
||||
" x.ktx2 at quality level 255 with compressor debug output/statistics\n"
|
||||
"\n"
|
||||
" - basisu -linear -max_endpoints 16128 -max_selectors 16128 -file x.png :\n"
|
||||
" Compress non-sRGB x.png to x.ktx2 using the largest supported manually\n"
|
||||
" specified codebook sizes\n"
|
||||
"\n"
|
||||
" - basisu -basis -comp_level 2 -max_selectors 8192 -max_endpoints\n"
|
||||
" 8192 -tex_type video -framerate 20 -multifile_printf\n"
|
||||
" \"x%02u.png\" -multifile_first 1 -multifile_num 20 : Compress a 20 sRGB source\n"
|
||||
" image video sequence (x01.png, x02.png, x03.png, etc.) to x01.basis\n"
|
||||
"\n"
|
||||
"--- Example UASTC HDR 4x4 command lines:\n"
|
||||
"\n"
|
||||
" - basisu x.exr : Compress a HDR .EXR (or .HDR) image to a UASTC HDR 4x4 .KTX2\n"
|
||||
" file. LDR/SDR images will be upconverted to linear light HDR before\n"
|
||||
" compression. See HDR upconversion options, above.\n"
|
||||
"\n"
|
||||
" - basisu -hdr_4x4 x.exr : Compress a HDR .EXR image to a UASTC HDR 4x4 .KTX2\n"
|
||||
" file.\n"
|
||||
"\n"
|
||||
" - basisu x.hdr -uastc_level 0 : Compress a HDR .hdr image to a UASTC HDR\n"
|
||||
" 4x4 .KTX2 file, fastest encoding but lowest quality\n"
|
||||
"\n"
|
||||
" - basisu -hdr x.png : Compress a LDR .PNG image to UASTC HDR 4x4 (image is\n"
|
||||
" converted from sRGB to linear light first, use -hdr_ldr_no_srgb_to_linear to\n"
|
||||
" disable)\n"
|
||||
"\n"
|
||||
" - basisu x.hdr -uastc_level 3 : Compress a HDR .hdr image to UASTC HDR 4x4 at\n"
|
||||
" higher quality (-uastc_level 4 is highest quality, but very slow encoding)\n"
|
||||
"\n"
|
||||
" - basisu x.hdr -uastc_level 3 -mipmap -basis -stats -debug -debug_images :\n"
|
||||
" Compress a HDR .hdr image to UASTC HDR 4x4, .basis output file, at higher\n"
|
||||
" quality, generate mipmaps, output statistics and debug information, and write\n"
|
||||
" tone mapped debug images\n"
|
||||
"\n"
|
||||
" - basisu x.hdr -stats -hdr_favor_astc -hdr_uber_mode -uastc_level 4 : Highest\n"
|
||||
" achievable ASTC HDR 4x4 quality (very slow encoding, BC6H quality is traded\n"
|
||||
" off)\n"
|
||||
"\n"
|
||||
"--- Example RDO ASTC/UASTC HDR 6x6 command lines:\n"
|
||||
"\n"
|
||||
" - basisu -hdr_6x6 x.exr : Compress a HDR .EXR (or .HDR) image to a UASTC HDR\n"
|
||||
" 6x6 .KTX2 file. LDR/SDR images will be upconverted to linear light HDR before\n"
|
||||
" compression. See HDR upconversion options, above.\n"
|
||||
"\n"
|
||||
" - basisu -lambda 1000 -hdr_6x6 x.exr : Compress a HDR .EXR (or .HDR) image to\n"
|
||||
" a UASTC HDR 6x6 .KTX2 file with rate-distortion optimization (RDO), at lambda\n"
|
||||
" level 1000.\n"
|
||||
"\n"
|
||||
" - basisu -hdr_6x6i x.exr : Compress a HDR .EXR image to a compressed\n"
|
||||
" intermediate format UASTC HDR 6x6 .KTX2 file.\n"
|
||||
"\n"
|
||||
" - basisu -lambda 1000 -hdr_6x6i x.exr : Compress a HDR .EXR image to a\n"
|
||||
" compressed intermediate format UASTC HDR 6x6 .KTX2 file with rate-distortion\n"
|
||||
" optimization (RDO), at lambda level 1000.\n"
|
||||
"\n"
|
||||
"--- Example ASTC/XUASTC LDR 4x4-12x12 command lines:\n"
|
||||
"\n"
|
||||
" - basisu -ldr_6x6i -quality 75 -xuastc_arith test.png : Compress test.png to XUASTC\n"
|
||||
" LDR 6x6 using weight grid DCT with setting 75 and the arith profile for\n"
|
||||
" higher compression.\n"
|
||||
"\n"
|
||||
" - basisu -ldr_4x4 -effort 5 test.png : Compress test.png to ASTC LDR 4x4\n"
|
||||
"\n"
|
||||
" - basisu -mipmap -ldr_10x5i test.png : Compress test.png to XUASTC LDR 10x5,\n"
|
||||
" using lossless ZStd supercompression, with mipmaps\n"
|
||||
"\n"
|
||||
"--- ETC1S Texture Video Notes: Use -comp_level 2 or higher for better codebook\n"
|
||||
"generation, specify very large codebooks using -max_endpoints\n"
|
||||
"and -max_selectors, and reduce the default endpoint RDO threshold\n"
|
||||
"(-endpoint_rdo_thresh) to around 1.25. Videos may have mipmaps and alpha\n"
|
||||
"channels. Videos must always be played back by the transcoder in first to last\n"
|
||||
"image order. Video files currently use I-Frames on the first image, and\n"
|
||||
"P-Frames using conditional replenishment on subsequent frames.\n"
|
||||
"\n"
|
||||
"--- Low-level ETC1S compression (Effort) Level (-comp_level X) Details \n"
|
||||
"\n"
|
||||
"This setting controls the ETC1S speed vs. quality tradeoff. (Use -q to control\n"
|
||||
"the quality vs. compressed size tradeoff.):\n"
|
||||
"\n"
|
||||
" - Level 0: Fastest, but has marginal quality and can be brittle on complex\n"
|
||||
"images. Avg. Y dB: 35.45\n"
|
||||
"\n"
|
||||
" - Level 1: Hierarchical codebook searching, faster ETC1S encoding. 36.87 dB,\n"
|
||||
"~1.4x slower vs. level 0. (This is the default setting.)\n"
|
||||
"\n"
|
||||
" - Level 2: Use this or higher for video. Hierarchical codebook searching.\n"
|
||||
"36.87 dB, ~1.4x slower vs. level 0. (This is the v1.12's default setting.)\n"
|
||||
"\n"
|
||||
" - Level 3: Full codebook searching. 37.13 dB, ~1.8x slower vs. level 0.\n"
|
||||
"(Equivalent to the initial release's default settings.)\n"
|
||||
"\n"
|
||||
" - Level 4: Hierarchical codebook searching, codebook k-means iterations. 37.15\n"
|
||||
"dB, ~4x slower vs. level 0\n"
|
||||
"\n"
|
||||
" - Level 5: Full codebook searching, codebook k-means iterations. 37.41 dB,\n"
|
||||
"~5.5x slower vs. level 0.\n"
|
||||
"\n"
|
||||
" - Level 6: Full codebook searching, twice as many codebook k-means iterations,\n"
|
||||
"best ETC1 endpoint opt. 37.43 dB, ~12x slower vs. level 0"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
||||
// File: android_astc_decomp.h
|
||||
#ifndef _TCUASTCUTIL_HPP
|
||||
#define _TCUASTCUTIL_HPP
|
||||
/*-------------------------------------------------------------------------
|
||||
* drawElements Quality Program Tester Core
|
||||
* ----------------------------------------
|
||||
*
|
||||
* Copyright 2016 The Android Open Source Project
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*//*!
|
||||
* \file
|
||||
* \brief ASTC Utilities.
|
||||
*//*--------------------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace basisu_astc
|
||||
{
|
||||
namespace astc
|
||||
{
|
||||
|
||||
// Unpacks a single ASTC block to pDst
|
||||
// If isSRGB is true, the spec requires the decoder to scale the LDR 8-bit endpoints to 16-bit before interpolation slightly differently,
|
||||
// which will lead to different outputs. So be sure to set it correctly (ideally it should match whatever the encoder did).
|
||||
bool decompress_ldr(uint8_t* pDst, const uint8_t* data, bool isSRGB, int blockWidth, int blockHeight);
|
||||
bool decompress_hdr(float* pDstRGBA, const uint8_t* data, int blockWidth, int blockHeight);
|
||||
bool is_hdr(const uint8_t* data, int blockWidth, int blockHeight, bool& is_hdr);
|
||||
|
||||
} // astc
|
||||
} // basisu
|
||||
|
||||
#endif
|
||||
+676
@@ -0,0 +1,676 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2021, Dominic Szablewski - https://phoboslab.org
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
QOI - The "Quite OK Image" format for fast, lossless image compression
|
||||
|
||||
-- About
|
||||
|
||||
QOI encodes and decodes images in a lossless format. Compared to stb_image and
|
||||
stb_image_write QOI offers 20x-50x faster encoding, 3x-4x faster decoding and
|
||||
20% better compression.
|
||||
|
||||
|
||||
-- Synopsis
|
||||
|
||||
// Define `QOI_IMPLEMENTATION` in *one* C/C++ file before including this
|
||||
// library to create the implementation.
|
||||
|
||||
#define QOI_IMPLEMENTATION
|
||||
#include "qoi.h"
|
||||
|
||||
// Encode and store an RGBA buffer to the file system. The qoi_desc describes
|
||||
// the input pixel data.
|
||||
qoi_write("image_new.qoi", rgba_pixels, &(qoi_desc){
|
||||
.width = 1920,
|
||||
.height = 1080,
|
||||
.channels = 4,
|
||||
.colorspace = QOI_SRGB
|
||||
});
|
||||
|
||||
// Load and decode a QOI image from the file system into a 32bbp RGBA buffer.
|
||||
// The qoi_desc struct will be filled with the width, height, number of channels
|
||||
// and colorspace read from the file header.
|
||||
qoi_desc desc;
|
||||
void *rgba_pixels = qoi_read("image.qoi", &desc, 4);
|
||||
|
||||
|
||||
|
||||
-- Documentation
|
||||
|
||||
This library provides the following functions;
|
||||
- qoi_read -- read and decode a QOI file
|
||||
- qoi_decode -- decode the raw bytes of a QOI image from memory
|
||||
- qoi_write -- encode and write a QOI file
|
||||
- qoi_encode -- encode an rgba buffer into a QOI image in memory
|
||||
|
||||
See the function declaration below for the signature and more information.
|
||||
|
||||
If you don't want/need the qoi_read and qoi_write functions, you can define
|
||||
QOI_NO_STDIO before including this library.
|
||||
|
||||
This library uses malloc() and free(). To supply your own malloc implementation
|
||||
you can define QOI_MALLOC and QOI_FREE before including this library.
|
||||
|
||||
This library uses memset() to zero-initialize the index. To supply your own
|
||||
implementation you can define QOI_ZEROARR before including this library.
|
||||
|
||||
|
||||
-- Data Format
|
||||
|
||||
A QOI file has a 14 byte header, followed by any number of data "chunks" and an
|
||||
8-byte end marker.
|
||||
|
||||
struct qoi_header_t {
|
||||
char magic[4]; // magic bytes "qoif"
|
||||
uint32_t width; // image width in pixels (BE)
|
||||
uint32_t height; // image height in pixels (BE)
|
||||
uint8_t channels; // 3 = RGB, 4 = RGBA
|
||||
uint8_t colorspace; // 0 = sRGB with linear alpha, 1 = all channels linear
|
||||
};
|
||||
|
||||
Images are encoded row by row, left to right, top to bottom. The decoder and
|
||||
encoder start with {r: 0, g: 0, b: 0, a: 255} as the previous pixel value. An
|
||||
image is complete when all pixels specified by width * height have been covered.
|
||||
|
||||
Pixels are encoded as
|
||||
- a run of the previous pixel
|
||||
- an index into an array of previously seen pixels
|
||||
- a difference to the previous pixel value in r,g,b
|
||||
- full r,g,b or r,g,b,a values
|
||||
|
||||
The color channels are assumed to not be premultiplied with the alpha channel
|
||||
("un-premultiplied alpha").
|
||||
|
||||
A running array[64] (zero-initialized) of previously seen pixel values is
|
||||
maintained by the encoder and decoder. Each pixel that is seen by the encoder
|
||||
and decoder is put into this array at the position formed by a hash function of
|
||||
the color value. In the encoder, if the pixel value at the index matches the
|
||||
current pixel, this index position is written to the stream as QOI_OP_INDEX.
|
||||
The hash function for the index is:
|
||||
|
||||
index_position = (r * 3 + g * 5 + b * 7 + a * 11) % 64
|
||||
|
||||
Each chunk starts with a 2- or 8-bit tag, followed by a number of data bits. The
|
||||
bit length of chunks is divisible by 8 - i.e. all chunks are byte aligned. All
|
||||
values encoded in these data bits have the most significant bit on the left.
|
||||
|
||||
The 8-bit tags have precedence over the 2-bit tags. A decoder must check for the
|
||||
presence of an 8-bit tag first.
|
||||
|
||||
The byte stream's end is marked with 7 0x00 bytes followed a single 0x01 byte.
|
||||
|
||||
|
||||
The possible chunks are:
|
||||
|
||||
|
||||
.- QOI_OP_INDEX ----------.
|
||||
| Byte[0] |
|
||||
| 7 6 5 4 3 2 1 0 |
|
||||
|-------+-----------------|
|
||||
| 0 0 | index |
|
||||
`-------------------------`
|
||||
2-bit tag b00
|
||||
6-bit index into the color index array: 0..63
|
||||
|
||||
A valid encoder must not issue 2 or more consecutive QOI_OP_INDEX chunks to the
|
||||
same index. QOI_OP_RUN should be used instead.
|
||||
|
||||
|
||||
.- QOI_OP_DIFF -----------.
|
||||
| Byte[0] |
|
||||
| 7 6 5 4 3 2 1 0 |
|
||||
|-------+-----+-----+-----|
|
||||
| 0 1 | dr | dg | db |
|
||||
`-------------------------`
|
||||
2-bit tag b01
|
||||
2-bit red channel difference from the previous pixel between -2..1
|
||||
2-bit green channel difference from the previous pixel between -2..1
|
||||
2-bit blue channel difference from the previous pixel between -2..1
|
||||
|
||||
The difference to the current channel values are using a wraparound operation,
|
||||
so "1 - 2" will result in 255, while "255 + 1" will result in 0.
|
||||
|
||||
Values are stored as unsigned integers with a bias of 2. E.g. -2 is stored as
|
||||
0 (b00). 1 is stored as 3 (b11).
|
||||
|
||||
The alpha value remains unchanged from the previous pixel.
|
||||
|
||||
|
||||
.- QOI_OP_LUMA -------------------------------------.
|
||||
| Byte[0] | Byte[1] |
|
||||
| 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 |
|
||||
|-------+-----------------+-------------+-----------|
|
||||
| 1 0 | green diff | dr - dg | db - dg |
|
||||
`---------------------------------------------------`
|
||||
2-bit tag b10
|
||||
6-bit green channel difference from the previous pixel -32..31
|
||||
4-bit red channel difference minus green channel difference -8..7
|
||||
4-bit blue channel difference minus green channel difference -8..7
|
||||
|
||||
The green channel is used to indicate the general direction of change and is
|
||||
encoded in 6 bits. The red and blue channels (dr and db) base their diffs off
|
||||
of the green channel difference and are encoded in 4 bits. I.e.:
|
||||
dr_dg = (cur_px.r - prev_px.r) - (cur_px.g - prev_px.g)
|
||||
db_dg = (cur_px.b - prev_px.b) - (cur_px.g - prev_px.g)
|
||||
|
||||
The difference to the current channel values are using a wraparound operation,
|
||||
so "10 - 13" will result in 253, while "250 + 7" will result in 1.
|
||||
|
||||
Values are stored as unsigned integers with a bias of 32 for the green channel
|
||||
and a bias of 8 for the red and blue channel.
|
||||
|
||||
The alpha value remains unchanged from the previous pixel.
|
||||
|
||||
|
||||
.- QOI_OP_RUN ------------.
|
||||
| Byte[0] |
|
||||
| 7 6 5 4 3 2 1 0 |
|
||||
|-------+-----------------|
|
||||
| 1 1 | run |
|
||||
`-------------------------`
|
||||
2-bit tag b11
|
||||
6-bit run-length repeating the previous pixel: 1..62
|
||||
|
||||
The run-length is stored with a bias of -1. Note that the run-lengths 63 and 64
|
||||
(b111110 and b111111) are illegal as they are occupied by the QOI_OP_RGB and
|
||||
QOI_OP_RGBA tags.
|
||||
|
||||
|
||||
.- QOI_OP_RGB ------------------------------------------.
|
||||
| Byte[0] | Byte[1] | Byte[2] | Byte[3] |
|
||||
| 7 6 5 4 3 2 1 0 | 7 .. 0 | 7 .. 0 | 7 .. 0 |
|
||||
|-------------------------+---------+---------+---------|
|
||||
| 1 1 1 1 1 1 1 0 | red | green | blue |
|
||||
`-------------------------------------------------------`
|
||||
8-bit tag b11111110
|
||||
8-bit red channel value
|
||||
8-bit green channel value
|
||||
8-bit blue channel value
|
||||
|
||||
The alpha value remains unchanged from the previous pixel.
|
||||
|
||||
|
||||
.- QOI_OP_RGBA ---------------------------------------------------.
|
||||
| Byte[0] | Byte[1] | Byte[2] | Byte[3] | Byte[4] |
|
||||
| 7 6 5 4 3 2 1 0 | 7 .. 0 | 7 .. 0 | 7 .. 0 | 7 .. 0 |
|
||||
|-------------------------+---------+---------+---------+---------|
|
||||
| 1 1 1 1 1 1 1 1 | red | green | blue | alpha |
|
||||
`-----------------------------------------------------------------`
|
||||
8-bit tag b11111111
|
||||
8-bit red channel value
|
||||
8-bit green channel value
|
||||
8-bit blue channel value
|
||||
8-bit alpha channel value
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
Header - Public functions */
|
||||
|
||||
#ifndef QOI_H
|
||||
#define QOI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* A pointer to a qoi_desc struct has to be supplied to all of qoi's functions.
|
||||
It describes either the input format (for qoi_write and qoi_encode), or is
|
||||
filled with the description read from the file header (for qoi_read and
|
||||
qoi_decode).
|
||||
|
||||
The colorspace in this qoi_desc is an enum where
|
||||
0 = sRGB, i.e. gamma scaled RGB channels and a linear alpha channel
|
||||
1 = all channels are linear
|
||||
You may use the constants QOI_SRGB or QOI_LINEAR. The colorspace is purely
|
||||
informative. It will be saved to the file header, but does not affect
|
||||
how chunks are en-/decoded. */
|
||||
|
||||
#define QOI_SRGB 0
|
||||
#define QOI_LINEAR 1
|
||||
|
||||
typedef struct {
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned char channels;
|
||||
unsigned char colorspace;
|
||||
} qoi_desc;
|
||||
|
||||
#ifndef QOI_NO_STDIO
|
||||
|
||||
/* Encode raw RGB or RGBA pixels into a QOI image and write it to the file
|
||||
system. The qoi_desc struct must be filled with the image width, height,
|
||||
number of channels (3 = RGB, 4 = RGBA) and the colorspace.
|
||||
|
||||
The function returns 0 on failure (invalid parameters, or fopen or malloc
|
||||
failed) or the number of bytes written on success. */
|
||||
|
||||
int qoi_write(const char *filename, const void *data, const qoi_desc *desc);
|
||||
|
||||
|
||||
/* Read and decode a QOI image from the file system. If channels is 0, the
|
||||
number of channels from the file header is used. If channels is 3 or 4 the
|
||||
output format will be forced into this number of channels.
|
||||
|
||||
The function either returns NULL on failure (invalid data, or malloc or fopen
|
||||
failed) or a pointer to the decoded pixels. On success, the qoi_desc struct
|
||||
will be filled with the description from the file header.
|
||||
|
||||
The returned pixel data should be free()d after use. */
|
||||
|
||||
void *qoi_read(const char *filename, qoi_desc *desc, int channels);
|
||||
|
||||
#endif /* QOI_NO_STDIO */
|
||||
|
||||
|
||||
/* Encode raw RGB or RGBA pixels into a QOI image in memory.
|
||||
|
||||
The function either returns NULL on failure (invalid parameters or malloc
|
||||
failed) or a pointer to the encoded data on success. On success the out_len
|
||||
is set to the size in bytes of the encoded data.
|
||||
|
||||
The returned qoi data should be free()d after use. */
|
||||
|
||||
void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len);
|
||||
|
||||
|
||||
/* Decode a QOI image from memory.
|
||||
|
||||
The function either returns NULL on failure (invalid parameters or malloc
|
||||
failed) or a pointer to the decoded pixels. On success, the qoi_desc struct
|
||||
is filled with the description from the file header.
|
||||
|
||||
The returned pixel data should be free()d after use. */
|
||||
|
||||
void *qoi_decode(const void *data, int size, qoi_desc *desc, int channels);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* QOI_H */
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
Implementation */
|
||||
|
||||
#ifdef QOI_IMPLEMENTATION
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef QOI_MALLOC
|
||||
#define QOI_MALLOC(sz) malloc(sz)
|
||||
#define QOI_FREE(p) free(p)
|
||||
#endif
|
||||
#ifndef QOI_ZEROARR
|
||||
#define QOI_ZEROARR(a) memset((a),0,sizeof(a))
|
||||
#endif
|
||||
|
||||
#define QOI_OP_INDEX 0x00 /* 00xxxxxx */
|
||||
#define QOI_OP_DIFF 0x40 /* 01xxxxxx */
|
||||
#define QOI_OP_LUMA 0x80 /* 10xxxxxx */
|
||||
#define QOI_OP_RUN 0xc0 /* 11xxxxxx */
|
||||
#define QOI_OP_RGB 0xfe /* 11111110 */
|
||||
#define QOI_OP_RGBA 0xff /* 11111111 */
|
||||
|
||||
#define QOI_MASK_2 0xc0 /* 11000000 */
|
||||
|
||||
#define QOI_COLOR_HASH(C) (C.rgba.r*3 + C.rgba.g*5 + C.rgba.b*7 + C.rgba.a*11)
|
||||
#define QOI_MAGIC \
|
||||
(((unsigned int)'q') << 24 | ((unsigned int)'o') << 16 | \
|
||||
((unsigned int)'i') << 8 | ((unsigned int)'f'))
|
||||
#define QOI_HEADER_SIZE 14
|
||||
|
||||
/* 2GB is the max file size that this implementation can safely handle. We guard
|
||||
against anything larger than that, assuming the worst case with 5 bytes per
|
||||
pixel, rounded down to a nice clean value. 400 million pixels ought to be
|
||||
enough for anybody. */
|
||||
#define QOI_PIXELS_MAX ((unsigned int)400000000)
|
||||
|
||||
typedef union {
|
||||
struct { unsigned char r, g, b, a; } rgba;
|
||||
unsigned int v;
|
||||
} qoi_rgba_t;
|
||||
|
||||
static const unsigned char qoi_padding[8] = {0,0,0,0,0,0,0,1};
|
||||
|
||||
static void qoi_write_32(unsigned char *bytes, int *p, unsigned int v) {
|
||||
bytes[(*p)++] = (uint8_t)((0xff000000 & v) >> 24);
|
||||
bytes[(*p)++] = (uint8_t)((0x00ff0000 & v) >> 16);
|
||||
bytes[(*p)++] = (uint8_t)((0x0000ff00 & v) >> 8);
|
||||
bytes[(*p)++] = (uint8_t)((0x000000ff & v));
|
||||
}
|
||||
|
||||
static unsigned int qoi_read_32(const unsigned char *bytes, size_t *p) {
|
||||
unsigned int a = bytes[(*p)++];
|
||||
unsigned int b = bytes[(*p)++];
|
||||
unsigned int c = bytes[(*p)++];
|
||||
unsigned int d = bytes[(*p)++];
|
||||
return a << 24 | b << 16 | c << 8 | d;
|
||||
}
|
||||
|
||||
void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len) {
|
||||
int i, max_size, p, run;
|
||||
int px_len, px_end, px_pos, channels;
|
||||
unsigned char *bytes;
|
||||
const unsigned char *pixels;
|
||||
qoi_rgba_t index[64];
|
||||
qoi_rgba_t px, px_prev;
|
||||
|
||||
if (
|
||||
data == NULL || out_len == NULL || desc == NULL ||
|
||||
desc->width == 0 || desc->height == 0 ||
|
||||
desc->channels < 3 || desc->channels > 4 ||
|
||||
desc->colorspace > 1 ||
|
||||
desc->height >= QOI_PIXELS_MAX / desc->width
|
||||
) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
max_size =
|
||||
desc->width * desc->height * (desc->channels + 1) +
|
||||
QOI_HEADER_SIZE + sizeof(qoi_padding);
|
||||
|
||||
p = 0;
|
||||
bytes = (unsigned char *) QOI_MALLOC(max_size);
|
||||
if (!bytes) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
qoi_write_32(bytes, &p, QOI_MAGIC);
|
||||
qoi_write_32(bytes, &p, desc->width);
|
||||
qoi_write_32(bytes, &p, desc->height);
|
||||
bytes[p++] = desc->channels;
|
||||
bytes[p++] = desc->colorspace;
|
||||
|
||||
|
||||
pixels = (const unsigned char *)data;
|
||||
|
||||
QOI_ZEROARR(index);
|
||||
|
||||
run = 0;
|
||||
px_prev.rgba.r = 0;
|
||||
px_prev.rgba.g = 0;
|
||||
px_prev.rgba.b = 0;
|
||||
px_prev.rgba.a = 255;
|
||||
px = px_prev;
|
||||
|
||||
px_len = desc->width * desc->height * desc->channels;
|
||||
px_end = px_len - desc->channels;
|
||||
channels = desc->channels;
|
||||
|
||||
for (px_pos = 0; px_pos < px_len; px_pos += channels) {
|
||||
px.rgba.r = pixels[px_pos + 0];
|
||||
px.rgba.g = pixels[px_pos + 1];
|
||||
px.rgba.b = pixels[px_pos + 2];
|
||||
|
||||
if (channels == 4) {
|
||||
px.rgba.a = pixels[px_pos + 3];
|
||||
}
|
||||
|
||||
if (px.v == px_prev.v) {
|
||||
run++;
|
||||
if (run == 62 || px_pos == px_end) {
|
||||
bytes[p++] = (uint8_t)(QOI_OP_RUN | (run - 1));
|
||||
run = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
int index_pos;
|
||||
|
||||
if (run > 0) {
|
||||
bytes[p++] = (uint8_t)(QOI_OP_RUN | (run - 1));
|
||||
run = 0;
|
||||
}
|
||||
|
||||
index_pos = QOI_COLOR_HASH(px) % 64;
|
||||
|
||||
if (index[index_pos].v == px.v) {
|
||||
bytes[p++] = (uint8_t)(QOI_OP_INDEX | index_pos);
|
||||
}
|
||||
else {
|
||||
index[index_pos] = px;
|
||||
|
||||
if (px.rgba.a == px_prev.rgba.a) {
|
||||
signed char vr = px.rgba.r - px_prev.rgba.r;
|
||||
signed char vg = px.rgba.g - px_prev.rgba.g;
|
||||
signed char vb = px.rgba.b - px_prev.rgba.b;
|
||||
|
||||
signed char vg_r = vr - vg;
|
||||
signed char vg_b = vb - vg;
|
||||
|
||||
if (
|
||||
vr > -3 && vr < 2 &&
|
||||
vg > -3 && vg < 2 &&
|
||||
vb > -3 && vb < 2
|
||||
) {
|
||||
bytes[p++] = QOI_OP_DIFF | (vr + 2) << 4 | (vg + 2) << 2 | (vb + 2);
|
||||
}
|
||||
else if (
|
||||
vg_r > -9 && vg_r < 8 &&
|
||||
vg > -33 && vg < 32 &&
|
||||
vg_b > -9 && vg_b < 8
|
||||
) {
|
||||
bytes[p++] = QOI_OP_LUMA | (vg + 32);
|
||||
bytes[p++] = (vg_r + 8) << 4 | (vg_b + 8);
|
||||
}
|
||||
else {
|
||||
bytes[p++] = QOI_OP_RGB;
|
||||
bytes[p++] = px.rgba.r;
|
||||
bytes[p++] = px.rgba.g;
|
||||
bytes[p++] = px.rgba.b;
|
||||
}
|
||||
}
|
||||
else {
|
||||
bytes[p++] = QOI_OP_RGBA;
|
||||
bytes[p++] = px.rgba.r;
|
||||
bytes[p++] = px.rgba.g;
|
||||
bytes[p++] = px.rgba.b;
|
||||
bytes[p++] = px.rgba.a;
|
||||
}
|
||||
}
|
||||
}
|
||||
px_prev = px;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)sizeof(qoi_padding); i++) {
|
||||
bytes[p++] = qoi_padding[i];
|
||||
}
|
||||
|
||||
*out_len = p;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
void *qoi_decode(const void *data, size_t size, qoi_desc *desc, int channels) {
|
||||
const unsigned char *bytes;
|
||||
unsigned int header_magic;
|
||||
unsigned char *pixels;
|
||||
qoi_rgba_t index[64];
|
||||
qoi_rgba_t px;
|
||||
int px_len, px_pos;
|
||||
size_t chunks_len, p = 0;
|
||||
int run = 0;
|
||||
|
||||
if (
|
||||
data == NULL || desc == NULL ||
|
||||
(channels != 0 && channels != 3 && channels != 4) ||
|
||||
size < QOI_HEADER_SIZE + (int)sizeof(qoi_padding)
|
||||
) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bytes = (const unsigned char *)data;
|
||||
|
||||
header_magic = qoi_read_32(bytes, &p);
|
||||
desc->width = qoi_read_32(bytes, &p);
|
||||
desc->height = qoi_read_32(bytes, &p);
|
||||
desc->channels = bytes[p++];
|
||||
desc->colorspace = bytes[p++];
|
||||
|
||||
if (
|
||||
desc->width == 0 || desc->height == 0 ||
|
||||
desc->channels < 3 || desc->channels > 4 ||
|
||||
desc->colorspace > 1 ||
|
||||
header_magic != QOI_MAGIC ||
|
||||
desc->height >= QOI_PIXELS_MAX / desc->width
|
||||
) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (channels == 0) {
|
||||
channels = desc->channels;
|
||||
}
|
||||
|
||||
px_len = desc->width * desc->height * channels;
|
||||
pixels = (unsigned char *) QOI_MALLOC(px_len);
|
||||
if (!pixels) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QOI_ZEROARR(index);
|
||||
px.rgba.r = 0;
|
||||
px.rgba.g = 0;
|
||||
px.rgba.b = 0;
|
||||
px.rgba.a = 255;
|
||||
|
||||
chunks_len = size - (int)sizeof(qoi_padding);
|
||||
for (px_pos = 0; px_pos < px_len; px_pos += channels) {
|
||||
if (run > 0) {
|
||||
run--;
|
||||
}
|
||||
else if (p < chunks_len) {
|
||||
int b1 = bytes[p++];
|
||||
|
||||
if (b1 == QOI_OP_RGB) {
|
||||
px.rgba.r = bytes[p++];
|
||||
px.rgba.g = bytes[p++];
|
||||
px.rgba.b = bytes[p++];
|
||||
}
|
||||
else if (b1 == QOI_OP_RGBA) {
|
||||
px.rgba.r = bytes[p++];
|
||||
px.rgba.g = bytes[p++];
|
||||
px.rgba.b = bytes[p++];
|
||||
px.rgba.a = bytes[p++];
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_INDEX) {
|
||||
px = index[b1];
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_DIFF) {
|
||||
px.rgba.r += ((b1 >> 4) & 0x03) - 2;
|
||||
px.rgba.g += ((b1 >> 2) & 0x03) - 2;
|
||||
px.rgba.b += ( b1 & 0x03) - 2;
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_LUMA) {
|
||||
int b2 = bytes[p++];
|
||||
int vg = (b1 & 0x3f) - 32;
|
||||
px.rgba.r += (uint8_t)(vg - 8 + ((b2 >> 4) & 0x0f));
|
||||
px.rgba.g += (uint8_t)(vg);
|
||||
px.rgba.b += (uint8_t)(vg - 8 + (b2 & 0x0f));
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_RUN) {
|
||||
run = (b1 & 0x3f);
|
||||
}
|
||||
|
||||
index[QOI_COLOR_HASH(px) % 64] = px;
|
||||
}
|
||||
|
||||
pixels[px_pos + 0] = px.rgba.r;
|
||||
pixels[px_pos + 1] = px.rgba.g;
|
||||
pixels[px_pos + 2] = px.rgba.b;
|
||||
|
||||
if (channels == 4) {
|
||||
pixels[px_pos + 3] = px.rgba.a;
|
||||
}
|
||||
}
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
#ifndef QOI_NO_STDIO
|
||||
#include <stdio.h>
|
||||
|
||||
int qoi_write(const char *filename, const void *data, const qoi_desc *desc) {
|
||||
#ifdef _MSC_VER
|
||||
FILE* f = NULL;
|
||||
fopen_s(&f, filename, "wb");
|
||||
#else
|
||||
FILE *f = fopen(filename, "wb");
|
||||
#endif
|
||||
int size, err;
|
||||
void *encoded;
|
||||
|
||||
if (!f) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
encoded = qoi_encode(data, desc, &size);
|
||||
if (!encoded) {
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fwrite(encoded, 1, size, f);
|
||||
fflush(f);
|
||||
err = ferror(f);
|
||||
fclose(f);
|
||||
|
||||
QOI_FREE(encoded);
|
||||
return err ? 0 : size;
|
||||
}
|
||||
|
||||
void *qoi_read(const char *filename, qoi_desc *desc, int channels) {
|
||||
#ifdef _MSC_VER
|
||||
FILE* f = NULL;
|
||||
fopen_s(&f, filename, "rb");
|
||||
#else
|
||||
FILE *f = fopen(filename, "rb");
|
||||
#endif
|
||||
size_t size, bytes_read;
|
||||
void *pixels, *data;
|
||||
long sz;
|
||||
|
||||
if (!f) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
|
||||
sz = ftell(f);
|
||||
if (sz <= 0)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = (size_t)sz;
|
||||
|
||||
if (size != (unsigned long)sz)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fseek(f, 0, SEEK_SET) != 0) {
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data = QOI_MALLOC(size);
|
||||
if (!data) {
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bytes_read = (int)fread(data, 1, size, f);
|
||||
fclose(f);
|
||||
pixels = (bytes_read != size) ? NULL : qoi_decode(data, bytes_read, desc, channels);
|
||||
QOI_FREE(data);
|
||||
return pixels;
|
||||
}
|
||||
|
||||
#endif /* QOI_NO_STDIO */
|
||||
#endif /* QOI_IMPLEMENTATION */
|
||||
+2083
File diff suppressed because it is too large
Load Diff
+12
@@ -0,0 +1,12 @@
|
||||
#if defined(_WIN32)
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable:4530) // warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
|
||||
#endif
|
||||
|
||||
#define TINYEXR_IMPLEMENTATION
|
||||
#include "tinyexr.h"
|
||||
+9334
File diff suppressed because it is too large
Load Diff
+7077
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,139 @@
|
||||
// File: basisu_astc_hdr_6x6_enc.h
|
||||
#pragma once
|
||||
#include "basisu_enc.h"
|
||||
#include "../transcoder/basisu_astc_hdr_core.h"
|
||||
|
||||
namespace astc_6x6_hdr
|
||||
{
|
||||
const uint32_t ASTC_HDR_6X6_DEF_USER_COMP_LEVEL = 2;
|
||||
const uint32_t ASTC_HDR_6X6_MAX_USER_COMP_LEVEL = 12;
|
||||
|
||||
const uint32_t ASTC_HDR_6X6_MAX_COMP_LEVEL = 4;
|
||||
|
||||
const float LDR_BLACK_BIAS = 0.0f;// .49f;
|
||||
|
||||
// Note: This struct is copied several times, so do not place any heavyweight objects in here.
|
||||
struct astc_hdr_6x6_global_config
|
||||
{
|
||||
// Important: The Delta ITP colorspace error metric we use internally makes several assumptions about the nature of the HDR RGB inputs supplied to the encoder.
|
||||
// This encoder computes colorspace error in the ICtCp (or more accurately the delta E ITP, where CT is scaled by .5 vs. ICtCp to become T) colorspace, so getting this correct is important.
|
||||
// By default the encoder assumes the input is in absolute luminance (in nits or candela per square meter, cd/m^2), specified as positive-only linear light RGB, using the REC 709 colorspace gamut (but NOT the sRGB transfer function, i.e. linear light).
|
||||
// If the m_rec2020_bt2100_color_gamut flag is true, the input colorspace is treated as REC 2020/BT.2100 (which is wider than 709).
|
||||
// For SDR/LDR->HDR upconversion, the REC 709 sRGB input should be converted to linear light (sRGB->linear) and the resulting normalized linear RGB values scaled by either 80 or 100 nits (the luminance of a typical SDR monitor).
|
||||
// SDR upconversion to normalized [0,1] (i.e. non-absolute) luminances may work but is not supported because ITP errors will not be predicted correctly.
|
||||
// 11/3/2025: This flag is always copied straight into the output KTX2 DFD colorspace, even for non-HDR formats.
|
||||
// TODO: Move this parameter to reflect this.
|
||||
bool m_rec2020_bt2100_color_gamut = false;
|
||||
|
||||
// levels 0-3 normal levels, 4=exhaustive
|
||||
uint32_t m_master_comp_level = 0;
|
||||
uint32_t m_highest_comp_level = 1;
|
||||
|
||||
float m_lambda = 0.0f;
|
||||
|
||||
bool m_extra_patterns_flag = false; // def to false, works in comp levels [1,4]
|
||||
bool m_brute_force_partition_matching = false; // def to false
|
||||
|
||||
bool m_jnd_optimization = false; // defaults to false for HDR inputs, on SDR upconverted images this can default to enabled
|
||||
float m_jnd_delta_itp_thresh = .75f;
|
||||
|
||||
bool m_force_one_strip = false;
|
||||
|
||||
bool m_gaussian1_fallback = true; // def to true, if this is disabled m_gaussian2_fallback should be disabled too
|
||||
float m_gaussian1_strength = 1.45f;
|
||||
|
||||
bool m_gaussian2_fallback = true; // def to true, hopefully rarely kicks in
|
||||
float m_gaussian2_strength = 1.83f;
|
||||
|
||||
// m_disable_delta_endpoint_usage may give a slight increase in RDO ASTC encoding efficiency. It's also faster.
|
||||
bool m_disable_delta_endpoint_usage = false;
|
||||
|
||||
// Scale up Delta ITP errors for very dark pixels, assuming they will be brightly exposed > 1.0x.
|
||||
// We don't know if the output will be exposed, or not. If heavily exposed, our JND calculations will not be conservative enough.
|
||||
bool m_delta_itp_dark_adjustment = true;
|
||||
|
||||
bool m_debug_images = false;
|
||||
std::string m_debug_image_prefix = "dbg_astc_hdr_6x6_devel_";
|
||||
|
||||
bool m_output_images = false;
|
||||
std::string m_output_image_prefix = "dbg_astc_hdr_6x6_output_";
|
||||
|
||||
bool m_debug_output = false;
|
||||
bool m_image_stats = false;
|
||||
bool m_status_output = false;
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Very low level/devel parameters - intended for development. Best not to change them.
|
||||
//-------------------------------------------------------------------------------------
|
||||
bool m_deblocking_flag = true;
|
||||
float m_deblock_penalty_weight = .03f;
|
||||
bool m_disable_twothree_subsets = false; // def to false
|
||||
bool m_use_solid_blocks = true; // def to true
|
||||
bool m_use_runs = true; // def to true
|
||||
bool m_block_stat_optimizations_flag = true; // def to true
|
||||
|
||||
bool m_rdo_candidate_diversity_boost = true; // def to true
|
||||
float m_rdo_candidate_diversity_boost_bit_window_weight = 1.2f;
|
||||
|
||||
bool m_favor_higher_compression = true; // utilize all modes
|
||||
uint32_t m_num_reuse_xy_deltas = basist::astc_6x6_hdr::NUM_REUSE_XY_DELTAS;
|
||||
|
||||
// By default, for compatibility with KTX-Software (which uses v1.60), we write v1.6 compatible UASTC HDR 6x6i files.
|
||||
// The transcoder is compatible with both variants. This setting impacts how 2x2 blocks are upsampled and the initial marker version.
|
||||
// Eventually once KTX-Software upgrades to the latest version of basisu this will be defaulted to false.
|
||||
// If this is false a v2.0 or later transcoder is required for UASTC HDR 6x6i.
|
||||
bool m_write_basisu_1_6_compatible_files = true;
|
||||
|
||||
void print() const
|
||||
{
|
||||
basisu::fmt_debug_printf(" m_master_comp_level: {}, m_highest_comp_level: {}\n", m_master_comp_level, m_highest_comp_level);
|
||||
basisu::fmt_debug_printf(" m_lambda: {}\n", m_lambda);
|
||||
basisu::fmt_debug_printf(" m_rec2020_bt2100_color_gamut: {}\n", m_rec2020_bt2100_color_gamut);
|
||||
basisu::fmt_debug_printf(" m_extra_patterns_flag: {}, m_brute_force_partition_matching: {}\n", m_extra_patterns_flag, m_brute_force_partition_matching);
|
||||
basisu::fmt_debug_printf(" m_jnd_optimization: {}, m_jnd_delta_itp_thresh: {}\n", m_jnd_optimization, m_jnd_delta_itp_thresh);
|
||||
basisu::fmt_debug_printf(" m_force_one_strip: {}\n", m_force_one_strip);
|
||||
basisu::fmt_debug_printf(" m_gaussian1_fallback: {}, m_gaussian1_strength: {}\n", m_gaussian1_fallback, m_gaussian1_strength);
|
||||
basisu::fmt_debug_printf(" m_gaussian2_fallback: {}, m_gaussian2_strength: {}\n", m_gaussian2_fallback, m_gaussian2_strength);
|
||||
basisu::fmt_debug_printf(" m_disable_delta_endpoint_usage: {}\n", m_disable_delta_endpoint_usage);
|
||||
basisu::fmt_debug_printf(" m_delta_itp_dark_adjustment: {}\n", m_delta_itp_dark_adjustment);
|
||||
basisu::fmt_debug_printf(" m_debug_images: {}, m_debug_image_prefix: {}\n", m_debug_images, m_debug_image_prefix);
|
||||
basisu::fmt_debug_printf(" m_output_images: {}, m_output_image_prefix: {}\n", m_output_images, m_output_image_prefix);
|
||||
basisu::fmt_debug_printf(" m_image_stats: {}, m_status_output: {}\n", m_image_stats, m_status_output);
|
||||
basisu::fmt_debug_printf(" m_deblocking_flag: {}, m_deblock_penalty_weight: {}\n", m_deblocking_flag, m_deblock_penalty_weight);
|
||||
basisu::fmt_debug_printf(" m_disable_twothree_subsets: {}, m_use_solid_blocks: {}\n", m_disable_twothree_subsets, m_use_solid_blocks);
|
||||
basisu::fmt_debug_printf(" m_use_runs: {}, m_block_stat_optimizations_flag: {}\n", m_use_runs, m_block_stat_optimizations_flag);
|
||||
basisu::fmt_debug_printf(" m_rdo_candidate_diversity_boost: {}, m_rdo_candidate_diversity_boost_bit_window_weight: {}\n", m_rdo_candidate_diversity_boost, m_rdo_candidate_diversity_boost_bit_window_weight);
|
||||
basisu::fmt_debug_printf(" m_favor_higher_compression: {}, m_num_reuse_xy_deltas: {}\n", m_favor_higher_compression, m_num_reuse_xy_deltas);
|
||||
basisu::fmt_debug_printf(" m_write_basisu_1_6_compatible_files: {}\n", m_write_basisu_1_6_compatible_files);
|
||||
}
|
||||
|
||||
astc_hdr_6x6_global_config()
|
||||
{
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
astc_hdr_6x6_global_config def;
|
||||
std::swap(*this, def);
|
||||
}
|
||||
|
||||
// Max level is ASTC_HDR_6X6_MAX_USER_COMP_LEVEL
|
||||
void set_user_level(int level);
|
||||
};
|
||||
|
||||
void global_init();
|
||||
|
||||
struct result_metrics
|
||||
{
|
||||
basisu::image_metrics m_im_astc_log2;
|
||||
basisu::image_metrics m_im_astc_half;
|
||||
|
||||
basisu::image_metrics m_im_bc6h_log2;
|
||||
basisu::image_metrics m_im_bc6h_half;
|
||||
};
|
||||
|
||||
// The input image should be unpadded to 6x6 boundaries, i.e. the original unexpanded image.
|
||||
bool compress_photo(const basisu::imagef& orig_src_img, const astc_hdr_6x6_global_config& global_cfg, basisu::job_pool* pJob_pool,
|
||||
basisu::uint8_vec& intermediate_tex_data, basisu::uint8_vec& astc_tex_data, result_metrics& metrics);
|
||||
|
||||
} // namespace uastc_6x6_hdr
|
||||
+6374
File diff suppressed because it is too large
Load Diff
+433
@@ -0,0 +1,433 @@
|
||||
// File: basisu_astc_hdr_common.h
|
||||
#pragma once
|
||||
#include "basisu_enc.h"
|
||||
#include "basisu_gpu_texture.h"
|
||||
#include "../transcoder/basisu_astc_helpers.h"
|
||||
#include "../transcoder/basisu_astc_hdr_core.h"
|
||||
|
||||
namespace basisu
|
||||
{
|
||||
const uint32_t MAX_ASTC_HDR_BLOCK_W = 6, MAX_ASTC_HDR_BLOCK_H = 6;
|
||||
const uint32_t MAX_ASTC_HDR_ENC_BLOCK_PIXELS = 6 * 6;
|
||||
|
||||
const uint32_t MODE11_TOTAL_SUBMODES = 8; // plus an extra hidden submode, directly encoded, for direct, so really 9 (see tables 99/100 of the ASTC spec)
|
||||
const uint32_t MODE7_TOTAL_SUBMODES = 6;
|
||||
|
||||
// [ise_range][0] = # levels
|
||||
// [ise_range][1...] = lerp value [0,64]
|
||||
// in ASTC order
|
||||
// Supported ISE weight ranges: 0 to 11, 12 total
|
||||
const uint32_t MIN_SUPPORTED_ISE_WEIGHT_INDEX = astc_helpers::BISE_2_LEVELS; // ISE 0=2 levels
|
||||
const uint32_t MAX_SUPPORTED_ISE_WEIGHT_INDEX = astc_helpers::BISE_32_LEVELS; // ISE 11=32 levels
|
||||
const uint32_t MIN_SUPPORTED_WEIGHT_LEVELS = 2;
|
||||
const uint32_t MAX_SUPPORTED_WEIGHT_LEVELS = 32;
|
||||
|
||||
extern const uint8_t g_ise_weight_lerps[MAX_SUPPORTED_ISE_WEIGHT_INDEX + 1][33];
|
||||
|
||||
const float Q_LOG_BIAS_4x4 = .125f; // the original UASTC HDR 4x4 log bias
|
||||
const float Q_LOG_BIAS_6x6 = 1.0f; // the log bias both encoders use now
|
||||
|
||||
const float LDR_TO_HDR_NITS = 100.0f;
|
||||
|
||||
extern vec4F g_astc_ls_weights_ise[MAX_SUPPORTED_ISE_WEIGHT_INDEX + 1][MAX_SUPPORTED_WEIGHT_LEVELS];
|
||||
extern uint8_t g_map_astc_to_linear_order[MAX_SUPPORTED_ISE_WEIGHT_INDEX + 1][MAX_SUPPORTED_WEIGHT_LEVELS]; // [ise_range][astc_index] -> linear index
|
||||
extern uint8_t g_map_linear_to_astc_order[MAX_SUPPORTED_ISE_WEIGHT_INDEX + 1][MAX_SUPPORTED_WEIGHT_LEVELS]; // [ise_range][linear_index] -> astc_index
|
||||
|
||||
struct astc_hdr_codec_base_options
|
||||
{
|
||||
float m_r_err_scale, m_g_err_scale;
|
||||
float m_q_log_bias;
|
||||
|
||||
bool m_ultra_quant;
|
||||
|
||||
// If true, the ASTC HDR compressor is allowed to more aggressively vary weight indices for slightly higher compression in non-fastest mode. This will hurt BC6H quality, however.
|
||||
bool m_allow_uber_mode;
|
||||
|
||||
bool m_mode7_full_s_optimization;
|
||||
|
||||
bool m_take_first_non_clamping_mode11_submode;
|
||||
bool m_take_first_non_clamping_mode7_submode;
|
||||
|
||||
bool m_disable_weight_plane_optimization;
|
||||
|
||||
astc_hdr_codec_base_options() { init(); }
|
||||
|
||||
void init();
|
||||
};
|
||||
|
||||
inline int get_bit(
|
||||
int src_val, int src_bit)
|
||||
{
|
||||
assert(src_bit >= 0 && src_bit <= 31);
|
||||
int bit = (src_val >> src_bit) & 1;
|
||||
return bit;
|
||||
}
|
||||
|
||||
inline void pack_bit(
|
||||
int& dst, int dst_bit,
|
||||
int src_val, int src_bit = 0)
|
||||
{
|
||||
assert(dst_bit >= 0 && dst_bit <= 31);
|
||||
int bit = get_bit(src_val, src_bit);
|
||||
dst |= (bit << dst_bit);
|
||||
}
|
||||
|
||||
inline uint32_t get_max_qlog(uint32_t bits)
|
||||
{
|
||||
switch (bits)
|
||||
{
|
||||
case 7: return basist::MAX_QLOG7;
|
||||
case 8: return basist::MAX_QLOG8;
|
||||
case 9: return basist::MAX_QLOG9;
|
||||
case 10: return basist::MAX_QLOG10;
|
||||
case 11: return basist::MAX_QLOG11;
|
||||
case 12: return basist::MAX_QLOG12;
|
||||
case 16: return basist::MAX_QLOG16;
|
||||
default: assert(0); break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
inline float get_max_qlog_val(uint32_t bits)
|
||||
{
|
||||
switch (bits)
|
||||
{
|
||||
case 7: return MAX_QLOG7_VAL;
|
||||
case 8: return MAX_QLOG8_VAL;
|
||||
case 9: return MAX_QLOG9_VAL;
|
||||
case 10: return MAX_QLOG10_VAL;
|
||||
case 11: return MAX_QLOG11_VAL;
|
||||
case 12: return MAX_QLOG12_VAL;
|
||||
case 16: return MAX_QLOG16_VAL;
|
||||
default: assert(0); break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// Input is the low 11 bits of the qlog
|
||||
// Returns the 10-bit mantissa of the half float value
|
||||
int qlog11_to_half_float_mantissa(int M)
|
||||
{
|
||||
assert(M <= 0x7FF);
|
||||
int Mt;
|
||||
if (M < 512)
|
||||
Mt = 3 * M;
|
||||
else if (M >= 1536)
|
||||
Mt = 5 * M - 2048;
|
||||
else
|
||||
Mt = 4 * M - 512;
|
||||
return (Mt >> 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Input is the 10-bit mantissa of the half float value
|
||||
// Output is the 11-bit qlog value
|
||||
// Inverse of qlog11_to_half_float_mantissa()
|
||||
inline int half_float_mantissa_to_qlog11(int hf)
|
||||
{
|
||||
int q0 = (hf * 8 + 2) / 3;
|
||||
int q1 = (hf * 8 + 2048 + 4) / 5;
|
||||
|
||||
if (q0 < 512)
|
||||
return q0;
|
||||
else if (q1 >= 1536)
|
||||
return q1;
|
||||
|
||||
int q2 = (hf * 8 + 512 + 2) / 4;
|
||||
return q2;
|
||||
}
|
||||
|
||||
inline int half_to_qlog16(int hf)
|
||||
{
|
||||
assert(!basist::half_is_signed((basist::half_float)hf) && !basist::is_half_inf_or_nan((basist::half_float)hf));
|
||||
|
||||
// extract 5 bits exponent, which is carried through to qlog16 unchanged
|
||||
const int exp = (hf >> 10) & 0x1F;
|
||||
|
||||
// extract and invert the 10 bit mantissa to nearest qlog11 (should be lossless)
|
||||
const int mantissa = half_float_mantissa_to_qlog11(hf & 0x3FF);
|
||||
assert(mantissa <= 0x7FF);
|
||||
|
||||
// Now combine to qlog16, which is what ASTC HDR interpolates using the [0-64] weights.
|
||||
uint32_t qlog16 = (exp << 11) | mantissa;
|
||||
|
||||
// should be a lossless operation
|
||||
assert(astc_helpers::qlog16_to_half(qlog16) == hf);
|
||||
|
||||
return qlog16;
|
||||
}
|
||||
|
||||
void interpolate_qlog12_colors(
|
||||
const int e[2][3],
|
||||
basist::half_float* pDecoded_half,
|
||||
vec3F* pDecoded_float,
|
||||
uint32_t n, uint32_t ise_weight_range);
|
||||
|
||||
bool get_astc_hdr_mode_11_block_colors(
|
||||
const uint8_t* pEndpoints,
|
||||
basist::half_float* pDecoded_half,
|
||||
vec3F* pDecoded_float,
|
||||
uint32_t n, uint32_t ise_weight_range, uint32_t ise_endpoint_range);
|
||||
|
||||
bool get_astc_hdr_mode_7_block_colors(
|
||||
const uint8_t* pEndpoints,
|
||||
basist::half_float* pDecoded_half,
|
||||
vec3F* pDecoded_float,
|
||||
uint32_t n, uint32_t ise_weight_range, uint32_t ise_endpoint_range);
|
||||
|
||||
// Fast high precision piecewise linear approximation of log2(bias+x).
|
||||
// Half may be zero, positive or denormal. No NaN/Inf/negative.
|
||||
BASISU_FORCE_INLINE double q(basist::half_float x, float log_bias)
|
||||
{
|
||||
union { float f; int32_t i; uint32_t u; } fi;
|
||||
|
||||
fi.f = fast_half_to_float_pos_not_inf_or_nan(x);
|
||||
|
||||
assert(fi.f >= 0.0f);
|
||||
|
||||
fi.f += log_bias;
|
||||
|
||||
return (double)fi.u; // approx log2f(fi.f), need to return double for the precision
|
||||
}
|
||||
|
||||
BASISU_FORCE_INLINE uint32_t q2(basist::half_float x, float log_bias)
|
||||
{
|
||||
union { float f; int32_t i; uint32_t u; } fi;
|
||||
|
||||
fi.f = fast_half_to_float_pos_not_inf_or_nan(x);
|
||||
|
||||
assert(fi.f >= 0.0f);
|
||||
|
||||
fi.f += log_bias;
|
||||
|
||||
return fi.u;
|
||||
}
|
||||
|
||||
double eval_selectors(
|
||||
uint32_t num_pixels,
|
||||
uint8_t* pWeights,
|
||||
uint32_t ise_weight_range,
|
||||
const basist::half_float* pBlock_pixels_half,
|
||||
uint32_t num_weight_levels,
|
||||
const basist::half_float* pDecoded_half,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
uint32_t usable_selector_bitmask = UINT32_MAX);
|
||||
|
||||
double eval_selectors_dual_plane(
|
||||
uint32_t channel_index,
|
||||
uint32_t num_pixels,
|
||||
uint8_t* pWeights0, uint8_t* pWeights1,
|
||||
const basist::half_float* pBlock_pixels_half,
|
||||
uint32_t num_weight_levels,
|
||||
const basist::half_float* pDecoded_half,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
uint32_t usable_selector_bitmask = UINT32_MAX);
|
||||
|
||||
double compute_block_error(uint32_t num_pixels, const basist::half_float* pOrig_block, const basist::half_float* pPacked_block, const astc_hdr_codec_base_options& coptions);
|
||||
|
||||
const uint32_t FIRST_MODE7_SUBMODE_INDEX = 0;
|
||||
const uint32_t MAX_MODE7_SUBMODE_INDEX = 5;
|
||||
|
||||
bool pack_mode7(
|
||||
const vec3F& high_color_q16, const float s_q16,
|
||||
uint32_t ise_endpoint_range, uint8_t* pEndpoints,
|
||||
uint32_t ise_weight_range, // only used for determining biasing during CEM 7 packing
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
int32_t first_submode, int32_t last_submode, bool ignore_clamping, uint32_t& submode_used);
|
||||
|
||||
bool try_mode7(
|
||||
uint32_t num_pixels,
|
||||
uint8_t* pEndpoints, uint8_t* pWeights, double& cur_block_error, uint32_t& submode_used,
|
||||
const vec3F& high_color_q16, const float s_q16,
|
||||
const basist::half_float block_pixels_half[][3],
|
||||
uint32_t num_weight_levels, uint32_t ise_weight_range, const astc_hdr_codec_base_options& coptions,
|
||||
uint32_t ise_endpoint_range,
|
||||
int32_t first_submode = 0, int32_t last_submode = MAX_MODE7_SUBMODE_INDEX);
|
||||
|
||||
bool pack_mode11(
|
||||
const vec3F& low_color_q16, const vec3F& high_color_q16,
|
||||
uint32_t ise_endpoint_range, uint8_t* pEndpoints,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
bool direct_only, int32_t first_submode, int32_t last_submode, bool ignore_clamping, uint32_t& submode_used);
|
||||
|
||||
bool try_mode11(uint32_t num_pixels,
|
||||
uint8_t* pEndpoints, uint8_t* pWeights, double& cur_block_error, uint32_t& submode_used,
|
||||
const vec3F& low_color_q16, const vec3F& high_color_q16,
|
||||
const basist::half_float block_pixels_half[][3],
|
||||
uint32_t num_weight_levels, uint32_t ise_weight_range, const astc_hdr_codec_base_options& coptions, bool direct_only, uint32_t ise_endpoint_range,
|
||||
bool constrain_ise_weight_selectors,
|
||||
int32_t first_submode, int32_t last_submode, bool ignore_clamping);
|
||||
|
||||
bool try_mode11_dual_plane(uint32_t channel_index, uint32_t num_pixels,
|
||||
uint8_t* pEndpoints, uint8_t* pWeights0, uint8_t* pWeights1, double& cur_block_error, uint32_t& submode_used,
|
||||
const vec3F& low_color_q16, const vec3F& high_color_q16,
|
||||
const basist::half_float block_pixels_half[][3],
|
||||
uint32_t num_weight_levels, uint32_t ise_weight_range, const astc_hdr_codec_base_options& coptions, bool direct_only, uint32_t ise_endpoint_range,
|
||||
bool constrain_ise_weight_selectors,
|
||||
int32_t first_submode, int32_t last_submode, bool ignore_clamping);
|
||||
|
||||
const int FIRST_MODE11_SUBMODE_INDEX = -1;
|
||||
const int MAX_MODE11_SUBMODE_INDEX = 7;
|
||||
|
||||
enum opt_mode_t
|
||||
{
|
||||
cNoOpt,
|
||||
cOrdinaryLeastSquares,
|
||||
cWeightedLeastSquares,
|
||||
cWeightedLeastSquaresHeavy,
|
||||
cWeightedAverage
|
||||
};
|
||||
|
||||
struct encode_astc_block_stats
|
||||
{
|
||||
uint32_t m_num_pixels;
|
||||
vec3F m_mean_q16;
|
||||
vec3F m_axis_q16;
|
||||
|
||||
void init(uint32_t num_pixels, const vec4F pBlock_pixels_q16[]);
|
||||
};
|
||||
|
||||
double encode_astc_hdr_block_mode_11(
|
||||
uint32_t num_pixels,
|
||||
const basist::half_float pBlock_pixels_half[][3], const vec4F pBlock_pixels_q16[],
|
||||
uint32_t ise_weight_range,
|
||||
uint32_t& best_submode,
|
||||
double cur_block_error,
|
||||
uint8_t* blk_endpoints, uint8_t* blk_weights,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
bool direct_only,
|
||||
uint32_t ise_endpoint_range,
|
||||
bool uber_mode,
|
||||
bool constrain_ise_weight_selectors,
|
||||
int32_t first_submode, int32_t last_submode, bool ignore_clamping,
|
||||
opt_mode_t opt_mode,
|
||||
const encode_astc_block_stats *pBlock_stats = nullptr);
|
||||
|
||||
double encode_astc_hdr_block_downsampled_mode_11(
|
||||
uint32_t block_x, uint32_t block_y, uint32_t grid_x, uint32_t grid_y,
|
||||
uint32_t ise_weight_range, uint32_t ise_endpoint_range,
|
||||
uint32_t num_pixels, const basist::half_float pBlock_pixels_half[][3], const vec4F pBlock_pixels_q16[],
|
||||
double cur_block_error,
|
||||
int32_t first_submode, int32_t last_submode, bool ignore_clamping, opt_mode_t opt_mode,
|
||||
uint8_t* pBlk_endpoints, uint8_t* pBlk_weights, uint32_t& best_submode,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
const encode_astc_block_stats* pBlock_stats = nullptr);
|
||||
|
||||
double encode_astc_hdr_block_mode_11_dual_plane(
|
||||
uint32_t num_pixels,
|
||||
const basist::half_float pBlock_pixels_half[][3], const vec4F pBlock_pixels_q16[],
|
||||
uint32_t channel_index, // 0-2
|
||||
uint32_t ise_weight_range,
|
||||
uint32_t& best_submode,
|
||||
double cur_block_error,
|
||||
uint8_t* blk_endpoints, uint8_t* blk_weights0, uint8_t* blk_weights1,
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
bool direct_only,
|
||||
uint32_t ise_endpoint_range,
|
||||
bool uber_mode,
|
||||
bool constrain_ise_weight_selectors,
|
||||
int32_t first_submode, int32_t last_submode,
|
||||
bool ignore_clamping);
|
||||
|
||||
double encode_astc_hdr_block_mode_7(
|
||||
uint32_t num_pixels,
|
||||
const basist::half_float pBlock_pixels_half[][3], const vec4F pBlock_pixels_q16[],
|
||||
uint32_t ise_weight_range,
|
||||
uint32_t& best_submode,
|
||||
double cur_block_error,
|
||||
uint8_t* blk_endpoints, //[4]
|
||||
uint8_t* blk_weights, // [num_pixels]
|
||||
const astc_hdr_codec_base_options& coptions,
|
||||
uint32_t ise_endpoint_range,
|
||||
int first_submode = 0, int last_submode = MAX_MODE7_SUBMODE_INDEX,
|
||||
const encode_astc_block_stats *pBlock_stats = nullptr);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
struct mode11_log_desc
|
||||
{
|
||||
int32_t m_submode;
|
||||
int32_t m_maj_comp;
|
||||
|
||||
// Or R0, G0, B0 if maj_comp==3 (direct)
|
||||
int32_t m_a; // positive
|
||||
int32_t m_c; // positive
|
||||
int32_t m_b0; // positive
|
||||
|
||||
// Or R1, G1, B1 if maj_comp==3 (direct)
|
||||
int32_t m_b1; // positive
|
||||
int32_t m_d0; // if not direct, is signed
|
||||
int32_t m_d1; // if not direct, is signed
|
||||
|
||||
// limits if not direct
|
||||
int32_t m_a_bits, m_c_bits, m_b_bits, m_d_bits;
|
||||
int32_t m_max_a_val, m_max_c_val, m_max_b_val, m_min_d_val, m_max_d_val;
|
||||
|
||||
void clear() { clear_obj(*this); }
|
||||
|
||||
bool is_direct() const { return m_maj_comp == 3; }
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
bool pack_astc_mode7_submode(uint32_t submode, uint8_t* pEndpoints, const vec3F& rgb_q16, float s_q16, int& max_clamp_mag, uint32_t ise_weight_range, bool early_out_if_clamped, int max_clamp_mag_accept_thresh);
|
||||
|
||||
bool pack_astc_mode11_submode(uint32_t submode, uint8_t* pEndpoints, int val_q[2][3], int& max_clamp_mag, bool early_out_if_clamped = false, int max_clamp_mag_accept_thresh = 0);
|
||||
bool pack_astc_mode11_submode(uint32_t submode, uint8_t* pEndpoints, const vec3F& low_q16, const vec3F& high_q16, int& max_clamp_mag, bool early_out_if_clamped = false, int max_clamp_mag_accept_thresh = 0);
|
||||
void pack_astc_mode11_direct(uint8_t* pEndpoints, vec3F l_q16, vec3F h_q16);
|
||||
|
||||
bool pack_mode11(mode11_log_desc& desc, uint8_t* pEndpoints);
|
||||
void unpack_mode11(const uint8_t* pEndpoints, mode11_log_desc& desc);
|
||||
|
||||
void decode_cem_11_config(const uint8_t* pEndpoints, int& submode_index, int& maj_index);
|
||||
void decode_cem_7_config(const uint8_t* pEndpoints, int& submode_index, int& maj_index);
|
||||
|
||||
void dequantize_astc_weights(uint32_t n, const uint8_t* pSrc_ise_vals, uint32_t from_ise_range, uint8_t* pDst_raw_weights);
|
||||
|
||||
const float* get_6x6_downsample_matrix(uint32_t grid_width, uint32_t grid_height);
|
||||
const float* get_8x6_downsample_matrix(uint32_t grid_width, uint32_t grid_height);
|
||||
|
||||
void compute_upsample_matrix(basisu::vector2D<float>& upsample_matrix, uint32_t block_width, uint32_t block_height, uint32_t grid_width, uint32_t grid_height);
|
||||
void compute_upsample_matrix_transposed(basisu::vector<float>& unweighted_downsample_matrix, uint32_t block_width, uint32_t block_height, uint32_t grid_width, uint32_t grid_height);
|
||||
|
||||
void compute_diag_AtA_vector(uint32_t block_width, uint32_t block_height, uint32_t grid_width, uint32_t grid_height, const vector2D<float>& upsample_matrix, float* pDst_vec);
|
||||
|
||||
void downsample_weight_grid(
|
||||
const float* pMatrix_weights,
|
||||
uint32_t bx, uint32_t by, // source/from dimension (block size)
|
||||
uint32_t wx, uint32_t wy, // dest/to dimension (grid size)
|
||||
const uint8_t* pSrc_weights, // these are dequantized weights, NOT ISE symbols, [by][bx]
|
||||
uint8_t* pDst_weights); // [wy][wx]
|
||||
|
||||
void downsample_ise_weights(
|
||||
uint32_t weight_ise_range, uint32_t quant_weight_ise_range,
|
||||
uint32_t block_w, uint32_t block_h,
|
||||
uint32_t grid_w, uint32_t grid_h,
|
||||
const uint8_t* pSrc_weights, uint8_t* pDst_weights);
|
||||
|
||||
void downsample_ise_weights_dual_plane(
|
||||
uint32_t dequant_weight_ise_range, uint32_t quant_weight_ise_range,
|
||||
uint32_t block_w, uint32_t block_h,
|
||||
uint32_t grid_w, uint32_t grid_h,
|
||||
const uint8_t* pSrc_weights0, const uint8_t* pSrc_weights1,
|
||||
uint8_t* pDst_weights);
|
||||
|
||||
bool refine_endpoints(
|
||||
uint32_t cem,
|
||||
uint32_t endpoint_ise_range,
|
||||
uint8_t* pEndpoint_vals, // the endpoints to optimize
|
||||
uint32_t block_w, uint32_t block_h, // block dimensions
|
||||
uint32_t grid_w, uint32_t grid_h, const uint8_t* pWeights, uint32_t weight_ise_range, // weight grid
|
||||
uint32_t num_pixels, const basist::half_float pBlock_pixels_half[][3], const vec4F pBlock_pixels_q16[],
|
||||
const uint8_t* pPixel_block_ofs, // maps this subset's pixels to block offsets
|
||||
astc_hdr_codec_base_options& coptions, opt_mode_t opt_mode);
|
||||
|
||||
extern bool g_astc_hdr_enc_initialized;
|
||||
|
||||
// This MUST be called before encoding any blocks.
|
||||
void astc_hdr_enc_init();
|
||||
|
||||
} // namespace basisu
|
||||
|
||||
+5667
File diff suppressed because it is too large
Load Diff
+445
@@ -0,0 +1,445 @@
|
||||
// File: basisu_astc_ldr_common.h
|
||||
#pragma once
|
||||
#include "basisu_enc.h"
|
||||
#include "basisu_gpu_texture.h"
|
||||
#include <array>
|
||||
|
||||
namespace basisu
|
||||
{
|
||||
|
||||
namespace astc_ldr
|
||||
{
|
||||
const uint32_t ASTC_LDR_MAX_BLOCK_WIDTH = astc_helpers::MAX_BLOCK_DIM; // 12
|
||||
const uint32_t ASTC_LDR_MAX_BLOCK_HEIGHT = astc_helpers::MAX_BLOCK_DIM; // 12
|
||||
const uint32_t ASTC_LDR_MAX_BLOCK_PIXELS = astc_helpers::MAX_BLOCK_PIXELS; // 144
|
||||
const uint32_t ASTC_LDR_MAX_RAW_WEIGHTS = astc_helpers::MAX_WEIGHT_INTERPOLANT_VALUE + 1; // 65
|
||||
|
||||
const uint32_t WEIGHT_REFINER_MAX_PASSES = 17;
|
||||
|
||||
inline basist::color_rgba convert_to_basist_color_rgba(const color_rgba& c)
|
||||
{
|
||||
return basist::color_rgba(c.r, c.g, c.b, c.a);
|
||||
}
|
||||
|
||||
struct cem_encode_params
|
||||
{
|
||||
uint32_t m_comp_weights[4];
|
||||
bool m_decode_mode_srgb; // todo: store astc_helpers::cDecodeModeSRGB8 : astc_helpers::cDecodeModeLDR8 instead, also the alpha mode for srgb because the decoders are broken
|
||||
|
||||
const uint8_t* m_pForced_weight_vals0;
|
||||
const uint8_t* m_pForced_weight_vals1;
|
||||
|
||||
uint32_t m_max_ls_passes, m_total_weight_refine_passes;
|
||||
bool m_worst_weight_nudging_flag;
|
||||
bool m_endpoint_refinement_flag;
|
||||
|
||||
cem_encode_params()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void init()
|
||||
{
|
||||
m_comp_weights[0] = 1;
|
||||
m_comp_weights[1] = 1;
|
||||
m_comp_weights[2] = 1;
|
||||
m_comp_weights[3] = 1;
|
||||
|
||||
m_decode_mode_srgb = true;
|
||||
|
||||
m_pForced_weight_vals0 = nullptr;
|
||||
m_pForced_weight_vals1 = nullptr;
|
||||
|
||||
m_max_ls_passes = 3;
|
||||
m_total_weight_refine_passes = 0;
|
||||
m_worst_weight_nudging_flag = false;
|
||||
m_endpoint_refinement_flag = false;
|
||||
}
|
||||
|
||||
float get_total_comp_weights() const
|
||||
{
|
||||
return (float)(m_comp_weights[0] + m_comp_weights[1] + m_comp_weights[2] + m_comp_weights[3]);
|
||||
}
|
||||
};
|
||||
|
||||
struct pixel_stats_t
|
||||
{
|
||||
uint32_t m_num_pixels;
|
||||
|
||||
color_rgba m_pixels[ASTC_LDR_MAX_BLOCK_PIXELS];
|
||||
vec4F m_pixels_f[ASTC_LDR_MAX_BLOCK_PIXELS];
|
||||
|
||||
color_rgba m_min, m_max;
|
||||
|
||||
vec4F m_min_f, m_max_f;
|
||||
vec4F m_mean_f;
|
||||
|
||||
// Always 3D, ignoring alpha
|
||||
vec3F m_mean_rel_axis3;
|
||||
vec3F m_zero_rel_axis3;
|
||||
|
||||
// Always 4D
|
||||
vec4F m_mean_rel_axis4;
|
||||
|
||||
bool m_has_alpha;
|
||||
|
||||
stats<float> m_rgba_stats[4];
|
||||
|
||||
void clear()
|
||||
{
|
||||
clear_obj(*this);
|
||||
}
|
||||
|
||||
void init(uint32_t num_pixels, const color_rgba* pPixels);
|
||||
|
||||
}; // struct struct pixel_stats
|
||||
|
||||
void global_init();
|
||||
|
||||
void bit_transfer_signed_enc(int& a, int& b);
|
||||
void bit_transfer_signed_dec(int& a, int& b); // transfers MSB from a to b, a is then [-32,31]
|
||||
color_rgba blue_contract_enc(color_rgba orig, bool& did_clamp, int encoded_b);
|
||||
int quant_preserve2(uint32_t ise_range, uint32_t v);
|
||||
|
||||
uint32_t get_colors(const color_rgba& l, const color_rgba& h, uint32_t weight_ise_index, color_rgba* pColors, bool decode_mode_srgb);
|
||||
uint32_t get_colors_raw_weights(const color_rgba& l, const color_rgba& h, color_rgba* pColors, bool decode_mode_srgb);
|
||||
void decode_endpoints_ise20(uint32_t cem_index, const uint8_t* pEndpoint_vals, color_rgba& l, color_rgba& h); // assume BISE 20
|
||||
void decode_endpoints(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index, color_rgba& l, color_rgba& h, float* pScale = nullptr);
|
||||
uint32_t get_colors(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index, uint32_t weight_ise_index, color_rgba* pColors, bool decode_mode_srgb);
|
||||
uint32_t get_colors_raw_weights(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index, color_rgba* pColors, bool decode_mode_srgb);
|
||||
|
||||
//int apply_delta_to_bise_endpoint_val(uint32_t endpoint_ise_range, int ise_val, int delta);
|
||||
int apply_delta_to_bise_weight_val(uint32_t weight_ise_range, int ise_val, int delta);
|
||||
|
||||
uint64_t eval_solution(
|
||||
const pixel_stats_t& pixel_stats,
|
||||
uint32_t total_weights, const color_rgba* pWeight_colors,
|
||||
uint8_t* pWeight_vals, uint32_t weight_ise_index,
|
||||
const cem_encode_params& params);
|
||||
|
||||
uint64_t eval_solution(
|
||||
const pixel_stats_t& pixel_stats,
|
||||
uint32_t cem_index,
|
||||
const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index,
|
||||
uint8_t* pWeight_vals, uint32_t weight_ise_index,
|
||||
const cem_encode_params& params);
|
||||
|
||||
uint64_t eval_solution_dp(
|
||||
uint32_t ccs_index,
|
||||
const pixel_stats_t& pixel_stats,
|
||||
uint32_t total_weights, const color_rgba* pWeight_colors,
|
||||
uint8_t* pWeight_vals0, uint8_t* pWeight_vals1, uint32_t weight_ise_index,
|
||||
const cem_encode_params& params);
|
||||
|
||||
uint64_t eval_solution_dp(
|
||||
const pixel_stats_t& pixel_stats,
|
||||
uint32_t cem_index, uint32_t ccs_index,
|
||||
const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index,
|
||||
uint8_t* pWeight_vals0, uint8_t* pWeight_vals1, uint32_t weight_ise_index,
|
||||
const cem_encode_params& params);
|
||||
|
||||
//bool cem8_or_12_used_blue_contraction(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index);
|
||||
//bool cem9_or_13_used_blue_contraction(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index);
|
||||
//bool used_blue_contraction(uint32_t cem_index, const uint8_t* pEndpoint_vals, uint32_t endpoint_ise_index);
|
||||
|
||||
uint64_t cem_encode_pixels(
|
||||
uint32_t cem_index, int ccs_index,
|
||||
const pixel_stats_t& pixel_stats, const cem_encode_params& enc_params,
|
||||
uint32_t endpoint_ise_range, uint32_t weight_ise_range,
|
||||
uint8_t* pEndpoint_vals, uint8_t* pWeight_vals0, uint8_t* pWeight_vals1, uint64_t cur_blk_error,
|
||||
bool use_blue_contraction, bool* pBase_ofs_clamped_flag);
|
||||
|
||||
// TODO: Rename, confusing vs. std::vector or basisu::vector or vec4F etc.
|
||||
struct partition_pattern_vec
|
||||
{
|
||||
uint32_t m_width, m_height;
|
||||
uint8_t m_parts[ASTC_LDR_MAX_BLOCK_PIXELS];
|
||||
|
||||
partition_pattern_vec();
|
||||
|
||||
partition_pattern_vec(const partition_pattern_vec& other);
|
||||
|
||||
partition_pattern_vec(uint32_t width, uint32_t height, const uint8_t* pParts = nullptr);
|
||||
|
||||
void init(uint32_t width, uint32_t height, const uint8_t* pParts = nullptr);
|
||||
|
||||
void init_part_hist();
|
||||
|
||||
void clear();
|
||||
|
||||
partition_pattern_vec& operator= (const partition_pattern_vec& rhs);
|
||||
|
||||
uint32_t get_width() const { return m_width; }
|
||||
uint32_t get_height() const { return m_height; }
|
||||
uint32_t get_total() const { return m_width * m_height; }
|
||||
|
||||
uint8_t operator[] (uint32_t i) const { assert(i < get_total()); return m_parts[i]; }
|
||||
uint8_t& operator[] (uint32_t i) { assert(i < get_total()); return m_parts[i]; }
|
||||
|
||||
uint8_t operator() (uint32_t x, uint32_t y) const { assert((x < m_width) && (y < m_height)); return m_parts[x + y * m_width]; }
|
||||
uint8_t& operator() (uint32_t x, uint32_t y) { assert((x < m_width) && (y < m_height)); return m_parts[x + y * m_width]; }
|
||||
|
||||
int get_squared_distance(const partition_pattern_vec& other) const;
|
||||
|
||||
float get_distance(const partition_pattern_vec& other) const
|
||||
{
|
||||
return sqrtf((float)get_squared_distance(other));
|
||||
}
|
||||
|
||||
enum { cMaxPermute2Index = 1 };
|
||||
partition_pattern_vec get_permuted2(uint32_t permute_index) const;
|
||||
|
||||
enum { cMaxPermute3Index = 5 };
|
||||
partition_pattern_vec get_permuted3(uint32_t permute_index) const;
|
||||
|
||||
partition_pattern_vec get_canonicalized() const;
|
||||
|
||||
bool operator== (const partition_pattern_vec& rhs) const
|
||||
{
|
||||
if ((m_width != rhs.m_width) || (m_height != rhs.m_height))
|
||||
return false;
|
||||
|
||||
return memcmp(m_parts, rhs.m_parts, get_total()) == 0;
|
||||
}
|
||||
|
||||
operator size_t() const
|
||||
{
|
||||
return basist::hash_hsieh(m_parts, get_total());
|
||||
}
|
||||
};
|
||||
|
||||
struct vp_tree_node
|
||||
{
|
||||
partition_pattern_vec m_vantage_point;
|
||||
uint32_t m_point_index;
|
||||
float m_dist;
|
||||
|
||||
int m_inner_node, m_outer_node;
|
||||
};
|
||||
|
||||
const uint32_t NUM_PART3_MAPPINGS = 6;
|
||||
extern uint8_t g_part3_mapping[NUM_PART3_MAPPINGS][3];
|
||||
|
||||
class vp_tree
|
||||
{
|
||||
public:
|
||||
vp_tree()
|
||||
{
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_nodes.clear();
|
||||
}
|
||||
|
||||
// This requires no redundant patterns, i.e. all must be unique.
|
||||
bool init(uint32_t n, const partition_pattern_vec* pUnique_pats);
|
||||
|
||||
struct result
|
||||
{
|
||||
uint32_t m_pat_index;
|
||||
uint32_t m_mapping_index;
|
||||
float m_dist;
|
||||
|
||||
bool operator< (const result& rhs) const { return m_dist < rhs.m_dist; }
|
||||
bool operator> (const result& rhs) const { return m_dist > rhs.m_dist; }
|
||||
};
|
||||
|
||||
class result_queue
|
||||
{
|
||||
enum { MaxSupportedSize = 512 + 1 };
|
||||
|
||||
public:
|
||||
result_queue() :
|
||||
m_cur_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
size_t get_size() const
|
||||
{
|
||||
return m_cur_size;
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return !m_cur_size;
|
||||
}
|
||||
|
||||
typedef std::array<result, MaxSupportedSize + 1> result_array_type;
|
||||
|
||||
const result_array_type& get_elements() const { return m_elements; }
|
||||
result_array_type& get_elements() { return m_elements; }
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_cur_size = 0;
|
||||
}
|
||||
|
||||
void reserve(uint32_t n)
|
||||
{
|
||||
BASISU_NOTE_UNUSED(n);
|
||||
}
|
||||
|
||||
const result& top() const
|
||||
{
|
||||
assert(m_cur_size);
|
||||
return m_elements[1];
|
||||
}
|
||||
|
||||
bool insert(const result& val, uint32_t max_size)
|
||||
{
|
||||
assert(max_size < MaxSupportedSize);
|
||||
|
||||
if (m_cur_size >= MaxSupportedSize)
|
||||
return false;
|
||||
|
||||
m_elements[++m_cur_size] = val;
|
||||
up_heap(m_cur_size);
|
||||
|
||||
if (m_cur_size > max_size)
|
||||
pop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pop()
|
||||
{
|
||||
if (m_cur_size == 0)
|
||||
return false;
|
||||
|
||||
m_elements[1] = m_elements[m_cur_size--];
|
||||
down_heap(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
float get_highest_dist() const
|
||||
{
|
||||
if (!m_cur_size)
|
||||
return 0.0f;
|
||||
|
||||
return top().m_dist;
|
||||
}
|
||||
|
||||
private:
|
||||
result_array_type m_elements;
|
||||
size_t m_cur_size;
|
||||
|
||||
void up_heap(size_t index)
|
||||
{
|
||||
while ((index > 1) && (m_elements[index] > m_elements[index >> 1]))
|
||||
{
|
||||
std::swap(m_elements[index], m_elements[index >> 1]);
|
||||
index >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void down_heap(size_t index)
|
||||
{
|
||||
for (; ; )
|
||||
{
|
||||
size_t largest = index, left_child = 2 * index, right_child = 2 * index + 1;
|
||||
|
||||
if ((left_child <= m_cur_size) && (m_elements[left_child] > m_elements[largest]))
|
||||
largest = left_child;
|
||||
|
||||
if ((right_child <= m_cur_size) && (m_elements[right_child] > m_elements[largest]))
|
||||
largest = right_child;
|
||||
|
||||
if (largest == index)
|
||||
break;
|
||||
|
||||
std::swap(m_elements[index], m_elements[largest]);
|
||||
index = largest;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void find_nearest(uint32_t num_subsets, const partition_pattern_vec& desired_pat, result_queue& results, uint32_t max_results) const;
|
||||
|
||||
private:
|
||||
basisu::vector<vp_tree_node> m_nodes;
|
||||
|
||||
void find_nearest_at_node(int node_index, uint32_t num_desired_pats, const partition_pattern_vec* pDesired_pats, result_queue& results, uint32_t max_results) const;
|
||||
|
||||
void find_nearest_at_node_non_recursive(int init_node_index, uint32_t num_desired_pats, const partition_pattern_vec* pDesired_pats, result_queue& results, uint32_t max_results) const;
|
||||
|
||||
// returns the index of the new node, or -1 on error
|
||||
int create_node(uint32_t n, const partition_pattern_vec* pUnique_pats, const uint_vec& pat_indices);
|
||||
|
||||
// returns the pattern index of the vantage point (-1 on error), and the optimal split distance
|
||||
std::pair<int, float> find_best_vantage_point(uint32_t num_unique_pats, const partition_pattern_vec* pUnique_pats, const uint_vec& pat_indices);
|
||||
};
|
||||
|
||||
typedef basisu::hash_map<partition_pattern_vec, std::pair<uint32_t, uint32_t > > partition_hash_map;
|
||||
|
||||
struct partition_pattern_hist
|
||||
{
|
||||
uint8_t m_hist[4];
|
||||
|
||||
partition_pattern_hist() { clear(); }
|
||||
|
||||
void clear() { clear_obj(m_hist); }
|
||||
};
|
||||
|
||||
struct partitions_data
|
||||
{
|
||||
uint32_t m_width, m_height, m_num_partitions;
|
||||
partition_pattern_vec m_partition_pats[astc_helpers::NUM_PARTITION_PATTERNS]; // indexed by unique index, NOT the 10-bit ASTC seed/pattern index
|
||||
|
||||
partition_pattern_hist m_partition_pat_histograms[astc_helpers::NUM_PARTITION_PATTERNS]; // indexed by unique index, histograms of each pattern
|
||||
|
||||
// ASTC seed to unique index and vice versa
|
||||
int16_t m_part_seed_to_unique_index[astc_helpers::NUM_PARTITION_PATTERNS];
|
||||
int16_t m_unique_index_to_part_seed[astc_helpers::NUM_PARTITION_PATTERNS];
|
||||
|
||||
// Total number of unique patterns
|
||||
uint32_t m_total_unique_patterns;
|
||||
|
||||
// VP tree used to rapidly find nearby/similar patterns.
|
||||
vp_tree m_part_vp_tree;
|
||||
|
||||
void init(uint32_t num_partitions, uint32_t block_width, uint32_t block_height, bool init_vp_tree = true);
|
||||
};
|
||||
|
||||
float surrogate_quant_endpoint_val(float e, uint32_t num_endpoint_levels, uint32_t flags);
|
||||
vec4F surrogate_quant_endpoint(const vec4F& e, uint32_t num_endpoint_levels, uint32_t flags);
|
||||
|
||||
float surrogate_evaluate_rgba_sp(const pixel_stats_t& ps, const vec4F& l, const vec4F& h, float* pWeights0, uint32_t num_weight_levels, const cem_encode_params& enc_params, uint32_t flags);
|
||||
float surrogate_evaluate_rgba_dp(uint32_t ccs_index, const pixel_stats_t& ps, const vec4F& l, const vec4F& h, float* pWeights0, float* pWeights1, uint32_t num_weight_levels, const cem_encode_params& enc_params, uint32_t flags);
|
||||
|
||||
enum
|
||||
{
|
||||
cFlagDisableQuant = 1,
|
||||
cFlagNoError = 2
|
||||
}
|
||||
;
|
||||
float cem_surrogate_encode_pixels(
|
||||
uint32_t cem_index, int ccs_index,
|
||||
const pixel_stats_t& pixel_stats, const cem_encode_params& enc_params,
|
||||
uint32_t endpoint_ise_range, uint32_t weight_ise_range,
|
||||
vec4F& low_endpoint, vec4F& high_endpoint, float& s, float* pWeights0, float* pWeights1, uint32_t flags = 0);
|
||||
|
||||
#if 0
|
||||
bool requantize_ise_endpoints(uint32_t cem,
|
||||
uint32_t src_ise_endpoint_range, const uint8_t* pSrc_endpoints,
|
||||
uint32_t dst_ise_endpoint_range, uint8_t* pDst_endpoints);
|
||||
|
||||
uint32_t get_base_cem_without_alpha(uint32_t cem);
|
||||
|
||||
bool pack_base_offset(
|
||||
uint32_t cem_index, uint32_t dst_ise_endpoint_range, uint8_t* pPacked_endpoints,
|
||||
const color_rgba& l, const color_rgba& h,
|
||||
bool use_blue_contraction, bool auto_disable_blue_contraction_if_clamped,
|
||||
bool& blue_contraction_clamped_flag, bool& base_ofs_clamped_flag, bool& endpoints_swapped);
|
||||
|
||||
bool convert_endpoints_across_cems(
|
||||
uint32_t prev_cem, uint32_t prev_endpoint_ise_range, const uint8_t* pPrev_endpoints,
|
||||
uint32_t dst_cem, uint32_t dst_endpoint_ise_range, uint8_t* pDst_endpoints,
|
||||
bool always_repack,
|
||||
bool use_blue_contraction, bool auto_disable_blue_contraction_if_clamped,
|
||||
bool& blue_contraction_clamped_flag, bool& base_ofs_clamped_flag);
|
||||
#endif
|
||||
|
||||
} // namespace astc_ldr
|
||||
|
||||
} // namespace basisu
|
||||
+11098
File diff suppressed because it is too large
Load Diff
+118
@@ -0,0 +1,118 @@
|
||||
// File: basisu_astc_ldr_encode.cpp
|
||||
#pragma once
|
||||
#include "basisu_enc.h"
|
||||
#include "../transcoder/basisu_astc_helpers.h"
|
||||
|
||||
namespace basisu {
|
||||
namespace astc_ldr {
|
||||
|
||||
void encoder_init();
|
||||
|
||||
const int EFFORT_LEVEL_MIN = 0, EFFORT_LEVEL_MAX = 10, EFFORT_LEVEL_DEF = 3;
|
||||
const int DCT_QUALITY_MIN = 1, DCT_QUALITY_MAX = 100;
|
||||
|
||||
struct astc_ldr_encode_config
|
||||
{
|
||||
astc_ldr_encode_config()
|
||||
{
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
*this = astc_ldr_encode_config();
|
||||
}
|
||||
|
||||
// ASTC LDR block dimensions. Must be a valid ASTC block dimension. Any supported from 4x4-12x12, including unequal dimensions.
|
||||
uint32_t m_astc_block_width = 6;
|
||||
uint32_t m_astc_block_height = 6;
|
||||
|
||||
// If true, the encoder assumes all ASTC blocks will be decompressed using sRGB vs. LDR8 mode. This corresponds to astcenc's -cs vs. cl color profiles.
|
||||
// This should match how the texture is later decoded by the GPU for maximum quality. This bit is stored into the output file.
|
||||
bool m_astc_decode_mode_srgb = true;
|
||||
|
||||
// If true, trade off some compression (3-10%) for faster decompression.
|
||||
// If false, favor highest compression, but slower decompression.
|
||||
//bool m_use_faster_format = true;
|
||||
|
||||
basist::astc_ldr_t::xuastc_ldr_syntax m_compressed_syntax = basist::astc_ldr_t::xuastc_ldr_syntax::cFullArith;
|
||||
|
||||
// Encoder CPU effort vs. quality. [0,10], higher=better.
|
||||
// 0=extremely fast but very brittle (no subsets)
|
||||
// 1=first 2 subset effort level
|
||||
// 10=extremely high CPU requirements.
|
||||
uint32_t m_effort_level = 3;
|
||||
|
||||
// Weight grid DCT quality [1,100] - higher=better quality (JPEG-style).
|
||||
float m_dct_quality = 85;
|
||||
|
||||
// true=use weight grid DCT, false=always use DPCM
|
||||
bool m_use_dct = false;
|
||||
|
||||
// true=use lossy supercompression, false=supercompression stage is always lossless.
|
||||
bool m_lossy_supercompression = false;
|
||||
|
||||
// Channel weights used to compute RGBA colorspace L2 errors. Must be >= 1.
|
||||
uint32_t m_comp_weights[4] = { 1, 1, 1, 1 };
|
||||
|
||||
// Lossy supercompression stage parameters for RGB vs. RGBA image inputs.
|
||||
// (Bounded RDO - explictly not Lagrangian.)
|
||||
float m_replacement_min_psnr = 35.0f; // if the block's base PSNR is less than this, it cannot be changed
|
||||
float m_psnr_trial_diff_thresh = 1.5f; // reject candidates if their PSNR is lower than m_replacement_min_psnr-m_psnr_trial_diff_thresh
|
||||
float m_psnr_trial_diff_thresh_edge = 1.0f; // edge variant
|
||||
|
||||
// Lossy supercompression settings - alpha texture variants
|
||||
float m_replacement_min_psnr_alpha = 38.0f;
|
||||
float m_psnr_trial_diff_thresh_alpha = .75f;
|
||||
float m_psnr_trial_diff_thresh_edge_alpha = .5f;
|
||||
|
||||
// If true, try encoding blurred blocks, in addition to unblurred, for superpass 1 and 2.
|
||||
// Higher quality, but massively slower and not yet tuned/refined.
|
||||
bool m_block_blurring_p1 = false, m_block_blurring_p2 = false;
|
||||
|
||||
// If true, no matter what effort level subset usage will be disabled.
|
||||
bool m_force_disable_subsets = false;
|
||||
|
||||
// If true, no matter what effort level RGB dual plane usage will be disabled.
|
||||
bool m_force_disable_rgb_dual_plane = false;
|
||||
|
||||
bool m_debug_images = false;
|
||||
bool m_debug_output = false;
|
||||
|
||||
std::string m_debug_file_prefix;
|
||||
|
||||
void debug_print() const
|
||||
{
|
||||
fmt_debug_printf("ASTC block dimensions: {}x{}\n", m_astc_block_width, m_astc_block_height);
|
||||
fmt_debug_printf("ASTC decode profile mode sRGB: {}\n", m_astc_decode_mode_srgb);
|
||||
fmt_debug_printf("Syntax: {}\n", (uint32_t)m_compressed_syntax);
|
||||
fmt_debug_printf("Effort level: {}\n", m_effort_level);
|
||||
fmt_debug_printf("Use DCT: {}\n", m_use_dct);
|
||||
fmt_debug_printf("DCT quality level (1-100): {}\n", m_dct_quality);
|
||||
fmt_debug_printf("Comp weights: {} {} {} {}\n", m_comp_weights[0], m_comp_weights[1], m_comp_weights[2], m_comp_weights[3]);
|
||||
fmt_debug_printf("Block blurring: {} {}\n", m_block_blurring_p1, m_block_blurring_p2);
|
||||
fmt_debug_printf("Force disable subsets: {}\n", m_force_disable_subsets);
|
||||
fmt_debug_printf("Force disable RGB dual plane: {}\n", m_force_disable_rgb_dual_plane);
|
||||
|
||||
fmt_debug_printf("\nLossy supercompression: {}\n", m_lossy_supercompression);
|
||||
fmt_debug_printf("m_replacement_min_psnr: {}\n", m_replacement_min_psnr);
|
||||
fmt_debug_printf("m_psnr_trial_diff_thresh: {}\n", m_psnr_trial_diff_thresh);
|
||||
fmt_debug_printf("m_psnr_trial_diff_thresh_edge: {}\n", m_psnr_trial_diff_thresh_edge);
|
||||
fmt_debug_printf("m_replacement_min_psnr_alpha: {}\n", m_replacement_min_psnr_alpha);
|
||||
fmt_debug_printf("m_psnr_trial_diff_thresh_alpha: {}\n", m_psnr_trial_diff_thresh_alpha);
|
||||
fmt_debug_printf("m_psnr_trial_diff_thresh_edge_alpha: {}\n", m_psnr_trial_diff_thresh_edge_alpha);
|
||||
|
||||
fmt_debug_printf("m_debug_images: {}\n", m_debug_images);
|
||||
}
|
||||
};
|
||||
|
||||
bool compress_image(
|
||||
const image& orig_img, uint8_vec &comp_data, vector2D<astc_helpers::log_astc_block>& coded_blocks,
|
||||
const astc_ldr_encode_config& global_cfg,
|
||||
job_pool& job_pool);
|
||||
|
||||
void deblock_filter(uint32_t filter_block_width, uint32_t filter_block_height, const image& src_img, image& dst_img, bool stronger_filtering = false, int SKIP_THRESH = 24);
|
||||
|
||||
} // namespace astc_ldr
|
||||
} // namespace basisu
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// basisu_backend.cpp
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2026 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -666,7 +666,7 @@ namespace basisu
|
||||
if (m_params.m_debug_images)
|
||||
{
|
||||
image gi_unpacked;
|
||||
gi.unpack(gi_unpacked);
|
||||
gi.unpack(gi_unpacked, false);
|
||||
|
||||
char buf[256];
|
||||
#ifdef _WIN32
|
||||
|
||||
+10
-11
@@ -1,5 +1,5 @@
|
||||
// basisu_backend.h
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -103,8 +103,8 @@ namespace basisu
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
uint32_t m_endpoint_predictor;
|
||||
|
||||
uint32_t m_endpoint_predictor;
|
||||
|
||||
int m_endpoint_index;
|
||||
int m_selector_index;
|
||||
@@ -115,10 +115,10 @@ namespace basisu
|
||||
void clear()
|
||||
{
|
||||
m_endpoint_predictor = 0;
|
||||
|
||||
|
||||
m_endpoint_index = 0;
|
||||
m_selector_index = 0;
|
||||
|
||||
|
||||
m_selector_history_buf_index = 0;
|
||||
m_is_cr_target = false;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace basisu
|
||||
color_rgba m_color5;
|
||||
uint32_t m_inten5;
|
||||
bool m_color5_valid;
|
||||
|
||||
|
||||
void clear()
|
||||
{
|
||||
clear_obj(*this);
|
||||
@@ -153,7 +153,7 @@ namespace basisu
|
||||
float m_endpoint_rdo_quality_thresh;
|
||||
float m_selector_rdo_quality_thresh;
|
||||
uint32_t m_compression_level;
|
||||
|
||||
|
||||
bool m_used_global_codebooks;
|
||||
|
||||
bool m_validate;
|
||||
@@ -285,7 +285,7 @@ namespace basisu
|
||||
basisu_backend_params m_params;
|
||||
basisu_backend_slice_desc_vec m_slices;
|
||||
basisu_backend_output m_output;
|
||||
|
||||
|
||||
etc1_endpoint_palette_entry_vec m_endpoint_palette;
|
||||
etc1_selector_palette_entry_vec m_selector_palette;
|
||||
|
||||
@@ -331,12 +331,12 @@ namespace basisu
|
||||
|
||||
return slice.m_first_block_index + block_y * slice.m_num_blocks_x + block_x;
|
||||
}
|
||||
|
||||
|
||||
uint32_t get_total_blocks(uint32_t slice_index) const
|
||||
{
|
||||
return m_slices[slice_index].m_num_blocks_x * m_slices[slice_index].m_num_blocks_y;
|
||||
}
|
||||
|
||||
|
||||
uint32_t get_total_blocks() const
|
||||
{
|
||||
uint32_t total_blocks = 0;
|
||||
@@ -406,4 +406,3 @@ namespace basisu
|
||||
};
|
||||
|
||||
} // namespace basisu
|
||||
|
||||
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
// basisu_basis_file.cpp
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -27,14 +27,14 @@ namespace basisu
|
||||
m_header.m_data_size = m_total_file_size - sizeof(basist::basis_file_header);
|
||||
|
||||
m_header.m_total_slices = (uint32_t)encoder_output.m_slice_desc.size();
|
||||
|
||||
|
||||
m_header.m_total_images = 0;
|
||||
for (uint32_t i = 0; i < encoder_output.m_slice_desc.size(); i++)
|
||||
m_header.m_total_images = maximum<uint32_t>(m_header.m_total_images, encoder_output.m_slice_desc[i].m_source_file_index + 1);
|
||||
|
||||
|
||||
m_header.m_tex_format = (int)encoder_output.m_tex_format;
|
||||
m_header.m_flags = 0;
|
||||
|
||||
|
||||
if (encoder_output.m_etc1s)
|
||||
{
|
||||
assert(encoder_output.m_tex_format == basist::basis_tex_format::cETC1S);
|
||||
@@ -51,7 +51,7 @@ namespace basisu
|
||||
m_header.m_flags = m_header.m_flags | basist::cBASISHeaderFlagUsesGlobalCodebook;
|
||||
if (encoder_output.m_srgb)
|
||||
m_header.m_flags = m_header.m_flags | basist::cBASISHeaderFlagSRGB;
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < encoder_output.m_slice_desc.size(); i++)
|
||||
{
|
||||
if (encoder_output.m_slice_desc[i].m_alpha)
|
||||
@@ -108,7 +108,7 @@ namespace basisu
|
||||
|
||||
m_images_descs[i].m_image_index = slice_descs[i].m_source_file_index;
|
||||
m_images_descs[i].m_level_index = slice_descs[i].m_mip_index;
|
||||
|
||||
|
||||
if (slice_descs[i].m_alpha)
|
||||
m_images_descs[i].m_flags = m_images_descs[i].m_flags | basist::cSliceDescFlagsHasAlpha;
|
||||
if (slice_descs[i].m_iframe)
|
||||
@@ -186,7 +186,7 @@ namespace basisu
|
||||
|
||||
pHeader->m_data_size = m_total_file_size - sizeof(basist::basis_file_header);
|
||||
pHeader->m_data_crc16 = basist::crc16(&m_comp_data[0] + sizeof(basist::basis_file_header), m_total_file_size - sizeof(basist::basis_file_header), 0);
|
||||
|
||||
|
||||
pHeader->m_header_crc16 = basist::crc16(&pHeader->m_data_size, sizeof(basist::basis_file_header) - BASISU_OFFSETOF(basist::basis_file_header, m_data_size), 0);
|
||||
|
||||
pHeader->m_sig = basist::basis_file_header::cBASISSigValue;
|
||||
@@ -242,7 +242,7 @@ namespace basisu
|
||||
m_tables_file_ofs = 0;
|
||||
m_first_image_file_ofs = m_slice_descs_file_ofs + sizeof(basist::basis_slice_desc) * (uint32_t)slice_descs.size();
|
||||
}
|
||||
|
||||
|
||||
uint64_t total_file_size = m_first_image_file_ofs;
|
||||
for (uint32_t i = 0; i < encoder_output.m_slice_image_data.size(); i++)
|
||||
total_file_size += encoder_output.m_slice_image_data[i].size();
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// basisu_basis_file.h
|
||||
// Copyright (C) 2019 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
||||
+62
-59
@@ -1,5 +1,5 @@
|
||||
// File: basisu_bc7enc.cpp
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -100,24 +100,24 @@ static void astc_init()
|
||||
{
|
||||
if (!astc_is_valid_endpoint_range(range))
|
||||
continue;
|
||||
|
||||
|
||||
const uint32_t levels = astc_get_levels(range);
|
||||
|
||||
uint32_t vals[256];
|
||||
// TODO
|
||||
for (uint32_t i = 0; i < levels; i++)
|
||||
vals[i] = (unquant_astc_endpoint_val(i, range) << 8) | i;
|
||||
|
||||
|
||||
std::sort(vals, vals + levels);
|
||||
|
||||
for (uint32_t i = 0; i < levels; i++)
|
||||
{
|
||||
uint32_t order = vals[i] & 0xFF;
|
||||
uint32_t unq = vals[i] >> 8;
|
||||
|
||||
|
||||
g_astc_sorted_order_unquant[range][i].m_unquant = (uint8_t)unq;
|
||||
g_astc_sorted_order_unquant[range][i].m_index = (uint8_t)order;
|
||||
|
||||
|
||||
} // i
|
||||
|
||||
#if 0
|
||||
@@ -186,7 +186,7 @@ static inline uint32_t astc_interpolate_linear(uint32_t l, uint32_t h, uint32_t
|
||||
void bc7enc_compress_block_init()
|
||||
{
|
||||
astc_init();
|
||||
|
||||
|
||||
// BC7 666.1
|
||||
for (int c = 0; c < 256; c++)
|
||||
{
|
||||
@@ -224,11 +224,11 @@ void bc7enc_compress_block_init()
|
||||
for (uint32_t l = 0; l < 16; l++)
|
||||
{
|
||||
uint32_t low = (l << 4) | l;
|
||||
|
||||
|
||||
for (uint32_t h = 0; h < 16; h++)
|
||||
{
|
||||
uint32_t high = (h << 4) | h;
|
||||
|
||||
|
||||
const int k = astc_interpolate_linear(low, high, g_bc7_weights3[BC7ENC_ASTC_4BIT_3BIT_OPTIMAL_INDEX]);
|
||||
const int err = (k - c) * (k - c);
|
||||
|
||||
@@ -240,9 +240,9 @@ void bc7enc_compress_block_init()
|
||||
}
|
||||
} // h
|
||||
} // l
|
||||
|
||||
|
||||
g_astc_4bit_3bit_optimal_endpoints[c] = best;
|
||||
|
||||
|
||||
} // c
|
||||
|
||||
// ASTC [0,15] 2-bit
|
||||
@@ -253,11 +253,11 @@ void bc7enc_compress_block_init()
|
||||
for (uint32_t l = 0; l < 16; l++)
|
||||
{
|
||||
uint32_t low = (l << 4) | l;
|
||||
|
||||
|
||||
for (uint32_t h = 0; h < 16; h++)
|
||||
{
|
||||
uint32_t high = (h << 4) | h;
|
||||
|
||||
|
||||
const int k = astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_4BIT_2BIT_OPTIMAL_INDEX]);
|
||||
const int err = (k - c) * (k - c);
|
||||
|
||||
@@ -269,9 +269,9 @@ void bc7enc_compress_block_init()
|
||||
}
|
||||
} // h
|
||||
} // l
|
||||
|
||||
|
||||
g_astc_4bit_2bit_optimal_endpoints[c] = best;
|
||||
|
||||
|
||||
} // c
|
||||
|
||||
// ASTC range 7 [0,11] 2-bit
|
||||
@@ -282,11 +282,11 @@ void bc7enc_compress_block_init()
|
||||
for (uint32_t l = 0; l < 12; l++)
|
||||
{
|
||||
uint32_t low = g_astc_sorted_order_unquant[7][l].m_unquant;
|
||||
|
||||
|
||||
for (uint32_t h = 0; h < 12; h++)
|
||||
{
|
||||
uint32_t high = g_astc_sorted_order_unquant[7][h].m_unquant;
|
||||
|
||||
|
||||
const int k = astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_RANGE7_2BIT_OPTIMAL_INDEX]);
|
||||
const int err = (k - c) * (k - c);
|
||||
|
||||
@@ -298,9 +298,9 @@ void bc7enc_compress_block_init()
|
||||
}
|
||||
} // h
|
||||
} // l
|
||||
|
||||
|
||||
g_astc_range7_2bit_optimal_endpoints[c] = best;
|
||||
|
||||
|
||||
} // c
|
||||
|
||||
// ASTC range 13 [0,47] 4-bit
|
||||
@@ -311,11 +311,11 @@ void bc7enc_compress_block_init()
|
||||
for (uint32_t l = 0; l < 48; l++)
|
||||
{
|
||||
uint32_t low = g_astc_sorted_order_unquant[13][l].m_unquant;
|
||||
|
||||
|
||||
for (uint32_t h = 0; h < 48; h++)
|
||||
{
|
||||
uint32_t high = g_astc_sorted_order_unquant[13][h].m_unquant;
|
||||
|
||||
|
||||
const int k = astc_interpolate_linear(low, high, g_astc_weights4[BC7ENC_ASTC_RANGE13_4BIT_OPTIMAL_INDEX]);
|
||||
const int err = (k - c) * (k - c);
|
||||
|
||||
@@ -327,9 +327,9 @@ void bc7enc_compress_block_init()
|
||||
}
|
||||
} // h
|
||||
} // l
|
||||
|
||||
|
||||
g_astc_range13_4bit_optimal_endpoints[c] = best;
|
||||
|
||||
|
||||
} // c
|
||||
|
||||
// ASTC range 13 [0,47] 2-bit
|
||||
@@ -340,11 +340,11 @@ void bc7enc_compress_block_init()
|
||||
for (uint32_t l = 0; l < 48; l++)
|
||||
{
|
||||
uint32_t low = g_astc_sorted_order_unquant[13][l].m_unquant;
|
||||
|
||||
|
||||
for (uint32_t h = 0; h < 48; h++)
|
||||
{
|
||||
uint32_t high = g_astc_sorted_order_unquant[13][h].m_unquant;
|
||||
|
||||
|
||||
const int k = astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_RANGE13_2BIT_OPTIMAL_INDEX]);
|
||||
const int err = (k - c) * (k - c);
|
||||
|
||||
@@ -356,9 +356,9 @@ void bc7enc_compress_block_init()
|
||||
}
|
||||
} // h
|
||||
} // l
|
||||
|
||||
|
||||
g_astc_range13_2bit_optimal_endpoints[c] = best;
|
||||
|
||||
|
||||
} // c
|
||||
|
||||
// ASTC range 11 [0,31] 5-bit
|
||||
@@ -393,14 +393,15 @@ void bc7enc_compress_block_init()
|
||||
|
||||
static void compute_least_squares_endpoints_rgba(uint32_t N, const uint8_t *pSelectors, const bc7enc_vec4F* pSelector_weights, bc7enc_vec4F* pXl, bc7enc_vec4F* pXh, const color_quad_u8 *pColors)
|
||||
{
|
||||
// Least squares using normal equations: http://www.cs.cornell.edu/~bindel/class/cs3220-s12/notes/lec10.pdf
|
||||
// Least squares using normal equations: http://www.cs.cornell.edu/~bindel/class/cs3220-s12/notes/lec10.pdf
|
||||
// https://web.archive.org/web/20150319232457/http://www.cs.cornell.edu/~bindel/class/cs3220-s12/notes/lec10.pdf
|
||||
// I did this in matrix form first, expanded out all the ops, then optimized it a bit.
|
||||
double z00 = 0.0f, z01 = 0.0f, z10 = 0.0f, z11 = 0.0f;
|
||||
double q00_r = 0.0f, q10_r = 0.0f, t_r = 0.0f;
|
||||
double q00_g = 0.0f, q10_g = 0.0f, t_g = 0.0f;
|
||||
double q00_b = 0.0f, q10_b = 0.0f, t_b = 0.0f;
|
||||
double q00_a = 0.0f, q10_a = 0.0f, t_a = 0.0f;
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < N; i++)
|
||||
{
|
||||
const uint32_t sel = pSelectors[i];
|
||||
@@ -648,7 +649,7 @@ static uint64_t pack_astc_4bit_3bit_to_one_color(const color_cell_compressor_par
|
||||
{
|
||||
uint32_t low = (pResults->m_low_endpoint.m_c[i] << 4) | pResults->m_low_endpoint.m_c[i];
|
||||
uint32_t high = (pResults->m_high_endpoint.m_c[i] << 4) | pResults->m_high_endpoint.m_c[i];
|
||||
|
||||
|
||||
p.m_c[i] = (uint8_t)astc_interpolate_linear(low, high, g_bc7_weights3[BC7ENC_ASTC_4BIT_3BIT_OPTIMAL_INDEX]);
|
||||
}
|
||||
p.m_c[3] = 255;
|
||||
@@ -687,10 +688,10 @@ static uint64_t pack_astc_4bit_2bit_to_one_color_rgba(const color_cell_compresso
|
||||
{
|
||||
uint32_t low = (pResults->m_low_endpoint.m_c[i] << 4) | pResults->m_low_endpoint.m_c[i];
|
||||
uint32_t high = (pResults->m_high_endpoint.m_c[i] << 4) | pResults->m_high_endpoint.m_c[i];
|
||||
|
||||
|
||||
p.m_c[i] = (uint8_t)astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_4BIT_2BIT_OPTIMAL_INDEX]);
|
||||
}
|
||||
|
||||
|
||||
uint64_t total_err = 0;
|
||||
for (uint32_t i = 0; i < pParams->m_num_pixels; i++)
|
||||
total_err += compute_color_distance_rgba(&p, &pParams->m_pPixels[i], pParams->m_perceptual, pParams->m_weights);
|
||||
@@ -726,7 +727,7 @@ static uint64_t pack_astc_range7_2bit_to_one_color(const color_cell_compressor_p
|
||||
{
|
||||
uint32_t low = g_astc_sorted_order_unquant[7][pResults->m_low_endpoint.m_c[i]].m_unquant;
|
||||
uint32_t high = g_astc_sorted_order_unquant[7][pResults->m_high_endpoint.m_c[i]].m_unquant;
|
||||
|
||||
|
||||
p.m_c[i] = (uint8_t)astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_RANGE7_2BIT_OPTIMAL_INDEX]);
|
||||
}
|
||||
p.m_c[3] = 255;
|
||||
@@ -747,7 +748,7 @@ static uint64_t pack_astc_range13_2bit_to_one_color(const color_cell_compressor_
|
||||
const endpoint_err *pEr = &g_astc_range13_2bit_optimal_endpoints[r];
|
||||
const endpoint_err *pEg = &g_astc_range13_2bit_optimal_endpoints[g];
|
||||
const endpoint_err *pEb = &g_astc_range13_2bit_optimal_endpoints[b];
|
||||
|
||||
|
||||
color_quad_u8_set(&pResults->m_low_endpoint, pEr->m_lo, pEg->m_lo, pEb->m_lo, 47);
|
||||
color_quad_u8_set(&pResults->m_high_endpoint, pEr->m_hi, pEg->m_hi, pEb->m_hi, 47);
|
||||
pResults->m_pbits[0] = 0;
|
||||
@@ -766,10 +767,10 @@ static uint64_t pack_astc_range13_2bit_to_one_color(const color_cell_compressor_
|
||||
{
|
||||
uint32_t low = g_astc_sorted_order_unquant[13][pResults->m_low_endpoint.m_c[i]].m_unquant;
|
||||
uint32_t high = g_astc_sorted_order_unquant[13][pResults->m_high_endpoint.m_c[i]].m_unquant;
|
||||
|
||||
|
||||
p.m_c[i] = (uint8_t)astc_interpolate_linear(low, high, g_bc7_weights2[BC7ENC_ASTC_RANGE13_2BIT_OPTIMAL_INDEX]);
|
||||
}
|
||||
|
||||
|
||||
uint64_t total_err = 0;
|
||||
for (uint32_t i = 0; i < pParams->m_num_pixels; i++)
|
||||
total_err += compute_color_distance_rgb(&p, &pParams->m_pPixels[i], pParams->m_perceptual, pParams->m_weights);
|
||||
@@ -878,18 +879,18 @@ static uint64_t evaluate_solution(const color_quad_u8 *pLow, const color_quad_u8
|
||||
const int dr = actualMaxColor.m_c[0] - lr;
|
||||
const int dg = actualMaxColor.m_c[1] - lg;
|
||||
const int db = actualMaxColor.m_c[2] - lb;
|
||||
|
||||
|
||||
uint64_t total_err = 0;
|
||||
|
||||
|
||||
if (pParams->m_pForce_selectors)
|
||||
{
|
||||
for (uint32_t i = 0; i < pParams->m_num_pixels; i++)
|
||||
{
|
||||
const color_quad_u8* pC = &pParams->m_pPixels[i];
|
||||
|
||||
|
||||
const uint8_t sel = pParams->m_pForce_selectors[i];
|
||||
assert(sel < N);
|
||||
|
||||
|
||||
total_err += (pParams->m_has_alpha ? compute_color_distance_rgba : compute_color_distance_rgb)(&weightedColors[sel], pC, pParams->m_perceptual, pParams->m_weights);
|
||||
|
||||
pResults->m_pSelectors_temp[i] = sel;
|
||||
@@ -930,7 +931,7 @@ static uint64_t evaluate_solution(const color_quad_u8 *pLow, const color_quad_u8
|
||||
--best_sel;
|
||||
}
|
||||
total_err += err1;
|
||||
|
||||
|
||||
pResults->m_pSelectors_temp[i] = (uint8_t)best_sel;
|
||||
}
|
||||
}
|
||||
@@ -1027,7 +1028,7 @@ static uint64_t evaluate_solution(const color_quad_u8 *pLow, const color_quad_u8
|
||||
|
||||
memcpy(pResults->m_pSelectors, pResults->m_pSelectors_temp, sizeof(pResults->m_pSelectors[0]) * pParams->m_num_pixels);
|
||||
}
|
||||
|
||||
|
||||
return total_err;
|
||||
}
|
||||
|
||||
@@ -1257,7 +1258,7 @@ static uint64_t find_optimal_solution(uint32_t mode, bc7enc_vec4F xl, bc7enc_vec
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fixDegenerateEndpoints(mode, &bestMinColor, &bestMaxColor, &xl, &xh, iscalep >> 1, 0);
|
||||
|
||||
if ((pResults->m_best_overall_err == UINT64_MAX) || color_quad_u8_notequals(&bestMinColor, &pResults->m_low_endpoint) || color_quad_u8_notequals(&bestMaxColor, &pResults->m_high_endpoint) || (best_pbits[0] != pResults->m_pbits[0]) || (best_pbits[1] != pResults->m_pbits[1]))
|
||||
@@ -1296,24 +1297,26 @@ void check_best_overall_error(const color_cell_compressor_params *pParams, color
|
||||
colors[n-1].m_c[c] = g_astc_unquant[pParams->m_astc_endpoint_range][pResults->m_astc_high_endpoint.m_c[c]].m_unquant;
|
||||
assert(colors[n-1].m_c[c] == g_astc_sorted_order_unquant[pParams->m_astc_endpoint_range][pResults->m_high_endpoint.m_c[c]].m_unquant);
|
||||
}
|
||||
|
||||
|
||||
for (uint32_t i = 1; i < pParams->m_num_selector_weights - 1; i++)
|
||||
for (uint32_t c = 0; c < 4; c++)
|
||||
colors[i].m_c[c] = (uint8_t)astc_interpolate_linear(colors[0].m_c[c], colors[n - 1].m_c[c], pParams->m_pSelector_weights[i]);
|
||||
|
||||
#ifdef _DEBUG
|
||||
uint64_t total_err = 0;
|
||||
for (uint32_t p = 0; p < pParams->m_num_pixels; p++)
|
||||
{
|
||||
const color_quad_u8 &orig = pParams->m_pPixels[p];
|
||||
const color_quad_u8 &packed = colors[pResults->m_pSelectors[p]];
|
||||
|
||||
|
||||
if (pParams->m_has_alpha)
|
||||
total_err += compute_color_distance_rgba(&orig, &packed, pParams->m_perceptual, pParams->m_weights);
|
||||
else
|
||||
total_err += compute_color_distance_rgb(&orig, &packed, pParams->m_perceptual, pParams->m_weights);
|
||||
}
|
||||
assert(total_err == pResults->m_best_overall_err);
|
||||
|
||||
#endif
|
||||
|
||||
// HACK HACK
|
||||
//if (total_err != pResults->m_best_overall_err)
|
||||
// printf("X");
|
||||
@@ -1416,12 +1419,12 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
bc7enc_vec4F color = vec4F_from_color(&pParams->m_pPixels[i]);
|
||||
meanColor = vec4F_add(&meanColor, &color);
|
||||
}
|
||||
|
||||
|
||||
bc7enc_vec4F meanColorScaled = vec4F_mul(&meanColor, 1.0f / (float)(pParams->m_num_pixels));
|
||||
|
||||
meanColor = vec4F_mul(&meanColor, 1.0f / (float)(pParams->m_num_pixels * 255.0f));
|
||||
vec4F_saturate_in_place(&meanColor);
|
||||
|
||||
|
||||
if (pParams->m_has_alpha)
|
||||
{
|
||||
// Use incremental PCA for RGBA PCA, because it's simple.
|
||||
@@ -1484,7 +1487,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
vec4F_set(&axis, xr, xg, xb, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (vec4F_dot(&axis, &axis) < .5f)
|
||||
{
|
||||
if (pParams->m_perceptual)
|
||||
@@ -1493,7 +1496,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
vec4F_set(&axis, 1.0f, 1.0f, 1.0f, pParams->m_has_alpha ? 1.0f : 0);
|
||||
vec4F_normalize_in_place(&axis);
|
||||
}
|
||||
|
||||
|
||||
bc7enc_vec4F minColor, maxColor;
|
||||
|
||||
float l = 1e+9f, h = -1e+9f;
|
||||
@@ -1518,7 +1521,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
bc7enc_vec4F c1 = vec4F_add(&meanColor, &b1);
|
||||
minColor = vec4F_saturate(&c0);
|
||||
maxColor = vec4F_saturate(&c1);
|
||||
|
||||
|
||||
bc7enc_vec4F whiteVec;
|
||||
vec4F_set_scalar(&whiteVec, 1.0f);
|
||||
if (vec4F_dot(&minColor, &whiteVec) > vec4F_dot(&maxColor, &whiteVec))
|
||||
@@ -1542,7 +1545,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
// First find a solution using the block's PCA.
|
||||
if (!find_optimal_solution(mode, minColor, maxColor, pParams, pResults))
|
||||
return 0;
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < pComp_params->m_least_squares_passes; i++)
|
||||
{
|
||||
// Now try to refine the solution using least squares by computing the optimal endpoints from the current selectors.
|
||||
@@ -1556,11 +1559,11 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
|
||||
xl = vec4F_mul(&xl, (1.0f / 255.0f));
|
||||
xh = vec4F_mul(&xh, (1.0f / 255.0f));
|
||||
|
||||
|
||||
if (!find_optimal_solution(mode, xl, xh, pParams, pResults))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if ((!pParams->m_pForce_selectors) && (pComp_params->m_uber_level > 0))
|
||||
{
|
||||
// In uber level 1, try varying the selectors a little, somewhat like cluster fit would. First try incrementing the minimum selectors,
|
||||
@@ -1597,7 +1600,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
|
||||
xl = vec4F_mul(&xl, (1.0f / 255.0f));
|
||||
xh = vec4F_mul(&xh, (1.0f / 255.0f));
|
||||
|
||||
|
||||
if (!find_optimal_solution(mode, xl, xh, pParams, pResults))
|
||||
return 0;
|
||||
|
||||
@@ -1616,7 +1619,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
|
||||
xl = vec4F_mul(&xl, (1.0f / 255.0f));
|
||||
xh = vec4F_mul(&xh, (1.0f / 255.0f));
|
||||
|
||||
|
||||
if (!find_optimal_solution(mode, xl, xh, pParams, pResults))
|
||||
return 0;
|
||||
|
||||
@@ -1673,7 +1676,7 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!pParams->m_pForce_selectors)
|
||||
{
|
||||
// Try encoding the partition as a single color by using the optimal single colors tables to encode the block to its mean.
|
||||
@@ -1754,13 +1757,13 @@ uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_param
|
||||
#if BC7ENC_CHECK_OVERALL_ERROR
|
||||
check_best_overall_error(pParams, pResults);
|
||||
#endif
|
||||
|
||||
|
||||
return pResults->m_best_overall_err;
|
||||
}
|
||||
|
||||
uint64_t color_cell_compression_est_astc(
|
||||
uint32_t num_weights, uint32_t num_comps, const uint32_t *pWeight_table,
|
||||
uint32_t num_pixels, const color_quad_u8* pPixels,
|
||||
uint32_t num_pixels, const color_quad_u8* pPixels,
|
||||
uint64_t best_err_so_far, const uint32_t weights[4])
|
||||
{
|
||||
assert(num_comps == 3 || num_comps == 4);
|
||||
@@ -1807,7 +1810,7 @@ uint64_t color_cell_compression_est_astc(
|
||||
color_quad_u8_set(&lowColor, lr, lg, lb, la);
|
||||
color_quad_u8_set(&highColor, hr, hg, hb, ha);
|
||||
|
||||
// Place endpoints at bbox diagonals and compute interpolated colors
|
||||
// Place endpoints at bbox diagonals and compute interpolated colors
|
||||
color_quad_u8 weightedColors[32];
|
||||
|
||||
weightedColors[0] = lowColor;
|
||||
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
// File: basisu_bc7enc.h
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,7 @@ namespace basisu
|
||||
|
||||
#define BC7ENC_TRUE (1)
|
||||
#define BC7ENC_FALSE (0)
|
||||
|
||||
|
||||
typedef struct { float m_c[4]; } bc7enc_vec4F;
|
||||
|
||||
extern const float g_bc7_weights1x[2 * 4];
|
||||
@@ -36,9 +36,9 @@ namespace basisu
|
||||
extern const float g_astc_weights4x[16 * 4];
|
||||
extern const float g_astc_weights5x[32 * 4];
|
||||
extern const float g_astc_weights_3levelsx[3 * 4];
|
||||
|
||||
|
||||
extern basist::astc_quant_bin g_astc_sorted_order_unquant[basist::BC7ENC_TOTAL_ASTC_RANGES][256]; // [sorted unquantized order]
|
||||
|
||||
|
||||
struct color_cell_compressor_params
|
||||
{
|
||||
uint32_t m_num_pixels;
|
||||
@@ -94,12 +94,12 @@ namespace basisu
|
||||
};
|
||||
|
||||
uint64_t color_cell_compression(uint32_t mode, const color_cell_compressor_params* pParams, color_cell_compressor_results* pResults, const bc7enc_compress_block_params* pComp_params);
|
||||
|
||||
|
||||
uint64_t color_cell_compression_est_astc(
|
||||
uint32_t num_weights, uint32_t num_comps, const uint32_t* pWeight_table,
|
||||
uint32_t num_pixels, const basist::color_quad_u8* pPixels,
|
||||
uint64_t best_err_so_far, const uint32_t weights[4]);
|
||||
|
||||
|
||||
inline void bc7enc_compress_block_params_init_linear_weights(bc7enc_compress_block_params* p)
|
||||
{
|
||||
p->m_perceptual = BC7ENC_FALSE;
|
||||
@@ -128,5 +128,5 @@ namespace basisu
|
||||
|
||||
// bc7enc_compress_block_init() MUST be called before calling bc7enc_compress_block() (or you'll get artifacts).
|
||||
void bc7enc_compress_block_init();
|
||||
|
||||
|
||||
} // namespace basisu
|
||||
|
||||
+3581
-538
File diff suppressed because it is too large
Load Diff
+539
-85
@@ -1,5 +1,5 @@
|
||||
// basisu_comp.h
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2026 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -18,9 +18,12 @@
|
||||
#include "basisu_basis_file.h"
|
||||
#include "../transcoder/basisu_transcoder.h"
|
||||
#include "basisu_uastc_enc.h"
|
||||
#include "basisu_uastc_hdr_4x4_enc.h"
|
||||
#include "basisu_astc_hdr_6x6_enc.h"
|
||||
#include "basisu_astc_ldr_encode.h"
|
||||
|
||||
#define BASISU_LIB_VERSION 116
|
||||
#define BASISU_LIB_VERSION_STRING "1.16"
|
||||
#define BASISU_LIB_VERSION 210
|
||||
#define BASISU_LIB_VERSION_STRING "2.10"
|
||||
|
||||
#ifndef BASISD_SUPPORT_KTX2
|
||||
#error BASISD_SUPPORT_KTX2 is undefined
|
||||
@@ -50,11 +53,18 @@ namespace basisu
|
||||
const float BASISU_DEFAULT_HYBRID_SEL_CB_QUALITY_THRESH = 2.0f;
|
||||
|
||||
const uint32_t BASISU_MAX_IMAGE_DIMENSION = 16384;
|
||||
const uint32_t BASISU_QUALITY_MIN = 1;
|
||||
|
||||
// The original ETC1S specific (non-unified) quality level
|
||||
const uint32_t BASISU_QUALITY_MIN = 1; // note 0 is also technically valid in the code/API for ETC1S; the difference in quality is tiny (both result in very small codebooks)
|
||||
const uint32_t BASISU_QUALITY_MAX = 255;
|
||||
|
||||
const uint32_t BASISU_MAX_ENDPOINT_CLUSTERS = basisu_frontend::cMaxEndpointClusters;
|
||||
const uint32_t BASISU_MAX_SELECTOR_CLUSTERS = basisu_frontend::cMaxSelectorClusters;
|
||||
|
||||
// [1,100] are also the valid unified quality levels
|
||||
const uint32_t BASISU_XUASTC_QUALITY_MIN = 1;
|
||||
const uint32_t BASISU_XUASTC_QUALITY_MAX = 100;
|
||||
|
||||
const uint32_t BASISU_MAX_SLICES = 0xFFFFFF;
|
||||
|
||||
const int BASISU_RDO_UASTC_DICT_SIZE_DEFAULT = 4096; // 32768;
|
||||
@@ -75,12 +85,17 @@ namespace basisu
|
||||
m_height = 0;
|
||||
|
||||
m_basis_rgb_avg_psnr = 0.0f;
|
||||
m_basis_rgb_avg_log2_psnr = 0.0f;
|
||||
|
||||
m_basis_rgba_avg_psnr = 0.0f;
|
||||
m_basis_a_avg_psnr = 0.0f;
|
||||
m_basis_luma_709_psnr = 0.0f;
|
||||
m_basis_luma_601_psnr = 0.0f;
|
||||
m_basis_luma_709_ssim = 0.0f;
|
||||
|
||||
m_basis_rgb_avg_bc6h_psnr = 0.0f;
|
||||
m_basis_rgb_avg_bc6h_log2_psnr = 0.0f;
|
||||
|
||||
m_bc7_rgb_avg_psnr = 0.0f;
|
||||
m_bc7_rgba_avg_psnr = 0.0f;
|
||||
m_bc7_a_avg_psnr = 0.0f;
|
||||
@@ -92,21 +107,29 @@ namespace basisu
|
||||
m_best_etc1s_luma_709_psnr = 0.0f;
|
||||
m_best_etc1s_luma_601_psnr = 0.0f;
|
||||
m_best_etc1s_luma_709_ssim = 0.0f;
|
||||
|
||||
m_opencl_failed = false;
|
||||
}
|
||||
|
||||
std::string m_filename;
|
||||
uint32_t m_width;
|
||||
uint32_t m_height;
|
||||
|
||||
// .basis compressed (ETC1S or UASTC statistics)
|
||||
// .basis/.ktx2 compressed (LDR: ETC1S or UASTC statistics, HDR: transcoded BC6H statistics)
|
||||
float m_basis_rgb_avg_psnr;
|
||||
float m_basis_rgb_avg_log2_psnr;
|
||||
|
||||
float m_basis_rgba_avg_psnr;
|
||||
float m_basis_a_avg_psnr;
|
||||
float m_basis_luma_709_psnr;
|
||||
float m_basis_luma_601_psnr;
|
||||
float m_basis_luma_709_ssim;
|
||||
|
||||
// BC7 statistics
|
||||
// UASTC HDR only.
|
||||
float m_basis_rgb_avg_bc6h_psnr;
|
||||
float m_basis_rgb_avg_bc6h_log2_psnr;
|
||||
|
||||
// LDR: BC7 statistics
|
||||
float m_bc7_rgb_avg_psnr;
|
||||
float m_bc7_rgba_avg_psnr;
|
||||
float m_bc7_a_avg_psnr;
|
||||
@@ -114,11 +137,24 @@ namespace basisu
|
||||
float m_bc7_luma_601_psnr;
|
||||
float m_bc7_luma_709_ssim;
|
||||
|
||||
// Highest achievable quality ETC1S statistics
|
||||
// LDR: Highest achievable quality ETC1S statistics, for development/comparison
|
||||
float m_best_etc1s_rgb_avg_psnr;
|
||||
float m_best_etc1s_luma_709_psnr;
|
||||
float m_best_etc1s_luma_601_psnr;
|
||||
float m_best_etc1s_luma_709_ssim;
|
||||
|
||||
bool m_opencl_failed;
|
||||
};
|
||||
|
||||
enum class hdr_modes
|
||||
{
|
||||
// standard but constrained ASTC HDR 4x4 tex data that can be rapidly transcoded to BC6H
|
||||
cUASTC_HDR_4X4,
|
||||
// standard RDO optimized or non-RDO (highest quality) ASTC HDR 6x6 tex data that can be rapidly re-encoded to BC6H
|
||||
cASTC_HDR_6X6,
|
||||
// a custom intermediate format based off ASTC HDR that can be rapidly decoded straight to ASTC HDR or re-encoded to BC6H
|
||||
cUASTC_HDR_6X6_INTERMEDIATE,
|
||||
cTotal
|
||||
};
|
||||
|
||||
template<bool def>
|
||||
@@ -202,29 +238,41 @@ namespace basisu
|
||||
bool m_changed;
|
||||
};
|
||||
|
||||
// Low-level direct compressor parameters.
|
||||
// Also see basis_compress() below for a simplified C-style interface.
|
||||
struct basis_compressor_params
|
||||
{
|
||||
basis_compressor_params() :
|
||||
m_compression_level((int)BASISU_DEFAULT_COMPRESSION_LEVEL, 0, (int)BASISU_MAX_COMPRESSION_LEVEL),
|
||||
m_xuastc_or_astc_ldr_basis_tex_format(-1, -1, INT_MAX),
|
||||
// Note the ETC1S default compression/effort level is 2, not the command line default of 1.
|
||||
m_etc1s_compression_level((int)BASISU_DEFAULT_ETC1S_COMPRESSION_LEVEL, 0, (int)BASISU_MAX_ETC1S_COMPRESSION_LEVEL),
|
||||
m_selector_rdo_thresh(BASISU_DEFAULT_SELECTOR_RDO_THRESH, 0.0f, 1e+10f),
|
||||
m_endpoint_rdo_thresh(BASISU_DEFAULT_ENDPOINT_RDO_THRESH, 0.0f, 1e+10f),
|
||||
m_mip_scale(1.0f, .000125f, 4.0f),
|
||||
m_mip_smallest_dimension(1, 1, 16384),
|
||||
m_max_endpoint_clusters(512),
|
||||
m_max_selector_clusters(512),
|
||||
m_etc1s_max_endpoint_clusters(0),
|
||||
m_etc1s_max_selector_clusters(0),
|
||||
m_quality_level(-1),
|
||||
m_pack_uastc_flags(cPackUASTCLevelDefault),
|
||||
m_rdo_uastc_quality_scalar(1.0f, 0.001f, 50.0f),
|
||||
m_rdo_uastc_dict_size(BASISU_RDO_UASTC_DICT_SIZE_DEFAULT, BASISU_RDO_UASTC_DICT_SIZE_MIN, BASISU_RDO_UASTC_DICT_SIZE_MAX),
|
||||
m_rdo_uastc_max_smooth_block_error_scale(UASTC_RDO_DEFAULT_SMOOTH_BLOCK_MAX_ERROR_SCALE, 1.0f, 300.0f),
|
||||
m_rdo_uastc_smooth_block_max_std_dev(UASTC_RDO_DEFAULT_MAX_SMOOTH_BLOCK_STD_DEV, .01f, 65536.0f),
|
||||
m_rdo_uastc_max_allowed_rms_increase_ratio(UASTC_RDO_DEFAULT_MAX_ALLOWED_RMS_INCREASE_RATIO, .01f, 100.0f),
|
||||
m_rdo_uastc_skip_block_rms_thresh(UASTC_RDO_DEFAULT_SKIP_BLOCK_RMS_THRESH, .01f, 100.0f),
|
||||
m_pack_uastc_ldr_4x4_flags(cPackUASTCLevelDefault),
|
||||
m_rdo_uastc_ldr_4x4_quality_scalar(1.0f, 0.001f, 50.0f),
|
||||
m_rdo_uastc_ldr_4x4_dict_size(BASISU_RDO_UASTC_DICT_SIZE_DEFAULT, BASISU_RDO_UASTC_DICT_SIZE_MIN, BASISU_RDO_UASTC_DICT_SIZE_MAX),
|
||||
m_rdo_uastc_ldr_4x4_max_smooth_block_error_scale(UASTC_RDO_DEFAULT_SMOOTH_BLOCK_MAX_ERROR_SCALE, 1.0f, 300.0f),
|
||||
m_rdo_uastc_ldr_4x4_smooth_block_max_std_dev(UASTC_RDO_DEFAULT_MAX_SMOOTH_BLOCK_STD_DEV, .01f, 65536.0f),
|
||||
m_rdo_uastc_ldr_4x4_max_allowed_rms_increase_ratio(UASTC_RDO_DEFAULT_MAX_ALLOWED_RMS_INCREASE_RATIO, .01f, 100.0f),
|
||||
m_rdo_uastc_ldr_4x4_skip_block_rms_thresh(UASTC_RDO_DEFAULT_SKIP_BLOCK_RMS_THRESH, .01f, 100.0f),
|
||||
m_resample_width(0, 1, 16384),
|
||||
m_resample_height(0, 1, 16384),
|
||||
m_resample_factor(0.0f, .00125f, 100.0f),
|
||||
m_ktx2_uastc_supercompression(basist::KTX2_SS_NONE),
|
||||
m_ktx2_zstd_supercompression_level(6, INT_MIN, INT_MAX),
|
||||
m_transcode_flags(0, 0, UINT32_MAX),
|
||||
m_ldr_hdr_upconversion_nit_multiplier(0.0f, 0.0f, basist::MAX_HALF_FLOAT),
|
||||
m_ldr_hdr_upconversion_black_bias(0.0f, 0.0f, 1.0f),
|
||||
m_xuastc_ldr_effort_level(astc_ldr::EFFORT_LEVEL_DEF, astc_ldr::EFFORT_LEVEL_MIN, astc_ldr::EFFORT_LEVEL_MAX),
|
||||
m_xuastc_ldr_syntax((int)basist::astc_ldr_t::xuastc_ldr_syntax::cFullZStd, (int)basist::astc_ldr_t::xuastc_ldr_syntax::cFullArith, (int)basist::astc_ldr_t::xuastc_ldr_syntax::cFullZStd),
|
||||
m_ls_min_psnr(35.0f, 0.0f, 100.0f), m_ls_min_alpha_psnr(38.0f, 0.0f, 100.0f),
|
||||
m_ls_thresh_psnr(1.5f, 0.0f, 100.0f), m_ls_thresh_alpha_psnr(0.75f, 0.0f, 100.0f),
|
||||
m_ls_thresh_edge_psnr(1.0f, 0.0f, 100.00f), m_ls_thresh_edge_alpha_psnr(0.5f, 0.0f, 100.00f),
|
||||
m_pJob_pool(nullptr)
|
||||
{
|
||||
clear();
|
||||
@@ -232,7 +280,13 @@ namespace basisu
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_format_mode = basist::basis_tex_format::cETC1S;
|
||||
|
||||
m_uastc.clear();
|
||||
m_hdr.clear();
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_4X4;
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
|
||||
m_use_opencl.clear();
|
||||
m_status_output.clear();
|
||||
|
||||
@@ -252,9 +306,10 @@ namespace basisu
|
||||
m_no_selector_rdo.clear();
|
||||
m_selector_rdo_thresh.clear();
|
||||
m_read_source_images.clear();
|
||||
m_write_output_basis_files.clear();
|
||||
m_compression_level.clear();
|
||||
m_write_output_basis_or_ktx2_files.clear();
|
||||
m_etc1s_compression_level.clear();
|
||||
m_compute_stats.clear();
|
||||
m_print_stats.clear();
|
||||
m_check_for_alpha.clear();
|
||||
m_force_alpha.clear();
|
||||
m_multithreading.clear();
|
||||
@@ -279,8 +334,8 @@ namespace basisu
|
||||
m_mip_fast.clear();
|
||||
m_mip_smallest_dimension.clear();
|
||||
|
||||
m_max_endpoint_clusters = 0;
|
||||
m_max_selector_clusters = 0;
|
||||
m_etc1s_max_endpoint_clusters = 0;
|
||||
m_etc1s_max_selector_clusters = 0;
|
||||
m_quality_level = -1;
|
||||
|
||||
m_tex_type = basist::cBASISTexType2D;
|
||||
@@ -288,15 +343,15 @@ namespace basisu
|
||||
m_userdata1 = 0;
|
||||
m_us_per_frame = 0;
|
||||
|
||||
m_pack_uastc_flags = cPackUASTCLevelDefault;
|
||||
m_rdo_uastc.clear();
|
||||
m_rdo_uastc_quality_scalar.clear();
|
||||
m_rdo_uastc_max_smooth_block_error_scale.clear();
|
||||
m_rdo_uastc_smooth_block_max_std_dev.clear();
|
||||
m_rdo_uastc_max_allowed_rms_increase_ratio.clear();
|
||||
m_rdo_uastc_skip_block_rms_thresh.clear();
|
||||
m_rdo_uastc_favor_simpler_modes_in_rdo_mode.clear();
|
||||
m_rdo_uastc_multithreading.clear();
|
||||
m_pack_uastc_ldr_4x4_flags = cPackUASTCLevelDefault;
|
||||
m_rdo_uastc_ldr_4x4.clear();
|
||||
m_rdo_uastc_ldr_4x4_quality_scalar.clear();
|
||||
m_rdo_uastc_ldr_4x4_max_smooth_block_error_scale.clear();
|
||||
m_rdo_uastc_ldr_4x4_smooth_block_max_std_dev.clear();
|
||||
m_rdo_uastc_ldr_4x4_max_allowed_rms_increase_ratio.clear();
|
||||
m_rdo_uastc_ldr_4x4_skip_block_rms_thresh.clear();
|
||||
m_rdo_uastc_ldr_4x4_favor_simpler_modes_in_rdo_mode.clear();
|
||||
m_rdo_uastc_ldr_4x4_multithreading.clear();
|
||||
|
||||
m_resample_width.clear();
|
||||
m_resample_height.clear();
|
||||
@@ -308,31 +363,215 @@ namespace basisu
|
||||
m_ktx2_uastc_supercompression = basist::KTX2_SS_NONE;
|
||||
m_ktx2_key_values.clear();
|
||||
m_ktx2_zstd_supercompression_level.clear();
|
||||
m_ktx2_srgb_transfer_func.clear();
|
||||
m_ktx2_and_basis_srgb_transfer_function.clear();
|
||||
|
||||
m_validate_output_data.clear();
|
||||
m_transcode_flags.clear();
|
||||
|
||||
m_ldr_hdr_upconversion_srgb_to_linear.clear();
|
||||
|
||||
m_hdr_favor_astc.clear();
|
||||
|
||||
m_uastc_hdr_4x4_options.init();
|
||||
m_astc_hdr_6x6_options.clear();
|
||||
|
||||
m_ldr_hdr_upconversion_nit_multiplier.clear();
|
||||
m_ldr_hdr_upconversion_black_bias.clear();
|
||||
|
||||
m_xuastc_ldr_effort_level.clear();
|
||||
m_xuastc_ldr_use_dct.clear();
|
||||
m_xuastc_ldr_use_lossy_supercompression.clear();
|
||||
m_xuastc_ldr_force_disable_subsets.clear();
|
||||
m_xuastc_ldr_force_disable_rgb_dual_plane.clear();
|
||||
m_xuastc_ldr_syntax.clear();
|
||||
|
||||
m_ls_min_psnr.clear();
|
||||
m_ls_min_alpha_psnr.clear();
|
||||
m_ls_thresh_psnr.clear();
|
||||
m_ls_thresh_alpha_psnr.clear();
|
||||
m_ls_thresh_edge_psnr.clear();
|
||||
m_ls_thresh_edge_alpha_psnr.clear();
|
||||
for (uint32_t i = 0; i < 4; i++)
|
||||
m_xuastc_ldr_channel_weights[i] = 1;
|
||||
m_xuastc_ldr_blurring.clear();
|
||||
|
||||
m_pJob_pool = nullptr;
|
||||
}
|
||||
|
||||
// True to generate UASTC .basis file data, otherwise ETC1S.
|
||||
|
||||
// Configures the compressor's mode by setting the proper parameters (which were preserved for backwards compatibility with old code).
|
||||
// This is by far the preferred way of controlling which codec mode the compressor will select.
|
||||
void set_format_mode(basist::basis_tex_format mode)
|
||||
{
|
||||
m_format_mode = mode;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case basist::basis_tex_format::cETC1S:
|
||||
{
|
||||
// ETC1S
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
m_hdr = false;
|
||||
m_uastc = false;
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_4X4; // doesn't matter
|
||||
break;
|
||||
}
|
||||
case basist::basis_tex_format::cUASTC_LDR_4x4:
|
||||
{
|
||||
// UASTC LDR 4x4
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
m_hdr = false;
|
||||
m_uastc = true;
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_4X4; // doesn't matter
|
||||
break;
|
||||
}
|
||||
case basist::basis_tex_format::cUASTC_HDR_4x4:
|
||||
{
|
||||
// UASTC HDR 4x4
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
m_hdr = true;
|
||||
m_uastc = true;
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_4X4;
|
||||
break;
|
||||
}
|
||||
case basist::basis_tex_format::cASTC_HDR_6x6:
|
||||
{
|
||||
// ASTC HDR 6x6
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
m_hdr = true;
|
||||
m_uastc = true;
|
||||
m_hdr_mode = hdr_modes::cASTC_HDR_6X6;
|
||||
break;
|
||||
}
|
||||
case basist::basis_tex_format::cUASTC_HDR_6x6_INTERMEDIATE:
|
||||
{
|
||||
// UASTC HDR 6x6
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = -1;
|
||||
m_hdr = true;
|
||||
m_uastc = true;
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_6X6_INTERMEDIATE;
|
||||
break;
|
||||
}
|
||||
case basist::basis_tex_format::cXUASTC_LDR_4x4:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_5x4:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_5x5:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_6x5:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_6x6:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_8x5:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_8x6:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_10x5:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_10x6:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_8x8:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_10x8:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_10x10:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_12x10:
|
||||
case basist::basis_tex_format::cXUASTC_LDR_12x12:
|
||||
case basist::basis_tex_format::cASTC_LDR_4x4:
|
||||
case basist::basis_tex_format::cASTC_LDR_5x4:
|
||||
case basist::basis_tex_format::cASTC_LDR_5x5:
|
||||
case basist::basis_tex_format::cASTC_LDR_6x5:
|
||||
case basist::basis_tex_format::cASTC_LDR_6x6:
|
||||
case basist::basis_tex_format::cASTC_LDR_8x5:
|
||||
case basist::basis_tex_format::cASTC_LDR_8x6:
|
||||
case basist::basis_tex_format::cASTC_LDR_10x5:
|
||||
case basist::basis_tex_format::cASTC_LDR_10x6:
|
||||
case basist::basis_tex_format::cASTC_LDR_8x8:
|
||||
case basist::basis_tex_format::cASTC_LDR_10x8:
|
||||
case basist::basis_tex_format::cASTC_LDR_10x10:
|
||||
case basist::basis_tex_format::cASTC_LDR_12x10:
|
||||
case basist::basis_tex_format::cASTC_LDR_12x12:
|
||||
{
|
||||
// ASTC LDR 4x4-12x12 or XUASTC LDR 4x4-12x12
|
||||
m_xuastc_or_astc_ldr_basis_tex_format = (int)mode;
|
||||
m_hdr = false;
|
||||
m_uastc = true;
|
||||
m_hdr_mode = hdr_modes::cUASTC_HDR_4X4; // doesn't matter
|
||||
break;
|
||||
}
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Like set_format_mode() but also sets the effort and quality parameters appropriately for the selected mode.
|
||||
// "Effort" (perf. vs. highest achievable quality) and "quality" (quality vs. bitrate) parameters are now mode dependent.
|
||||
// Effort ranges from [0,10] and quality ranges from [1,100], unless they are -1 in which case you get the codec's default settings.
|
||||
bool set_format_mode_and_effort(basist::basis_tex_format mode, int effort = -1, bool set_defaults = true);
|
||||
bool set_format_mode_and_quality_effort(basist::basis_tex_format mode, int quality = -1, int effort = -1, bool set_defaults = true);
|
||||
|
||||
// Sets all the sRGB-related options (m_perceptual, m_mip_srgb, m_ktx2_and_basis_srgb_transfer_function) to the specified value.
|
||||
void set_srgb_options(bool srgb_flag)
|
||||
{
|
||||
m_perceptual = srgb_flag;
|
||||
m_mip_srgb = srgb_flag;
|
||||
m_ktx2_and_basis_srgb_transfer_function = srgb_flag;
|
||||
}
|
||||
|
||||
// Simpler helpers - I wish this was easier, but backwards API compat is also valuable.
|
||||
bool is_etc1s() const
|
||||
{
|
||||
return !m_uastc;
|
||||
}
|
||||
|
||||
bool is_uastc_ldr_4x4() const
|
||||
{
|
||||
return m_uastc && !m_hdr && (m_xuastc_or_astc_ldr_basis_tex_format == -1);
|
||||
}
|
||||
|
||||
bool is_uastc_hdr_4x4() const
|
||||
{
|
||||
return m_uastc && m_hdr && (m_hdr_mode == hdr_modes::cUASTC_HDR_4X4);
|
||||
}
|
||||
|
||||
// By default we generate LDR ETC1S data.
|
||||
// Ideally call set_format_mode() above instead of directly manipulating the below fields. These individual parameters are for backwards API compatibility.
|
||||
// - If m_uastc is false you get ETC1S (the default).
|
||||
// - If m_uastc is true, and m_hdr is not true, and m_xuastc_or_astc_ldr_basis_tex_format==-1, we generate UASTC 4x4 LDR data (8bpp with or without RDO).
|
||||
// - If m_uastc is true, and m_hdr is not true, and m_xuastc_or_astc_ldr_basis_tex_format!=-1, we generate XUASTC 4x4-12x12 or ASTC 4x4-12x12 LDR data, controlled by m_xuastc_or_astc_ldr_basis_tex_format.
|
||||
// - If m_uastc is true and m_hdr is true, we generate 4x4 or 6x6 HDR data, controlled by m_hdr_mode.
|
||||
|
||||
// True to generate UASTC .basis/.KTX2 file data, otherwise ETC1S.
|
||||
// Should be true for any non-ETC1S format (UASTC 4x4 LDR, UASTC 4x4 HDR, RDO ASTC 6x6 HDR, UASTC 6x6 HDR, or ASTC/XUASTC LDR 4x4-12x12).
|
||||
// Note: Ideally call set_format_mode() or set_format_mode_and_quality_effort() above instead.
|
||||
// Many of these individual parameters are for backwards API compatibility.
|
||||
bool_param<false> m_uastc;
|
||||
|
||||
// Set m_hdr to true to switch to UASTC HDR mode. m_hdr_mode then controls which format is output.
|
||||
// m_hdr_mode then controls which format is output (4x4, 6x6, or 6x6 intermediate).
|
||||
// Note: Ideally call set_format_mode() instead. This is for backwards API compatibility.
|
||||
bool_param<false> m_hdr;
|
||||
|
||||
// If m_hdr is true, this specifies which mode we operate in (currently UASTC 4x4 HDR or ASTC 6x6 HDR). Defaults to UASTC 4x4 HDR for backwards compatibility.
|
||||
// Note: Ideally call set_format_mode() instead. This is for backwards API compatibility.
|
||||
hdr_modes m_hdr_mode;
|
||||
|
||||
// If not -1: Generate XUASTC or ASTC LDR 4x4-12x12 files in the specified basis_tex_format (which also sets the ASTC block size). If -1 (the default), don't generate XUASTC/ASTC LDR files.
|
||||
// m_uastc must also be set to true if this is not -1.
|
||||
// Note: Ideally call set_format_mode() instead.
|
||||
param<int> m_xuastc_or_astc_ldr_basis_tex_format; // enum basis_tex_format
|
||||
|
||||
// True to enable OpenCL if it's available. The compressor will fall back to CPU encoding if something goes wrong.
|
||||
bool_param<false> m_use_opencl;
|
||||
|
||||
// If m_read_source_images is true, m_source_filenames (and optionally m_source_alpha_filenames) contains the filenames of PNG images to read.
|
||||
// Otherwise, the compressor processes the images in m_source_images.
|
||||
// If m_read_source_images is true, m_source_filenames (and optionally m_source_alpha_filenames) contains the filenames of PNG etc. images to read.
|
||||
// Otherwise, the compressor processes the images in m_source_images or m_source_images_hdr.
|
||||
basisu::vector<std::string> m_source_filenames;
|
||||
basisu::vector<std::string> m_source_alpha_filenames;
|
||||
|
||||
// An array of 2D LDR/SDR source images.
|
||||
basisu::vector<image> m_source_images;
|
||||
|
||||
// An array of 2D HDR source images.
|
||||
basisu::vector<imagef> m_source_images_hdr;
|
||||
|
||||
// Stores mipmaps starting from level 1. Level 0 is still stored in m_source_images, as usual.
|
||||
// If m_source_mipmaps isn't empty, automatic mipmap generation isn't done. m_source_mipmaps.size() MUST equal m_source_images.size() or the compressor returns an error.
|
||||
// The compressor applies the user-provided swizzling (in m_swizzle) to these images.
|
||||
basisu::vector< basisu::vector<image> > m_source_mipmap_images;
|
||||
|
||||
basisu::vector< basisu::vector<imagef> > m_source_mipmap_images_hdr;
|
||||
|
||||
// Filename of the output basis file
|
||||
// Filename of the output basis/ktx2 file
|
||||
std::string m_out_filename;
|
||||
|
||||
// The params are done this way so we can detect when the user has explictly changed them.
|
||||
@@ -345,17 +584,21 @@ namespace basisu
|
||||
|
||||
// Output debug information during compression
|
||||
bool_param<false> m_debug;
|
||||
|
||||
// Low-level ETC1S data validation during encoding (slower/development).
|
||||
bool_param<false> m_validate_etc1s;
|
||||
|
||||
// m_debug_images is pretty slow
|
||||
bool_param<false> m_debug_images;
|
||||
|
||||
// ETC1S compression level, from 0 to BASISU_MAX_COMPRESSION_LEVEL (higher is slower).
|
||||
// ETC1S compression effort level, from 0 to BASISU_MAX_ETC1S_COMPRESSION_LEVEL (higher is slower).
|
||||
// This parameter controls numerous internal encoding speed vs. compression efficiency/performance tradeoffs.
|
||||
// Note this is NOT the same as the ETC1S quality level, and most users shouldn't change this.
|
||||
param<int> m_compression_level;
|
||||
param<int> m_etc1s_compression_level;
|
||||
|
||||
// Use perceptual sRGB colorspace metrics instead of linear
|
||||
// Use perceptual sRGB colorspace metrics instead of linear.
|
||||
// Note: You probably also want to set m_ktx2_srgb_transfer_func to match.
|
||||
// Note: This member variable was previously called "m_perceptual".
|
||||
bool_param<true> m_perceptual;
|
||||
|
||||
// Disable selector RDO, for faster compression but larger files
|
||||
@@ -368,26 +611,33 @@ namespace basisu
|
||||
// Read source images from m_source_filenames/m_source_alpha_filenames
|
||||
bool_param<false> m_read_source_images;
|
||||
|
||||
// Write the output basis file to disk using m_out_filename
|
||||
bool_param<false> m_write_output_basis_files;
|
||||
// Write the output basis/ktx2 file to disk using m_out_filename
|
||||
bool_param<false> m_write_output_basis_or_ktx2_files;
|
||||
|
||||
// Compute and display image metrics
|
||||
bool_param<false> m_compute_stats;
|
||||
|
||||
// Print stats to stdout, if m_compute_stats is true.
|
||||
bool_param<true> m_print_stats;
|
||||
|
||||
// Check to see if any input image has an alpha channel, if so then the output basis file will have alpha channels
|
||||
// Check to see if any input image has an alpha channel, if so then the output basis/ktx2 file will have alpha channels
|
||||
bool_param<true> m_check_for_alpha;
|
||||
|
||||
// Always put alpha slices in the output basis file, even when the input doesn't have alpha
|
||||
// Always put alpha slices in the output basis/ktx2 file, even when the input doesn't have alpha
|
||||
bool_param<false> m_force_alpha;
|
||||
|
||||
// True to enable multithreading in various compressors.
|
||||
// Note currently, some compressors (like ASTC/XUASTC LDR) will utilize threading anyway if the job pool is more than one thread.
|
||||
bool_param<true> m_multithreading;
|
||||
|
||||
// Split the R channel to RGB and the G channel to alpha, then write a basis file with alpha channels
|
||||
char m_swizzle[4];
|
||||
// Split the R channel to RGB and the G channel to alpha, then write a basis/ktx2 file with alpha channels
|
||||
uint8_t m_swizzle[4];
|
||||
|
||||
// Renormalize normal map normals after loading image
|
||||
bool_param<false> m_renormalize;
|
||||
|
||||
// If true the front end will not use 2 level endpoint codebook searching, for slightly higher quality but much slower execution.
|
||||
// Note some m_compression_level's disable this automatically.
|
||||
// Note some m_etc1s_compression_level's disable this automatically.
|
||||
bool_param<false> m_disable_hierarchical_endpoint_codebooks;
|
||||
|
||||
// mipmap generation parameters
|
||||
@@ -401,48 +651,112 @@ namespace basisu
|
||||
bool_param<true> m_mip_fast;
|
||||
param<int> m_mip_smallest_dimension;
|
||||
|
||||
// Codebook size (quality) control.
|
||||
// If m_quality_level != -1, it controls the quality level. It ranges from [1,255] or [BASISU_QUALITY_MIN, BASISU_QUALITY_MAX].
|
||||
// ETC1S codebook size (quality) control.
|
||||
// If m_quality_level (previously named m_etc1s_quality_level) != -1, it controls the quality level. It ranges from [1,255] or [BASISU_QUALITY_MIN, BASISU_QUALITY_MAX].
|
||||
// Otherwise m_max_endpoint_clusters/m_max_selector_clusters controls the codebook sizes directly.
|
||||
uint32_t m_max_endpoint_clusters;
|
||||
uint32_t m_max_selector_clusters;
|
||||
int m_quality_level;
|
||||
uint32_t m_etc1s_max_endpoint_clusters;
|
||||
uint32_t m_etc1s_max_selector_clusters;
|
||||
|
||||
// Quality level (bitrate vs. distortion tradeoff) control for ETC1S or XUASTC LDR 4x4-12x12.
|
||||
// ETC1S: Must set to [1,255] or [BASISU_QUALITY_MIN, BASISU_QUALITY_MAX] to control quality vs. bitrate. If -1 (the default!), quality is controlled by m_etc1s_max_endpoint_clusters and m_etc1s_max_selector_clusters directly.
|
||||
// XUASTC LDR: Must not be -1 for DCT.
|
||||
int m_quality_level;
|
||||
|
||||
// m_tex_type, m_userdata0, m_userdata1, m_framerate - These fields go directly into the Basis file header.
|
||||
// m_tex_type, m_userdata0, m_userdata1, m_framerate - These fields go directly into the .basis file header.
|
||||
basist::basis_texture_type m_tex_type;
|
||||
uint32_t m_userdata0;
|
||||
uint32_t m_userdata1;
|
||||
uint32_t m_us_per_frame;
|
||||
|
||||
// UASTC LDR 4x4 parameters
|
||||
// cPackUASTCLevelDefault, etc.
|
||||
uint32_t m_pack_uastc_flags;
|
||||
bool_param<false> m_rdo_uastc;
|
||||
param<float> m_rdo_uastc_quality_scalar;
|
||||
param<int> m_rdo_uastc_dict_size;
|
||||
param<float> m_rdo_uastc_max_smooth_block_error_scale;
|
||||
param<float> m_rdo_uastc_smooth_block_max_std_dev;
|
||||
param<float> m_rdo_uastc_max_allowed_rms_increase_ratio;
|
||||
param<float> m_rdo_uastc_skip_block_rms_thresh;
|
||||
bool_param<true> m_rdo_uastc_favor_simpler_modes_in_rdo_mode;
|
||||
bool_param<true> m_rdo_uastc_multithreading;
|
||||
uint32_t m_pack_uastc_ldr_4x4_flags;
|
||||
bool_param<false> m_rdo_uastc_ldr_4x4;
|
||||
param<float> m_rdo_uastc_ldr_4x4_quality_scalar; // RDO lambda for UASTC 4x4 LDR
|
||||
param<int> m_rdo_uastc_ldr_4x4_dict_size;
|
||||
param<float> m_rdo_uastc_ldr_4x4_max_smooth_block_error_scale;
|
||||
param<float> m_rdo_uastc_ldr_4x4_smooth_block_max_std_dev;
|
||||
param<float> m_rdo_uastc_ldr_4x4_max_allowed_rms_increase_ratio;
|
||||
param<float> m_rdo_uastc_ldr_4x4_skip_block_rms_thresh;
|
||||
bool_param<true> m_rdo_uastc_ldr_4x4_favor_simpler_modes_in_rdo_mode;
|
||||
bool_param<true> m_rdo_uastc_ldr_4x4_multithreading;
|
||||
|
||||
// Resample input texture after loading
|
||||
param<int> m_resample_width;
|
||||
param<int> m_resample_height;
|
||||
param<float> m_resample_factor;
|
||||
|
||||
// ETC1S global codebook control
|
||||
const basist::basisu_lowlevel_etc1s_transcoder *m_pGlobal_codebooks;
|
||||
|
||||
// KTX2 specific parameters.
|
||||
// Internally, the compressor always creates a .basis file then it converts that lossless to KTX2.
|
||||
// Internally, the compressor always creates a .basis file then it converts that losslessly to KTX2.
|
||||
bool_param<false> m_create_ktx2_file;
|
||||
basist::ktx2_supercompression m_ktx2_uastc_supercompression;
|
||||
basist::ktx2_transcoder::key_value_vec m_ktx2_key_values;
|
||||
param<int> m_ktx2_zstd_supercompression_level;
|
||||
bool_param<false> m_ktx2_srgb_transfer_func;
|
||||
|
||||
// Note: The default for this parameter (which used to be "m_ktx2_srgb_transfer_func") used to be false, now setting this to true and renaming to m_ktx2_and_basis_srgb_transfer_function.
|
||||
// Also see m_perceptual and m_mip_srgb, which should in most uses be the same.
|
||||
// This also controls the XUASTC LDR ASTC decode profile (linear vs. sRGB) in the simulated decoder block.
|
||||
// For XUASTC LDR, it's also still used when generating .basis files vs. .KTX2.
|
||||
bool_param<true> m_ktx2_and_basis_srgb_transfer_function; // false = linear transfer function, true = sRGB transfer function
|
||||
|
||||
// HDR codec specific options
|
||||
uastc_hdr_4x4_codec_options m_uastc_hdr_4x4_options;
|
||||
astc_6x6_hdr::astc_hdr_6x6_global_config m_astc_hdr_6x6_options; // also UASTC HDR 6x6i
|
||||
|
||||
// True to try transcoding the generated output after compression to a few formats.
|
||||
bool_param<false> m_validate_output_data;
|
||||
|
||||
// The flags to use while transcoding if m_validate_output_data
|
||||
param<uint32_t> m_transcode_flags;
|
||||
|
||||
// LDR->HDR upconversion parameters.
|
||||
//
|
||||
// If true, LDR images (such as PNG) will be converted to normalized [0,1] linear light (via a sRGB->Linear conversion), or absolute luminance (nits or candelas per meter squared), and then processed as HDR.
|
||||
// Otherwise, LDR images are assumed to already be in linear light (i.e. they don't use the sRGB transfer function).
|
||||
bool_param<true> m_ldr_hdr_upconversion_srgb_to_linear;
|
||||
|
||||
// m_ldr_hdr_upconversion_nit_multiplier is only used when loading SDR/LDR images and compressing to an HDR output format.
|
||||
// By default m_ldr_hdr_upconversion_nit_multiplier is 0. It's an override for the default, which is now 100.0 nits (LDR_TO_HDR_NITS).
|
||||
// UASTC HDR 4x4: The default multiplier of 1.0 was previously used in this codec's original release. Note this encoder isn't dependent on absolute nits, unlike the ASTC 6x6 HDR encoder.
|
||||
// RDO ASTC HDR 6x6/UASTC HDR 6x6i: These encoders expect inputs in absolute nits, so the LDR upconversion luminance multiplier default will be 100 nits. (Most SDR monitors were/are 80-100 nits or so.)
|
||||
param<float> m_ldr_hdr_upconversion_nit_multiplier;
|
||||
|
||||
// The optional sRGB space bias to use during LDR->HDR upconversion. Should be between [0,.49] or so. Only applied on black (0.0) color components.
|
||||
// Defaults to no bias (0.0f).
|
||||
param<float> m_ldr_hdr_upconversion_black_bias;
|
||||
|
||||
// If true, ASTC HDR quality is favored more than BC6H quality by the dual target encoder. Otherwise it's a rough balance.
|
||||
// UASTC HDR 4x4
|
||||
bool_param<false> m_hdr_favor_astc;
|
||||
|
||||
// XUASTC LDR 4x4-12x12 specific options
|
||||
param<int> m_xuastc_ldr_effort_level;
|
||||
bool_param<false> m_xuastc_ldr_use_dct; // set the DCT quality above using m_quality_level, [1,100]
|
||||
bool_param<false> m_xuastc_ldr_use_lossy_supercompression; // allows the compressor to introduce a bounded amount of distortion if doing so would make smaller files (actually ASTC or XUASTC)
|
||||
bool_param<false> m_xuastc_ldr_force_disable_subsets; // disable 2-3 subset usage in all effort levels, faster encoding, faster transcoding to BC7, but lower quality)
|
||||
bool_param<false> m_xuastc_ldr_force_disable_rgb_dual_plane; // disable RGB dual plane usage (still can use dual plane on alpha blocks), for faster transcoding to BC7 but lower quality
|
||||
param<int> m_xuastc_ldr_syntax; // favor faster decompression over ratio, default is basist::astc_ldr_t::xuastc_ldr_syntax::cFullZstd (fastest transcoding but lower ratio)
|
||||
uint32_t m_xuastc_ldr_channel_weights[4];
|
||||
bool_param<false> m_xuastc_ldr_blurring; // experimental, not recommended, very slow
|
||||
|
||||
// XUASTC Lossy supercompression PSNR threshold parameters
|
||||
param<float> m_ls_min_psnr, m_ls_min_alpha_psnr;
|
||||
param<float> m_ls_thresh_psnr, m_ls_thresh_alpha_psnr;
|
||||
param<float> m_ls_thresh_edge_psnr, m_ls_thresh_edge_alpha_psnr;
|
||||
|
||||
// Job pool, MUST not be nullptr;
|
||||
job_pool *m_pJob_pool;
|
||||
|
||||
// Returns the current format mode as set by set_format_mode() above.
|
||||
// Because of backwards API compatibility we don't use this directly yet, it's just here to aid the transition to the new API.
|
||||
basist::basis_tex_format get_format_mode() const { return m_format_mode; }
|
||||
|
||||
private:
|
||||
// This is set by set_format_mode() above. For backwards API compat we don't use it directly, it's just here to aid the transition to the new API.
|
||||
basist::basis_tex_format m_format_mode;
|
||||
};
|
||||
|
||||
// Important: basisu_encoder_init() MUST be called first before using this class.
|
||||
@@ -465,12 +779,13 @@ namespace basisu
|
||||
cECFailedValidating,
|
||||
cECFailedEncodeUASTC,
|
||||
cECFailedFrontEnd,
|
||||
cECFailedFontendExtract,
|
||||
cECFailedFrontendExtract,
|
||||
cECFailedBackend,
|
||||
cECFailedCreateBasisFile,
|
||||
cECFailedWritingOutput,
|
||||
cECFailedUASTCRDOPostProcess,
|
||||
cECFailedCreateKTX2File
|
||||
cECFailedCreateKTX2File,
|
||||
cECFailedInvalidParameters
|
||||
};
|
||||
|
||||
error_code process();
|
||||
@@ -483,8 +798,14 @@ namespace basisu
|
||||
|
||||
const basisu::vector<image_stats> &get_stats() const { return m_stats; }
|
||||
|
||||
uint32_t get_basis_file_size() const { return m_basis_file_size; }
|
||||
// Sum of all slice orig pixels. Intended for statistics display.
|
||||
uint64_t get_total_slice_orig_texels() const { return m_total_slice_orig_texels; }
|
||||
|
||||
uint64_t get_basis_file_size() const { return m_basis_file_size; }
|
||||
double get_basis_bits_per_texel() const { return m_basis_bits_per_texel; }
|
||||
|
||||
uint64_t get_ktx2_file_size() const { return m_ktx2_file_size; }
|
||||
double get_ktx2_bits_per_texel() const { return m_ktx2_bits_per_texel; }
|
||||
|
||||
bool get_any_source_image_has_alpha() const { return m_any_source_image_has_alpha; }
|
||||
|
||||
@@ -492,22 +813,39 @@ namespace basisu
|
||||
|
||||
private:
|
||||
basis_compressor_params m_params;
|
||||
|
||||
|
||||
opencl_context_ptr m_pOpenCL_context;
|
||||
|
||||
// the output mode/codec
|
||||
basist::basis_tex_format m_fmt_mode;
|
||||
|
||||
// the output mode/codec's block width/height
|
||||
uint32_t m_fmt_mode_block_width;
|
||||
uint32_t m_fmt_mode_block_height;
|
||||
|
||||
// Note these images are expanded if necessary (duplicating cols/rows) to account for block dimensions.
|
||||
basisu::vector<image> m_slice_images;
|
||||
basisu::vector<imagef> m_slice_images_hdr;
|
||||
|
||||
basisu::vector<image_stats> m_stats;
|
||||
|
||||
uint32_t m_basis_file_size;
|
||||
uint64_t m_total_slice_orig_texels;
|
||||
|
||||
uint64_t m_basis_file_size;
|
||||
double m_basis_bits_per_texel;
|
||||
|
||||
uint64_t m_ktx2_file_size;
|
||||
double m_ktx2_bits_per_texel;
|
||||
|
||||
basisu_backend_slice_desc_vec m_slice_descs;
|
||||
|
||||
uint32_t m_total_blocks;
|
||||
|
||||
basisu_frontend m_frontend;
|
||||
|
||||
// These are 4x4 blocks.
|
||||
pixel_block_vec m_source_blocks;
|
||||
pixel_block_hdr_vec m_source_blocks_hdr;
|
||||
|
||||
basisu::vector<gpu_image> m_frontend_output_textures;
|
||||
|
||||
@@ -518,34 +856,62 @@ namespace basisu
|
||||
|
||||
basisu_file m_basis_file;
|
||||
|
||||
basisu::vector<gpu_image> m_decoded_output_textures;
|
||||
basisu::vector<gpu_image> m_decoded_output_textures; // BC6H in HDR mode
|
||||
basisu::vector<image> m_decoded_output_textures_unpacked;
|
||||
|
||||
basisu::vector<gpu_image> m_decoded_output_textures_bc7;
|
||||
basisu::vector<image> m_decoded_output_textures_unpacked_bc7;
|
||||
|
||||
basisu::vector<imagef> m_decoded_output_textures_bc6h_hdr_unpacked; // BC6H in HDR mode
|
||||
|
||||
basisu::vector<gpu_image> m_decoded_output_textures_astc_hdr;
|
||||
basisu::vector<imagef> m_decoded_output_textures_astc_hdr_unpacked;
|
||||
|
||||
uint8_vec m_output_basis_file;
|
||||
uint8_vec m_output_ktx2_file;
|
||||
|
||||
basisu::vector<gpu_image> m_uastc_slice_textures;
|
||||
basisu_backend_output m_uastc_backend_output;
|
||||
|
||||
// The amount the HDR input has to be scaled up in case it had to be rescaled to fit into half floats.
|
||||
float m_hdr_image_scale;
|
||||
|
||||
// The upconversion multiplier used to load LDR images in HDR mode.
|
||||
float m_ldr_to_hdr_upconversion_nit_multiplier;
|
||||
|
||||
// True if any loaded source images were LDR and upconverted to HDR.
|
||||
bool m_upconverted_any_ldr_images;
|
||||
|
||||
bool m_any_source_image_has_alpha;
|
||||
|
||||
bool m_opencl_failed;
|
||||
|
||||
void check_for_hdr_inputs();
|
||||
bool sanity_check_input_params();
|
||||
void clean_hdr_image(imagef& src_img);
|
||||
bool read_dds_source_images();
|
||||
bool read_source_images();
|
||||
bool extract_source_blocks();
|
||||
bool process_frontend();
|
||||
bool extract_frontend_texture_data();
|
||||
bool process_backend();
|
||||
bool create_basis_file_and_transcode();
|
||||
bool write_hdr_debug_images(const char* pBasename, const imagef& img, uint32_t width, uint32_t height);
|
||||
bool write_output_files_and_compute_stats();
|
||||
error_code encode_slices_to_uastc();
|
||||
error_code encode_slices_to_astc_6x6_hdr();
|
||||
error_code encode_slices_to_uastc_4x4_hdr();
|
||||
error_code encode_slices_to_uastc_4x4_ldr();
|
||||
error_code encode_slices_to_xuastc_or_astc_ldr();
|
||||
bool generate_mipmaps(const imagef& img, basisu::vector<imagef>& mips, bool has_alpha);
|
||||
bool generate_mipmaps(const image &img, basisu::vector<image> &mips, bool has_alpha);
|
||||
bool validate_texture_type_constraints();
|
||||
bool validate_ktx2_constraints();
|
||||
void get_dfd(uint8_vec& dfd, const basist::ktx2_header& hdr);
|
||||
bool get_dfd(uint8_vec& dfd, const basist::ktx2_header& hdr);
|
||||
bool create_ktx2_file();
|
||||
bool pick_format_mode();
|
||||
|
||||
uint32_t get_block_width() const { return m_fmt_mode_block_width; }
|
||||
uint32_t get_block_height() const { return m_fmt_mode_block_height; }
|
||||
};
|
||||
|
||||
// Alternative simple C-style wrapper API around the basis_compressor class.
|
||||
@@ -558,11 +924,18 @@ namespace basisu
|
||||
// pImageRGBA: pointer to a 32-bpp RGBx or RGBA raster image, R first in memory, A last. Top scanline first in memory.
|
||||
// width/height/pitch_in_pixels: dimensions of pImageRGBA
|
||||
//
|
||||
// flags_and_quality: Combination of the above flags logically OR'd with the ETC1S or UASTC level, i.e. "cFlagSRGB | cFlagGenMipsClamp | cFlagThreaded | 128" or "cFlagSRGB | cFlagGenMipsClamp | cFlagUASTC | cFlagThreaded | cPackUASTCLevelDefault".
|
||||
// flags_and_quality: Combination of the above flags logically OR'd with the ETC1S or UASTC quality or effort level.
|
||||
// Note: basis_compress2() variants below accept the new-style "quality_level" (0-100) and "effort_level" (0-10) parameters instead of packing them into flags_and_quality.
|
||||
// In ETC1S mode, the lower 8-bits are the ETC1S quality level which ranges from [1,255] (higher=better quality/larger files)
|
||||
// In UASTC mode, the lower 8-bits are the UASTC pack level (see cPackUASTCLevelFastest, etc.). Fastest/lowest quality is 0, so be sure to set it correctly.
|
||||
// In UASTC LDR 4x4 mode, the lower 8-bits are the UASTC LDR/HDR pack or effort level (see cPackUASTCLevelFastest to cPackUASTCLevelVerySlow). Fastest/lowest quality is 0, so be sure to set it correctly. Valid values are [0,4] for both LDR/HDR.
|
||||
// In UASTC HDR 4x4 mode, the lower 8-bits are the codec's effort level. Valid range is [uastc_hdr_4x4_codec_options::cMinLevel, uastc_hdr_4x4_codec_options::cMaxLevel]. Higher=better quality, but slower.
|
||||
// In RDO ASTC HDR 6x6/UASTC HDR 6x6 mode, the lower 8-bits are the codec's effort level. Valid range is [0,astc_6x6_hdr::ASTC_HDR_6X6_MAX_USER_COMP_LEVEL]. Higher levels=better quality, but slower.
|
||||
// In XUASTC/ASTC LDR 4x4-12x12 mode, the lower 8-bits are the compressor's effort level from [0,10] (astc_ldr_t::EFFORT_LEVEL_MIN, astc_ldr_t::EFFORT_LEVEL_MAX).
|
||||
//
|
||||
// uastc_rdo_quality: Float UASTC RDO quality level (0=no change, higher values lower quality but increase compressibility, initially try .5-1.5)
|
||||
// float uastc_rdo_or_dct_quality:
|
||||
// UASTC LDR 4x4 RDO quality level: RDO lambda setting - 0=no change/highest quality. Higher values lower quality but increase compressibility, initially try .5-1.5.
|
||||
// RDO ASTC 6x6 HDR/UASTC 6x6 HDR: RDO lambda setting. 0=no change/highest quality. Higher values lower quality but increase compressibility, initially try 250-2000 (HDR) or 1000-10000 (LDR/SDR inputs upconverted to HDR).
|
||||
// In XUASTC/ASTC LDR 4x4-12x12 mode, this is the [1,100] weight grid DCT quality level.
|
||||
//
|
||||
// pSize: Returns the output data's compressed size in bytes
|
||||
//
|
||||
@@ -574,36 +947,117 @@ namespace basisu
|
||||
cFlagDebug = 1 << 10, // enable debug output
|
||||
|
||||
cFlagKTX2 = 1 << 11, // generate a KTX2 file
|
||||
cFlagKTX2UASTCSuperCompression = 1 << 12, // use KTX2 Zstd supercompression on UASTC files
|
||||
cFlagKTX2UASTCSuperCompression = 1 << 12, // use KTX2 Zstd supercompression on non-supercompressed formats that support it.
|
||||
|
||||
cFlagSRGB = 1 << 13, // input texture is sRGB, use perceptual colorspace metrics, also use sRGB filtering during mipmap gen, and also sets KTX2 output transfer func to sRGB
|
||||
cFlagGenMipsClamp = 1 << 14, // generate mipmaps with clamp addressing
|
||||
cFlagGenMipsWrap = 1 << 15, // generate mipmaps with wrap addressing
|
||||
cFlagSRGB = 1 << 13, // input texture is sRGB, use perceptual colorspace metrics, also use sRGB filtering during mipmap gen, and also sets KTX2/.basis output transfer func to sRGB
|
||||
cFlagGenMipsClamp = 1 << 14, // generate mipmaps with clamp addressing
|
||||
cFlagGenMipsWrap = 1 << 15, // generate mipmaps with wrap addressing
|
||||
|
||||
cFlagYFlip = 1 << 16, // flip source image on Y axis before compression
|
||||
cFlagYFlip = 1 << 16, // flip source image on Y axis before compression
|
||||
|
||||
cFlagUASTC = 1 << 17, // use UASTC compression vs. ETC1S
|
||||
cFlagUASTCRDO = 1 << 18 // use RDO postprocessing when generating UASTC files (must set uastc_rdo_quality to the quality scalar)
|
||||
// Note 11/18/2025: cFlagUASTCRDO flag is now ignored. Now if uastc_rdo_or_dct_quality>0 in UASTC LDR 4x4 mode, you automatically get RDO.
|
||||
//cFlagUASTCRDO = 1 << 17, // use RDO postprocessing when generating UASTC LDR 4x4 files (must set uastc_rdo_or_dct_quality to the quality scalar)
|
||||
|
||||
cFlagPrintStats = 1 << 18, // print image stats to stdout
|
||||
cFlagPrintStatus = 1 << 19, // print status to stdout
|
||||
|
||||
cFlagDebugImages = 1 << 20, // enable debug image generation (for development, slower)
|
||||
|
||||
cFlagREC2020 = 1 << 21, // treat input as REC 2020 vs. the default 709 (for codecs that support this, currently UASTC HDR and ASTC 6x6), bit is always placed into KTX2 DFD
|
||||
|
||||
cFlagValidateOutput = 1 << 22, // transcode the output after encoding for testing
|
||||
|
||||
// XUASTC LDR profile: full arith, hybrid or full zstd (see basist::astc_ldr_t::xuastc_ldr_syntax)
|
||||
cFlagXUASTCLDRSyntaxFullArith = 0 << 23,
|
||||
cFlagXUASTCLDRSyntaxHybrid = 1 << 23,
|
||||
cFlagXUASTCLDRSyntaxFullZStd = 2 << 23,
|
||||
|
||||
cFlagXUASTCLDRSyntaxShift = 23,
|
||||
cFlagXUASTCLDRSyntaxMask = 3,
|
||||
|
||||
// Texture Type: 2D, 2D Array, Cubemap Array, or Texture Video (see enum basis_texture_type). Defaults to plain 2D.
|
||||
cFlagTextureType2D = 0 << 25,
|
||||
cFlagTextureType2DArray = 1 << 25,
|
||||
cFlagTextureTypeCubemapArray = 2 << 25,
|
||||
cFlagTextureTypeVideoFrames = 3 << 25,
|
||||
|
||||
cFlagTextureTypeShift = 25,
|
||||
cFlagTextureTypeMask = 3,
|
||||
};
|
||||
|
||||
void* basis_compress_internal(
|
||||
basist::basis_tex_format mode,
|
||||
const basisu::vector<image>* pSource_images,
|
||||
const basisu::vector<imagef>* pSource_images_hdr,
|
||||
uint32_t flags_and_quality, float uastc_rdo_or_dct_quality,
|
||||
size_t* pSize,
|
||||
image_stats* pStats,
|
||||
int quality_level = -1, int effort_level = -1);
|
||||
|
||||
// This function accepts an array of source images.
|
||||
// If more than one image is provided, it's assumed the images form a mipmap pyramid and automatic mipmap generation is disabled.
|
||||
// Returns a pointer to the compressed .basis or .ktx2 file data. *pSize is the size of the compressed data.
|
||||
// Important: The returned block MUST be manually freed using basis_free_data().
|
||||
// basisu_encoder_init() MUST be called first!
|
||||
// LDR version.
|
||||
void* basis_compress(
|
||||
basist::basis_tex_format mode,
|
||||
const basisu::vector<image> &source_images,
|
||||
uint32_t flags_and_quality, float uastc_rdo_quality,
|
||||
uint32_t flags_and_quality, float uastc_rdo_or_dct_quality,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
// This function only accepts a single source image.
|
||||
// HDR-only version.
|
||||
// Important: The returned block MUST be manually freed using basis_free_data().
|
||||
void* basis_compress(
|
||||
basist::basis_tex_format mode,
|
||||
const basisu::vector<imagef>& source_images_hdr,
|
||||
uint32_t flags_and_quality, float uastc_rdo_or_dct_quality,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
// This function only accepts a single LDR source image. It's just a wrapper for basis_compress() above.
|
||||
// Important: The returned block MUST be manually freed using basis_free_data().
|
||||
void* basis_compress(
|
||||
basist::basis_tex_format mode,
|
||||
const uint8_t* pImageRGBA, uint32_t width, uint32_t height, uint32_t pitch_in_pixels,
|
||||
uint32_t flags_and_quality, float uastc_rdo_quality,
|
||||
uint32_t flags_and_quality, float uastc_rdo_or_dct_quality,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
// basis_compress2() variants accept the new unified quality_level and effort_level parameters instead of the old flags/float uastc_rdo_or_dct_quality parameter.
|
||||
// quality_level must be [0,100], effort_level [0,10].
|
||||
void* basis_compress2(
|
||||
basist::basis_tex_format mode,
|
||||
const basisu::vector<image>& source_images,
|
||||
uint32_t flags_and_quality, int quality_level, int effort_level,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
void* basis_compress2(
|
||||
basist::basis_tex_format mode,
|
||||
const basisu::vector<imagef>& source_images_hdr,
|
||||
uint32_t flags_and_quality, int quality_level, int effort_level,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
void* basis_compress2(
|
||||
basist::basis_tex_format mode,
|
||||
const uint8_t* pImageRGBA, uint32_t width, uint32_t height, uint32_t pitch_in_pixels,
|
||||
uint32_t flags_and_quality, int quality_level, int effort_level,
|
||||
size_t* pSize,
|
||||
image_stats* pStats = nullptr);
|
||||
|
||||
// Frees the dynamically allocated file data returned by basis_compress().
|
||||
// This MUST be called on the pointer returned by basis_compress() when you're done with it.
|
||||
void basis_free_data(void* p);
|
||||
|
||||
// Runs a short benchmark using synthetic image data to time OpenCL encoding vs. CPU encoding, with multithreading enabled.
|
||||
// Returns true if opencl is worth using on this system, otherwise false.
|
||||
// If pOpenCL_failed is not null, it will be set to true if OpenCL encoding failed *on this particular machine/driver/BasisU version* and the encoder falled back to CPU encoding.
|
||||
// basisu_encoder_init() MUST be called first. If OpenCL support wasn't enabled this always returns false.
|
||||
bool basis_benchmark_etc1s_opencl(bool *pOpenCL_failed = nullptr);
|
||||
|
||||
// Parallel compression API
|
||||
struct parallel_results
|
||||
{
|
||||
|
||||
+2721
-103
File diff suppressed because it is too large
Load Diff
+1177
-233
File diff suppressed because it is too large
Load Diff
+10
-6
@@ -1,5 +1,5 @@
|
||||
// basis_etc.cpp
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2026 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -811,7 +811,8 @@ namespace basisu
|
||||
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
{
|
||||
// sanity check the returned error
|
||||
// Ultimate sanity check on the returned error.
|
||||
// If this check fails, it likely means the SSE code diverged from C++ somehow, or there was an overflow somewhere.
|
||||
color_rgba block_colors[4];
|
||||
m_best_solution.m_coords.get_block_colors(block_colors);
|
||||
|
||||
@@ -826,7 +827,7 @@ namespace basisu
|
||||
|
||||
for (uint32_t i = 0; i < n; i++)
|
||||
actual_error += color_distance(perceptual, pSrc_pixels[i], block_colors[pSelectors[i]], false);
|
||||
|
||||
|
||||
assert(actual_error == m_best_solution.m_error);
|
||||
}
|
||||
#endif
|
||||
@@ -1071,7 +1072,7 @@ namespace basisu
|
||||
bool etc1_optimizer::check_for_redundant_solution(const etc1_solution_coordinates& coords)
|
||||
{
|
||||
// Hash first 3 bytes of color (RGB)
|
||||
uint32_t kh = hash_hsieh((uint8_t*)&coords.m_unscaled_color.r, 3);
|
||||
uint32_t kh = basist::hash_hsieh((uint8_t*)&coords.m_unscaled_color.r, 3);
|
||||
|
||||
uint32_t h0 = kh & cSolutionsTriedHashMask;
|
||||
uint32_t h1 = (kh >> cSolutionsTriedHashBits) & cSolutionsTriedHashMask;
|
||||
@@ -1177,7 +1178,7 @@ namespace basisu
|
||||
uint64_t total_error = 0;
|
||||
|
||||
const color_rgba* pSrc_pixels = m_pParams->m_pSrc_pixels;
|
||||
|
||||
|
||||
if (!g_cpu_supports_sse41)
|
||||
{
|
||||
for (uint32_t c = 0; c < n; c++)
|
||||
@@ -1234,6 +1235,9 @@ namespace basisu
|
||||
perceptual_distance_rgb_4_N_sse41((int64_t*)&total_error, pSelectors_to_use, block_colors, pSrc_pixels, n, trial_solution.m_error);
|
||||
else
|
||||
linear_distance_rgb_4_N_sse41((int64_t*)&total_error, pSelectors_to_use, block_colors, pSrc_pixels, n, trial_solution.m_error);
|
||||
|
||||
for (uint32_t i = 0; i < n; i++)
|
||||
m_temp_selectors[i] = pSelectors_to_use[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1255,7 +1259,7 @@ namespace basisu
|
||||
}
|
||||
trial_solution.m_coords.m_unscaled_color = coords.m_unscaled_color;
|
||||
trial_solution.m_coords.m_color4 = m_pParams->m_use_color4;
|
||||
|
||||
|
||||
#if BASISU_DEBUG_ETC_ENCODER_DEEPER
|
||||
printf("Eval done: %u error: %I64u best error so far: %I64u\n", (trial_solution.m_error < pBest_solution->m_error), trial_solution.m_error, pBest_solution->m_error);
|
||||
#endif
|
||||
|
||||
+14
-14
@@ -1,5 +1,5 @@
|
||||
// basis_etc.h
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2024 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -76,7 +76,7 @@ namespace basisu
|
||||
// 000 001 010 011 100 101 110 111
|
||||
// 0 1 2 3 -4 -3 -2 -1
|
||||
};
|
||||
|
||||
|
||||
extern const int g_etc1_inten_tables[cETC1IntenModifierValues][cETC1SelectorValues];
|
||||
extern const uint8_t g_etc1_to_selector_index[cETC1SelectorValues];
|
||||
extern const uint8_t g_selector_index_to_etc1[cETC1SelectorValues];
|
||||
@@ -92,7 +92,7 @@ namespace basisu
|
||||
{
|
||||
// big endian uint64:
|
||||
// bit ofs: 56 48 40 32 24 16 8 0
|
||||
// byte ofs: b0, b1, b2, b3, b4, b5, b6, b7
|
||||
// byte ofs: b0, b1, b2, b3, b4, b5, b6, b7
|
||||
union
|
||||
{
|
||||
uint64_t m_uint64;
|
||||
@@ -275,7 +275,7 @@ namespace basisu
|
||||
|
||||
const uint32_t byte_bit_ofs = bit_index & 7;
|
||||
const uint32_t mask = 1 << byte_bit_ofs;
|
||||
|
||||
|
||||
const uint32_t lsb = etc1_val & 1;
|
||||
const uint32_t msb = etc1_val >> 1;
|
||||
|
||||
@@ -510,7 +510,7 @@ namespace basisu
|
||||
b.r = (base5_color.r << 3U) | (base5_color.r >> 2U);
|
||||
b.g = (base5_color.g << 3U) | (base5_color.g >> 2U);
|
||||
b.b = (base5_color.b << 3U) | (base5_color.b >> 2U);
|
||||
|
||||
|
||||
const int* pInten_table = g_etc1_inten_tables[inten_table];
|
||||
|
||||
pBlock_colors[0].set(clamp255(b.r + pInten_table[0]), clamp255(b.g + pInten_table[0]), clamp255(b.b + pInten_table[0]), 255);
|
||||
@@ -646,7 +646,7 @@ namespace basisu
|
||||
void set_block_color5_etc1s(const color_rgba &c_unscaled)
|
||||
{
|
||||
set_diff_bit(true);
|
||||
|
||||
|
||||
set_base5_color(pack_color5(c_unscaled, false));
|
||||
set_delta3_color(pack_delta3(0, 0, 0));
|
||||
}
|
||||
@@ -679,11 +679,11 @@ namespace basisu
|
||||
int dr = c1_unscaled.r - c0_unscaled.r;
|
||||
int dg = c1_unscaled.g - c0_unscaled.g;
|
||||
int db = c1_unscaled.b - c0_unscaled.b;
|
||||
|
||||
|
||||
dr = clamp<int>(dr, cETC1ColorDeltaMin, cETC1ColorDeltaMax);
|
||||
dg = clamp<int>(dg, cETC1ColorDeltaMin, cETC1ColorDeltaMax);
|
||||
db = clamp<int>(db, cETC1ColorDeltaMin, cETC1ColorDeltaMax);
|
||||
|
||||
|
||||
set_delta3_color(pack_delta3(dr, dg, db));
|
||||
|
||||
return true;
|
||||
@@ -785,12 +785,12 @@ namespace basisu
|
||||
return static_cast<uint8_t>(x);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
typedef basisu::vector<etc_block> etc_block_vec;
|
||||
|
||||
// Returns false if the unpack fails (could be bogus data or ETC2)
|
||||
bool unpack_etc1(const etc_block& block, color_rgba *pDst, bool preserve_alpha = false);
|
||||
|
||||
|
||||
enum basis_etc_quality
|
||||
{
|
||||
cETCQualityFast,
|
||||
@@ -1077,13 +1077,13 @@ namespace basisu
|
||||
|
||||
enum { cSolutionsTriedHashBits = 10, cTotalSolutionsTriedHashSize = 1 << cSolutionsTriedHashBits, cSolutionsTriedHashMask = cTotalSolutionsTriedHashSize - 1 };
|
||||
uint8_t m_solutions_tried[cTotalSolutionsTriedHashSize / 8];
|
||||
|
||||
|
||||
void get_nearby_inten_tables(uint32_t idx, int &first_inten_table, int &last_inten_table)
|
||||
{
|
||||
first_inten_table = maximum<int>(idx - 1, 0);
|
||||
last_inten_table = minimum<int>(cETC1IntenModifierValues, idx + 1);
|
||||
}
|
||||
|
||||
|
||||
bool check_for_redundant_solution(const etc1_solution_coordinates& coords);
|
||||
bool evaluate_solution_slow(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution);
|
||||
bool evaluate_solution_fast(const etc1_solution_coordinates& coords, potential_solution& trial_solution, potential_solution* pBest_solution);
|
||||
@@ -1105,7 +1105,7 @@ namespace basisu
|
||||
{
|
||||
etc1_optimizer m_optimizer;
|
||||
};
|
||||
|
||||
|
||||
void pack_etc1_solid_color_init();
|
||||
uint64_t pack_etc1_block_solid_color(etc_block& block, const uint8_t* pColor);
|
||||
|
||||
@@ -1177,5 +1177,5 @@ namespace basisu
|
||||
|
||||
uint64_t pack_eac_a8(pack_eac_a8_results& results, const uint8_t* pPixels, uint32_t num_pixels, uint32_t base_search_rad, uint32_t mul_search_rad, uint32_t table_mask = UINT32_MAX);
|
||||
void pack_eac_a8(eac_a8_block* pBlock, const uint8_t* pPixels, uint32_t base_search_rad, uint32_t mul_search_rad, uint32_t table_mask = UINT32_MAX);
|
||||
|
||||
|
||||
} // namespace basisu
|
||||
|
||||
+31
-109
@@ -1,5 +1,5 @@
|
||||
// basisu_frontend.cpp
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2026 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -353,9 +353,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -388,15 +386,11 @@ namespace basisu
|
||||
m_block_selector_cluster_index[block_index] = best_index;
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
m_encoded_blocks.resize(m_total_blocks);
|
||||
for (uint32_t block_index = 0; block_index < m_total_blocks; block_index++)
|
||||
@@ -425,9 +419,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index, pass] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -475,15 +467,11 @@ namespace basisu
|
||||
|
||||
} // block_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
m_endpoint_clusters.resize(0);
|
||||
m_endpoint_clusters.resize(endpoints.size());
|
||||
@@ -501,15 +489,14 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
const uint32_t block_endpoint_index = m_block_endpoint_clusters_indices[block_index][0];
|
||||
|
||||
etc_block trial_blk;
|
||||
clear_obj(trial_blk);
|
||||
trial_blk.set_block_color5_etc1s(m_endpoint_cluster_etc_params[block_endpoint_index].m_color_unscaled[0]);
|
||||
trial_blk.set_inten_tables_etc1s(m_endpoint_cluster_etc_params[block_endpoint_index].m_inten_table[0]);
|
||||
trial_blk.set_flip_bit(true);
|
||||
@@ -535,15 +522,11 @@ namespace basisu
|
||||
m_block_selector_cluster_index[block_index] = best_index;
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
m_encoded_blocks.resize(m_total_blocks);
|
||||
for (uint32_t block_index = 0; block_index < m_total_blocks; block_index++)
|
||||
@@ -573,7 +556,7 @@ namespace basisu
|
||||
debug_printf("introduce_special_selector_clusters\n");
|
||||
|
||||
uint32_t total_blocks_relocated = 0;
|
||||
const uint32_t initial_selector_clusters = (uint32_t)m_selector_cluster_block_indices.size();
|
||||
const uint32_t initial_selector_clusters = m_selector_cluster_block_indices.size_u32();
|
||||
|
||||
bool_vec block_relocated_flags(m_total_blocks);
|
||||
|
||||
@@ -595,7 +578,7 @@ namespace basisu
|
||||
|
||||
debug_printf("Introducing sel %u\n", sel);
|
||||
|
||||
const uint32_t new_selector_cluster_index = (uint32_t)m_optimized_cluster_selectors.size();
|
||||
const uint32_t new_selector_cluster_index = m_optimized_cluster_selectors.size_u32();
|
||||
|
||||
m_optimized_cluster_selectors.push_back(blk);
|
||||
|
||||
@@ -675,7 +658,7 @@ namespace basisu
|
||||
{
|
||||
debug_printf("optimize_selector_codebook\n");
|
||||
|
||||
const uint32_t orig_total_selector_clusters = (uint32_t)m_optimized_cluster_selectors.size();
|
||||
const uint32_t orig_total_selector_clusters = m_optimized_cluster_selectors.size_u32();
|
||||
|
||||
bool_vec selector_cluster_was_used(m_optimized_cluster_selectors.size());
|
||||
for (uint32_t i = 0; i < m_total_blocks; i++)
|
||||
@@ -765,7 +748,7 @@ namespace basisu
|
||||
total_perms = 4;
|
||||
else if (m_params.m_compression_level == 1)
|
||||
total_perms = 16;
|
||||
else if (m_params.m_compression_level == BASISU_MAX_COMPRESSION_LEVEL)
|
||||
else if (m_params.m_compression_level == BASISU_MAX_ETC1S_COMPRESSION_LEVEL)
|
||||
total_perms = OPENCL_ENCODE_ETC1S_MAX_PERMS;
|
||||
|
||||
bool status = opencl_encode_etc1s_blocks(m_params.m_pOpenCL_context, m_etc1_blocks_etc1s.data(), m_params.m_perceptual, total_perms);
|
||||
@@ -787,9 +770,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -803,7 +784,7 @@ namespace basisu
|
||||
optimizer_params.m_quality = cETCQualityFast;
|
||||
else if (m_params.m_compression_level == 1)
|
||||
optimizer_params.m_quality = cETCQualityMedium;
|
||||
else if (m_params.m_compression_level == BASISU_MAX_COMPRESSION_LEVEL)
|
||||
else if (m_params.m_compression_level == BASISU_MAX_ETC1S_COMPRESSION_LEVEL)
|
||||
optimizer_params.m_quality = cETCQualityUber;
|
||||
|
||||
optimizer_params.m_num_src_pixels = 16;
|
||||
@@ -830,15 +811,11 @@ namespace basisu
|
||||
blk.set_selector(x, y, selectors[x + y * 4]);
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
} // use_cpu
|
||||
|
||||
@@ -859,9 +836,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job( [this, first_index, last_index, &training_vecs] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -883,15 +858,11 @@ namespace basisu
|
||||
|
||||
} // block_index;
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
} );
|
||||
#endif
|
||||
|
||||
} // block_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
}
|
||||
|
||||
void basisu_frontend::generate_endpoint_clusters()
|
||||
@@ -900,7 +871,7 @@ namespace basisu
|
||||
|
||||
const uint32_t parent_codebook_size = (m_params.m_max_endpoint_clusters >= 256) ? BASISU_ENDPOINT_PARENT_CODEBOOK_SIZE : 0;
|
||||
uint32_t max_threads = 0;
|
||||
max_threads = m_params.m_multithreaded ? minimum<int>(std::thread::hardware_concurrency(), cMaxCodebookCreationThreads) : 0;
|
||||
max_threads = m_params.m_multithreaded ? minimum<int>(get_num_hardware_threads(), cMaxCodebookCreationThreads) : 0;
|
||||
if (m_params.m_pJob_pool)
|
||||
max_threads = minimum<int>((int)m_params.m_pJob_pool->get_total_threads(), max_threads);
|
||||
|
||||
@@ -970,7 +941,7 @@ namespace basisu
|
||||
}
|
||||
|
||||
if (m_params.m_debug_stats)
|
||||
debug_printf("Total endpoint clusters: %u, parent clusters: %u\n", (uint32_t)m_endpoint_clusters.size(), (uint32_t)m_endpoint_parent_clusters.size());
|
||||
debug_printf("Total endpoint clusters: %u, parent clusters: %u\n", m_endpoint_clusters.size_u32(), m_endpoint_parent_clusters.size_u32());
|
||||
}
|
||||
|
||||
// Iterate through each array of endpoint cluster block indices and set the m_block_endpoint_clusters_indices[][] array to indicaste which cluster index each block uses.
|
||||
@@ -1040,11 +1011,9 @@ namespace basisu
|
||||
for (uint32_t cluster_index_iter = 0; cluster_index_iter < m_endpoint_clusters.size(); cluster_index_iter += N)
|
||||
{
|
||||
const uint32_t first_index = cluster_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>((uint32_t)m_endpoint_clusters.size(), cluster_index_iter + N);
|
||||
const uint32_t last_index = minimum<uint32_t>(m_endpoint_clusters.size_u32(), cluster_index_iter + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job( [this, first_index, last_index] {
|
||||
#endif
|
||||
|
||||
for (uint32_t cluster_index = first_index; cluster_index < last_index; cluster_index++)
|
||||
{
|
||||
@@ -1112,15 +1081,11 @@ namespace basisu
|
||||
}
|
||||
} // cluster_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
} );
|
||||
#endif
|
||||
|
||||
} // cluster_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
vector_sort(m_subblock_endpoint_quant_err_vec);
|
||||
}
|
||||
@@ -1131,19 +1096,19 @@ namespace basisu
|
||||
|
||||
generate_block_endpoint_clusters();
|
||||
|
||||
int num_new_endpoint_clusters = m_params.m_max_endpoint_clusters - (uint32_t)m_endpoint_clusters.size();
|
||||
int num_new_endpoint_clusters = m_params.m_max_endpoint_clusters - m_endpoint_clusters.size_u32();
|
||||
if (num_new_endpoint_clusters <= 0)
|
||||
return;
|
||||
|
||||
compute_endpoint_subblock_error_vec();
|
||||
|
||||
const uint32_t num_orig_endpoint_clusters = (uint32_t)m_endpoint_clusters.size();
|
||||
const uint32_t num_orig_endpoint_clusters = m_endpoint_clusters.size_u32();
|
||||
|
||||
std::unordered_set<uint32_t> training_vector_was_relocated;
|
||||
|
||||
uint_vec cluster_sizes(num_orig_endpoint_clusters);
|
||||
for (uint32_t i = 0; i < num_orig_endpoint_clusters; i++)
|
||||
cluster_sizes[i] = (uint32_t)m_endpoint_clusters[i].size();
|
||||
cluster_sizes[i] = m_endpoint_clusters[i].size_u32();
|
||||
|
||||
std::unordered_set<uint32_t> ignore_cluster;
|
||||
|
||||
@@ -1259,7 +1224,7 @@ namespace basisu
|
||||
// TODO: Get this working when step>0
|
||||
if (m_params.m_pOpenCL_context && !step)
|
||||
{
|
||||
const uint32_t total_clusters = m_endpoint_clusters.size();
|
||||
const uint32_t total_clusters = (uint32_t)m_endpoint_clusters.size();
|
||||
|
||||
basisu::vector<cl_pixel_cluster> pixel_clusters(total_clusters);
|
||||
|
||||
@@ -1342,7 +1307,7 @@ namespace basisu
|
||||
|
||||
} // cluster_indices_iter
|
||||
|
||||
uint32_t* pSorted = radix_sort(colors.size(), colors.data(), colors2.data(), 0, 3);
|
||||
uint32_t* pSorted = radix_sort((uint32_t)colors.size(), colors.data(), colors2.data(), 0, 3);
|
||||
|
||||
const uint64_t first_pixel_index = input_pixels.size();
|
||||
|
||||
@@ -1474,7 +1439,7 @@ namespace basisu
|
||||
uint32_t total_perms = 64;
|
||||
if (m_params.m_compression_level <= 1)
|
||||
total_perms = 16;
|
||||
else if (m_params.m_compression_level == BASISU_MAX_COMPRESSION_LEVEL)
|
||||
else if (m_params.m_compression_level == BASISU_MAX_ETC1S_COMPRESSION_LEVEL)
|
||||
total_perms = OPENCL_ENCODE_ETC1S_MAX_PERMS;
|
||||
|
||||
basisu::vector<etc_block> output_blocks(total_clusters);
|
||||
@@ -1522,9 +1487,7 @@ namespace basisu
|
||||
const uint32_t first_index = cluster_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>((uint32_t)m_endpoint_clusters.size(), cluster_index_iter + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index, step] {
|
||||
#endif
|
||||
|
||||
for (uint32_t cluster_index = first_index; cluster_index < last_index; cluster_index++)
|
||||
{
|
||||
@@ -1556,7 +1519,7 @@ namespace basisu
|
||||
|
||||
{
|
||||
etc1_optimizer optimizer;
|
||||
etc1_solution_coordinates solutions[2];
|
||||
//etc1_solution_coordinates solutions[2];
|
||||
|
||||
etc1_optimizer::params cluster_optimizer_params;
|
||||
cluster_optimizer_params.m_num_src_pixels = total_pixels;
|
||||
@@ -1567,7 +1530,7 @@ namespace basisu
|
||||
|
||||
if (m_params.m_compression_level <= 1)
|
||||
cluster_optimizer_params.m_quality = cETCQualityMedium;
|
||||
else if (m_params.m_compression_level == BASISU_MAX_COMPRESSION_LEVEL)
|
||||
else if (m_params.m_compression_level == BASISU_MAX_ETC1S_COMPRESSION_LEVEL)
|
||||
cluster_optimizer_params.m_quality = cETCQualityUber;
|
||||
|
||||
etc1_optimizer::results cluster_optimizer_results;
|
||||
@@ -1643,15 +1606,11 @@ namespace basisu
|
||||
|
||||
} // cluster_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
} // cluster_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
}
|
||||
|
||||
debug_printf("Elapsed time: %3.3f secs\n", tm.get_elapsed_secs());
|
||||
@@ -1726,14 +1685,14 @@ namespace basisu
|
||||
{
|
||||
// For the OpenCL kernel, we order the parent endpoint clusters by smallest to largest for efficiency.
|
||||
// We also prepare an array of block info structs that point into this new parent endpoint cluster array.
|
||||
const uint32_t total_parent_clusters = m_endpoint_clusters_within_each_parent_cluster.size();
|
||||
const uint32_t total_parent_clusters = (uint32_t)m_endpoint_clusters_within_each_parent_cluster.size();
|
||||
|
||||
basisu::vector<cl_block_info_struct> cl_block_info_structs(m_total_blocks);
|
||||
|
||||
// the size of each parent cluster, in total clusters
|
||||
uint_vec parent_cluster_sizes(total_parent_clusters);
|
||||
for (uint32_t i = 0; i < total_parent_clusters; i++)
|
||||
parent_cluster_sizes[i] = m_endpoint_clusters_within_each_parent_cluster[i].size();
|
||||
parent_cluster_sizes[i] = (uint32_t)m_endpoint_clusters_within_each_parent_cluster[i].size();
|
||||
|
||||
uint_vec first_parent_cluster_ofs(total_parent_clusters);
|
||||
uint32_t cur_ofs = 0;
|
||||
@@ -1818,9 +1777,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index, &best_cluster_indices, &block_clusters] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -1951,15 +1908,11 @@ namespace basisu
|
||||
|
||||
} // block_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
} // block_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
} // use_cpu
|
||||
|
||||
@@ -2104,9 +2057,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -2131,15 +2082,11 @@ namespace basisu
|
||||
|
||||
} // block_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
} // block_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
} // use_cpu
|
||||
|
||||
@@ -2204,9 +2151,7 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job( [this, first_index, last_index, &training_vecs] {
|
||||
#endif
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
{
|
||||
@@ -2233,15 +2178,11 @@ namespace basisu
|
||||
|
||||
} // block_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
} );
|
||||
#endif
|
||||
|
||||
} // block_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
vec16F_clusterizer selector_clusterizer;
|
||||
for (uint32_t i = 0; i < m_total_blocks; i++)
|
||||
@@ -2252,7 +2193,7 @@ namespace basisu
|
||||
debug_printf("Using selector parent codebook size %u\n", parent_codebook_size);
|
||||
|
||||
uint32_t max_threads = 0;
|
||||
max_threads = m_params.m_multithreaded ? minimum<int>(std::thread::hardware_concurrency(), cMaxCodebookCreationThreads) : 0;
|
||||
max_threads = m_params.m_multithreaded ? minimum<int>(get_num_hardware_threads(), cMaxCodebookCreationThreads) : 0;
|
||||
if (m_params.m_pJob_pool)
|
||||
max_threads = minimum<int>((int)m_params.m_pJob_pool->get_total_threads(), max_threads);
|
||||
|
||||
@@ -2328,8 +2269,6 @@ namespace basisu
|
||||
|
||||
m_optimized_cluster_selectors.resize(total_selector_clusters);
|
||||
|
||||
uint32_t total_clusters_processed = 0;
|
||||
|
||||
// For each selector codebook entry, and for each of the 4x4 selectors, determine which selector minimizes the error across all the blocks that use that quantized selector.
|
||||
const uint32_t N = 256;
|
||||
for (uint32_t cluster_index_iter = 0; cluster_index_iter < total_selector_clusters; cluster_index_iter += N)
|
||||
@@ -2337,9 +2276,7 @@ namespace basisu
|
||||
const uint32_t first_index = cluster_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>((uint32_t)total_selector_clusters, cluster_index_iter + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index, &total_clusters_processed, &total_selector_clusters] {
|
||||
#endif
|
||||
m_params.m_pJob_pool->add_job([this, first_index, last_index] {
|
||||
|
||||
for (uint32_t cluster_index = first_index; cluster_index < last_index; cluster_index++)
|
||||
{
|
||||
@@ -2349,6 +2286,7 @@ namespace basisu
|
||||
continue;
|
||||
|
||||
uint64_t overall_best_err = 0;
|
||||
(void)overall_best_err;
|
||||
|
||||
uint64_t total_err[4][4][4];
|
||||
clear_obj(total_err);
|
||||
@@ -2407,15 +2345,11 @@ namespace basisu
|
||||
|
||||
} // cluster_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
});
|
||||
#endif
|
||||
|
||||
} // cluster_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
debug_printf("Elapsed time: %3.3f secs\n", tm.get_elapsed_secs());
|
||||
|
||||
@@ -2507,7 +2441,7 @@ namespace basisu
|
||||
|
||||
if ((m_params.m_pOpenCL_context) && m_use_hierarchical_selector_codebooks)
|
||||
{
|
||||
const uint32_t num_parent_clusters = m_selector_clusters_within_each_parent_cluster.size();
|
||||
const uint32_t num_parent_clusters = m_selector_clusters_within_each_parent_cluster.size_u32();
|
||||
|
||||
basisu::vector<fosc_selector_struct> selector_structs;
|
||||
selector_structs.reserve(m_optimized_cluster_selectors.size());
|
||||
@@ -2535,7 +2469,7 @@ namespace basisu
|
||||
selector_cluster_indices.push_back(selector_cluster_index);
|
||||
}
|
||||
|
||||
cur_ofs += m_selector_clusters_within_each_parent_cluster[parent_index].size();
|
||||
cur_ofs += m_selector_clusters_within_each_parent_cluster[parent_index].size_u32();
|
||||
}
|
||||
|
||||
const uint32_t total_input_selectors = cur_ofs;
|
||||
@@ -2550,7 +2484,7 @@ namespace basisu
|
||||
|
||||
block_structs[i].m_etc_color5_inten.a = (uint8_t)blk.get_inten_table(0);
|
||||
block_structs[i].m_first_selector = parent_selector_cluster_offsets[parent_selector_cluster];
|
||||
block_structs[i].m_num_selectors = m_selector_clusters_within_each_parent_cluster[parent_selector_cluster].size();
|
||||
block_structs[i].m_num_selectors = m_selector_clusters_within_each_parent_cluster[parent_selector_cluster].size_u32();
|
||||
}
|
||||
|
||||
uint_vec output_selector_cluster_indices(m_total_blocks);
|
||||
@@ -2616,10 +2550,8 @@ namespace basisu
|
||||
const uint32_t first_index = block_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>(m_total_blocks, first_index + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job( [this, first_index, last_index, &unpacked_optimized_cluster_selectors] {
|
||||
#endif
|
||||
|
||||
|
||||
int prev_best_cluster_index = 0;
|
||||
|
||||
for (uint32_t block_index = first_index; block_index < last_index; block_index++)
|
||||
@@ -2757,15 +2689,11 @@ namespace basisu
|
||||
|
||||
} // block_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
} );
|
||||
#endif
|
||||
|
||||
} // block_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
for (uint32_t i = 0; i < m_selector_cluster_block_indices.size(); i++)
|
||||
{
|
||||
@@ -2863,7 +2791,7 @@ namespace basisu
|
||||
total_subblocks_examined += total_pixels / 8;
|
||||
|
||||
etc1_optimizer optimizer;
|
||||
etc1_solution_coordinates solutions[2];
|
||||
//etc1_solution_coordinates solutions[2];
|
||||
|
||||
etc1_optimizer::params cluster_optimizer_params;
|
||||
cluster_optimizer_params.m_num_src_pixels = total_pixels;
|
||||
@@ -3082,9 +3010,7 @@ namespace basisu
|
||||
const uint32_t first_index = cluster_index_iter;
|
||||
const uint32_t last_index = minimum<uint32_t>((uint32_t)new_endpoint_cluster_block_indices.size(), cluster_index_iter + N);
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->add_job( [this, first_index, last_index, &cluster_improved, &cluster_valid, &new_endpoint_cluster_block_indices, &pBlock_selector_indices ] {
|
||||
#endif
|
||||
|
||||
for (uint32_t cluster_index = first_index; cluster_index < last_index; cluster_index++)
|
||||
{
|
||||
@@ -3130,7 +3056,7 @@ namespace basisu
|
||||
|
||||
{
|
||||
etc1_optimizer optimizer;
|
||||
etc1_solution_coordinates solutions[2];
|
||||
//etc1_solution_coordinates solutions[2];
|
||||
|
||||
etc1_optimizer::params cluster_optimizer_params;
|
||||
cluster_optimizer_params.m_num_src_pixels = total_pixels;
|
||||
@@ -3140,7 +3066,7 @@ namespace basisu
|
||||
cluster_optimizer_params.m_perceptual = m_params.m_perceptual;
|
||||
cluster_optimizer_params.m_pForce_selectors = &force_selectors[0];
|
||||
|
||||
if (m_params.m_compression_level == BASISU_MAX_COMPRESSION_LEVEL)
|
||||
if (m_params.m_compression_level == BASISU_MAX_ETC1S_COMPRESSION_LEVEL)
|
||||
cluster_optimizer_params.m_quality = cETCQualityUber;
|
||||
else
|
||||
cluster_optimizer_params.m_quality = cETCQualitySlow;
|
||||
@@ -3174,15 +3100,11 @@ namespace basisu
|
||||
|
||||
} // cluster_index
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
} );
|
||||
#endif
|
||||
|
||||
} // cluster_index_iter
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
m_params.m_pJob_pool->wait_for_all();
|
||||
#endif
|
||||
|
||||
uint32_t total_unused_clusters = 0;
|
||||
uint32_t total_improved_clusters = 0;
|
||||
@@ -3455,7 +3377,7 @@ namespace basisu
|
||||
}
|
||||
|
||||
image img;
|
||||
g.unpack(img);
|
||||
g.unpack(img, false);
|
||||
|
||||
save_png(pFilename, img);
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
// basisu_frontend.h
|
||||
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2026 Binomial LLC. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -37,8 +37,10 @@ namespace basisu
|
||||
uint32_t &operator[] (uint32_t i) { assert(i < 2); return m_comps[i]; }
|
||||
};
|
||||
|
||||
const uint32_t BASISU_DEFAULT_COMPRESSION_LEVEL = 2;
|
||||
const uint32_t BASISU_MAX_COMPRESSION_LEVEL = 6;
|
||||
// rg [11/25/25] - The command line tool defaults to ETC1S level 1, but the API 2. Changing this breaks backwards compatibility for anyone using the API and our test suite.
|
||||
const uint32_t BASISU_DEFAULT_ETC1S_COMPRESSION_LEVEL = 2;
|
||||
|
||||
const uint32_t BASISU_MAX_ETC1S_COMPRESSION_LEVEL = 6;
|
||||
|
||||
class basisu_frontend
|
||||
{
|
||||
@@ -72,7 +74,7 @@ namespace basisu
|
||||
m_pSource_blocks(NULL),
|
||||
m_max_endpoint_clusters(256),
|
||||
m_max_selector_clusters(256),
|
||||
m_compression_level(BASISU_DEFAULT_COMPRESSION_LEVEL),
|
||||
m_compression_level(BASISU_DEFAULT_ETC1S_COMPRESSION_LEVEL),
|
||||
m_perceptual(true),
|
||||
m_debug_stats(false),
|
||||
m_debug_images(false),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user