diff --git a/Ray.cpp b/Ray.cpp index 1d89b48f..8d283359 100644 --- a/Ray.cpp +++ b/Ray.cpp @@ -142,5 +142,6 @@ bool Ray::MatchDeviceNames(const char *name, const char *pattern) { const char *Ray::Version() { return "v0.3.0-unknown-commit"; } -// Workaround for a strange clang behavior +// Workaround for identical template instantiations merging causing illegal instruction error with Windows Clang template class std::vector>; +template class std::vector; \ No newline at end of file diff --git a/internal/CDFUtils.h b/internal/CDFUtils.h index 152700a0..94e66303 100644 --- a/internal/CDFUtils.h +++ b/internal/CDFUtils.h @@ -6,7 +6,7 @@ namespace Ray { // This mostly taken from Cycles source code -template std::vector CDFEvaluate(const int res, const float from, const float to, Func func) { +template inline std::vector CDFEvaluate(const int res, const float from, const float to, Func func) { const int cdf_count = res + 1; const float range = to - from; @@ -30,8 +30,8 @@ template std::vector CDFEvaluate(const int res, const flo std::vector CDFInvert(int res, float from, float to, const std::vector &cdf, bool make_symmetric); template -std::vector CDFInverted(const int res, const float from, const float to, Func func, const bool make_symmetric) { - std::vector cdf = CDFEvaluate(res - 1, from, to, func); +inline std::vector CDFInverted(const int res, const float from, const float to, Func func, const bool make_symmetric) { + const std::vector cdf = CDFEvaluate(res - 1, from, to, func); return CDFInvert(res, from, to, cdf, make_symmetric); } } // namespace Ray diff --git a/internal/TextureUtilsNEON.cpp b/internal/TextureUtilsNEON.cpp index e0501a85..5158554d 100644 --- a/internal/TextureUtilsNEON.cpp +++ b/internal/TextureUtilsNEON.cpp @@ -301,8 +301,8 @@ void InsetYCoCgBBox_NEON(uint8_t min_color[4], uint8_t max_color[4]) { min_col = vcombine_u8(vqmovun_s16(min_col), vqmovun_s16(min_col)); max_col = vcombine_u8(vqmovun_s16(max_col), vqmovun_s16(max_col)); - vst1q_lane_s32(reinterpret_cast(min_color), min_col, 0); - vst1q_lane_s32(reinterpret_cast(max_color), max_col, 0); + vst1q_lane_u8(min_color, min_col, 0); + vst1q_lane_u8(max_color, max_col, 0); } alignas(16) static const int16_t CoCgMask[] = {-1, 0, -1, 0, -1, 0, -1, 0};