diff options
Diffstat (limited to 'NvCloth/src')
| -rw-r--r-- | NvCloth/src/SwSolver.cpp | 11 | ||||
| -rw-r--r-- | NvCloth/src/neon/NeonCollision.cpp | 2 | ||||
| -rw-r--r-- | NvCloth/src/neon/NeonSelfCollision.cpp | 2 | ||||
| -rw-r--r-- | NvCloth/src/neon/NeonSolverKernel.cpp | 11 |
4 files changed, 20 insertions, 6 deletions
diff --git a/NvCloth/src/SwSolver.cpp b/NvCloth/src/SwSolver.cpp index 356a03e..96dc1e2 100644 --- a/NvCloth/src/SwSolver.cpp +++ b/NvCloth/src/SwSolver.cpp @@ -301,11 +301,16 @@ void cloth::SwSolver::SimulatedCloth::Simulate() SwKernelAllocator allocator(mScratchMemory, uint32_t(mScratchMemorySize)); // construct kernel functor and execute -#if NV_ANDROID +#ifdef __ARM_NEON__ if (!neonSolverKernel(*mCloth, data, allocator, factory)) { - //NV_CLOTH_LOG_WARNING("No NEON CPU support detected. Falling back to scalar types."); - SwSolverKernel<Scalar4f>(*mCloth, data, allocator, factory)(); + #if NV_SIMD_SCALAR + //NV_CLOTH_LOG_WARNING("No NEON CPU support detected. Falling back to scalar types."); + SwSolverKernel<Scalar4f>(*mCloth, data, allocator, factory)(); + #else + NV_CLOTH_LOG_ERROR("Error creating NEON solver kernel."); + NV_CLOTH_ASSERT(0); + #endif } #else SwSolverKernel<Simd4fType>(*mCloth, data, allocator, factory)(); diff --git a/NvCloth/src/neon/NeonCollision.cpp b/NvCloth/src/neon/NeonCollision.cpp index fe45778..16269ac 100644 --- a/NvCloth/src/neon/NeonCollision.cpp +++ b/NvCloth/src/neon/NeonCollision.cpp @@ -31,4 +31,4 @@ #error This file needs to be compiled with NEON support! #endif -#include "SwCollision.cpp" +// SwCollision.cpp is compiled already using Neon implementation when Neon macros are found diff --git a/NvCloth/src/neon/NeonSelfCollision.cpp b/NvCloth/src/neon/NeonSelfCollision.cpp index 8faa407..3e7e96d 100644 --- a/NvCloth/src/neon/NeonSelfCollision.cpp +++ b/NvCloth/src/neon/NeonSelfCollision.cpp @@ -31,4 +31,4 @@ #error This file needs to be compiled with NEON support! #endif -#include "SwSelfCollision.cpp" +// SwSelfCollision.cpp is compiled already using Neon implementation when Neon macros are found diff --git a/NvCloth/src/neon/NeonSolverKernel.cpp b/NvCloth/src/neon/NeonSolverKernel.cpp index 6eb26cf..5e8dbd0 100644 --- a/NvCloth/src/neon/NeonSolverKernel.cpp +++ b/NvCloth/src/neon/NeonSolverKernel.cpp @@ -31,14 +31,23 @@ #error This file needs to be compiled with NEON support! #endif -#include "SwSolverKernel.cpp" +// SwSolverKernel.cpp is compiled already using Neon implementation when Neon macros are found +#include "SwSolverKernel.h" +// On Android armeabi-v7a (32-bits) NEON support is not guaranteed, so there must be an additional runtime check. +#if NV_ANDROID && defined __arm__ #include "../ps/android/cpu-features.h" namespace { const bool sNeonSupport = ANDROID_CPU_ARM_FEATURE_NEON & android_getCpuFeatures(); } +#else +namespace +{ + const bool sNeonSupport = true; +} +#endif namespace nv { |