Fix failing build on armeabi-v7a via android NDK

pull/5551/head
Steve M 2024-04-22 13:15:14 -07:00
parent e3aa6d6a97
commit b343d0f730
2 changed files with 68 additions and 0 deletions

View File

@ -1,5 +1,41 @@
# tinyusdz
## MODIFICATIONS REQUIRED
### Need to patch `contrib/tinyusdz/tinyusdz_repo/src/external/stb_image_resize2.h` to allow build on
armeabi-v7a 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)
```
## Notes
Couldn't leverage tinyusdz CMakeLists.txt. Fell back to compiling source files specified in
"android" example.

View File

@ -2404,6 +2404,38 @@ static stbir__inline stbir_uint8 stbir__linear_to_srgb_uchar(float in)
}
}
#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;
}
#elif defined(STBIR_NEON) && defined(_MSC_VER) && defined(_M_ARM64) && !defined(__clang__) // 64-bit ARM on MSVC (not clang)
static stbir__inline void stbir__half_to_float_SIMD(float * output, stbir__FP16 const * input)