Skip to content

Commit

Permalink
Fix Windows Clang issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sergcpp committed Nov 28, 2024
1 parent 29a3da5 commit 9273377
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float, Ray::aligned_allocator<float, 64>>;
template class std::vector<uint16_t>;
6 changes: 3 additions & 3 deletions internal/CDFUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Ray {
// This mostly taken from Cycles source code
template <typename Func> std::vector<float> CDFEvaluate(const int res, const float from, const float to, Func func) {
template <typename Func> inline std::vector<float> CDFEvaluate(const int res, const float from, const float to, Func func) {
const int cdf_count = res + 1;
const float range = to - from;

Expand All @@ -30,8 +30,8 @@ template <typename Func> std::vector<float> CDFEvaluate(const int res, const flo
std::vector<float> CDFInvert(int res, float from, float to, const std::vector<float> &cdf, bool make_symmetric);

template <typename Func>
std::vector<float> CDFInverted(const int res, const float from, const float to, Func func, const bool make_symmetric) {
std::vector<float> cdf = CDFEvaluate(res - 1, from, to, func);
inline std::vector<float> CDFInverted(const int res, const float from, const float to, Func func, const bool make_symmetric) {
const std::vector<float> cdf = CDFEvaluate(res - 1, from, to, func);
return CDFInvert(res, from, to, cdf, make_symmetric);
}
} // namespace Ray
4 changes: 2 additions & 2 deletions internal/TextureUtilsNEON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t *>(min_color), min_col, 0);
vst1q_lane_s32(reinterpret_cast<int32_t *>(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};
Expand Down

0 comments on commit 9273377

Please sign in to comment.