new stuff

This commit is contained in:
Tarion 2026-07-03 03:41:25 +02:00
parent 8998bc3936
commit 64c8492e5c
No known key found for this signature in database
6907 changed files with 3401899 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# tinyusdz
"tinyusdz" C++ project provides USD/USDA/UDSC/UDSZ 3D model file format suport
## Automatic repo clone
tinyusdz repo is automatically cloned. Users who haven't opted-in to USD support
won't be burdened with the extra download volume.
To update the git commit hash pulled down, modify `TINYUSDZ_GIT_TAG` in file
`code/CMakeLists.txt`
## Notes
Couldn't leverage tinyusdz CMakeLists.txt. Fell back to compiling source files specified in
"android" example.

View file

@ -0,0 +1,57 @@
/**
* Usage
* Add line below all other #include statements:
* #include "../../../assimp_tinyusdz_logging.inc"
* to files:
* - contrib/tinyusdz/tinyusdz_repo/src/tydra/render-data.cc
* - contrib/tinyusdz/tinyusdz_repo/src/tydra/scene-access.cc
*/
#pragma once
#if defined(__ANDROID__)
#include <sstream>
#include <android/log.h>
#define TINYUSDZLOGT(tag, ...) ((void)__android_log_print(ANDROID_LOG_DEBUG, tag, __VA_ARGS__))
#define TINYUSDZLOG0(tag, ...) ((void)__android_log_print(ANDROID_LOG_DEFAULT, tag, __VA_ARGS__))
#define TINYUSDZLOGD(tag, ...) ((void)__android_log_print(ANDROID_LOG_DEBUG, tag, __VA_ARGS__))
#define TINYUSDZLOGI(tag, ...) ((void)__android_log_print(ANDROID_LOG_INFO, tag, __VA_ARGS__))
#define TINYUSDZLOGW(tag, ...) ((void)__android_log_print(ANDROID_LOG_WARN, tag, __VA_ARGS__))
#define TINYUSDZLOGE(tag, ...) ((void)__android_log_print(ANDROID_LOG_ERROR, tag, __VA_ARGS__))
#else
#define TINYUSDZLOGT(tag, ...)
#define TINYUSDZLOG0(tag, ...)
#define TINYUSDZLOGD(tag, ...)
#define TINYUSDZLOGI(tag, ...)
#define TINYUSDZLOGW(tag, ...)
#define TINYUSDZLOGE(tag, ...)
#endif // #if defined(__ANDROID__)
#if defined(TINYUSDZ_LOCAL_DEBUG_PRINT)
#if defined(__ANDROID__)
#if defined(ASSIMP_USD_VERBOSE_LOGS)
// Works well but _extremely_ verbose
#define DCOUT(x) \
do { \
std::stringstream ss; \
ss << __FILE__ << ":" << __func__ << ":" \
<< std::to_string(__LINE__) << " " << x << "\n"; \
TINYUSDZLOGE("tinyusdz", "%s", ss.str().c_str()); \
} while (false)
#else // defined(ASSIMP_USD_VERBOSE_LOGS)
// Silent version
#define DCOUT(x) \
do { \
std::stringstream ss; \
ss << __FILE__ << ":" << __func__ << ":" \
<< std::to_string(__LINE__) << " " << x << "\n"; \
} while (false)
#endif // defined(ASSIMP_USD_VERBOSE_LOGS)
#else // defined(__ANDROID__)
#define DCOUT(x) \
do { \
std::cout << __FILE__ << ":" << __func__ << ":" \
<< std::to_string(__LINE__) << " " << x << "\n"; \
} while (false)
#endif // #if defined(__ANDROID__)
#endif // #if defined(TINYUSDZ_LOCAL_DEBUG_PRINT)

View file

@ -0,0 +1,40 @@
# Tinyusdz patch files
Pending acceptance of proposed changes upstream, need to resort to patching to keep things moving
## Tinyusdz files needing patches
### `tinyusdz_repo/src/external/stb_image_resize2.h`
Without patch, build will fail for armeabi-v7a ABI via android NDK
Add `#elif` block as indicated below around line `2407`
```
#elif defined(STBIR_WASM) || (defined(STBIR_NEON) && defined(_MSC_VER) && defined(_M_ARM)) // WASM or 32-bit ARM on MSVC/clang
...
#elif defined(STBIR_NEON) && (defined(__ANDROID__) && defined(__arm__)) // 32-bit ARM on android NDK
static stbir__inline void stbir__half_to_float_SIMD(float * output, stbir__FP16 const * input)
{
// TODO: this stub is just to allow build on armeabi-v7a via android NDK
}
static stbir__inline void stbir__float_to_half_SIMD(stbir__FP16 * output, float const * input)
{
// TODO: this stub is just to allow build on armeabi-v7a via android NDK
}
static stbir__inline float stbir__half_to_float( stbir__FP16 h )
{
// TODO: this stub is just to allow build on armeabi-v7a via android NDK
return 0;
}
static stbir__inline stbir__FP16 stbir__float_to_half( float f )
{
// TODO: this stub is just to allow build on armeabi-v7a via android NDK
return 0;
}
#elif defined(STBIR_NEON) && defined(_MSC_VER) && defined(_M_ARM64) && !defined(__clang__) // 64-bit ARM on MSVC (not clang)
```

View file

@ -0,0 +1,42 @@
diff -rupN -x .git autoclone/tinyusdz_repo-src/src/external/stb_image_resize2.h tinyusdz_repo_patch/src/external/stb_image_resize2.h
--- autoclone/tinyusdz_repo-src/src/external/stb_image_resize2.h 2024-10-27 03:26:45.457163600 -0700
+++ tinyusdz_repo_patch/src/external/stb_image_resize2.h 2024-10-27 03:31:09.255211100 -0700
@@ -2500,6 +2500,38 @@ static stbir__inline stbir_uint8 stbir__
}
}
+#elif defined(STBIR_NEON) && (defined(__ANDROID__) && defined(__arm__)) // 32-bit ARM on android NDK
+
+ // TODO As of Apr 2024, tinyusdz doesn't support building on armeabi-v7a (32 bit arm) for android
+ // (falls through to arm64 block and build fails)
+ //
+ // For assimp integration, the image processing utilities aren't used at all, so it's safe to
+ // essentially replace the functions with dummy no-ops.
+ //
+ // This will need to be done manually whenever the tinyusdz source files are updated in assimp,
+ // as it seems unlikely this will be fixed in the tinyusdz project
+ static stbir__inline void stbir__half_to_float_SIMD(float * output, stbir__FP16 const * input)
+ {
+ // TODO: this stub is just to allow build on armeabi-v7a via android NDK
+ }
+
+ static stbir__inline void stbir__float_to_half_SIMD(stbir__FP16 * output, float const * input)
+ {
+ // TODO: this stub is just to allow build on armeabi-v7a via android NDK
+ }
+
+ static stbir__inline float stbir__half_to_float( stbir__FP16 h )
+ {
+ // TODO: this stub is just to allow build on armeabi-v7a via android NDK
+ return 0;
+ }
+
+ static stbir__inline stbir__FP16 stbir__float_to_half( float f )
+ {
+ // TODO: this stub is just to allow build on armeabi-v7a via android NDK
+ return 0;
+ }
+
#endif