Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-01-18 23:06:35 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-01-19 13:35:07 +0300
commit0fe41009f095835bda961a67697b36cbc8cade49 (patch)
tree5ac5379e8fb889f2dc4754043c76dfe2ba90c5d5 /intern/cycles/util
parent889321e22b70006a550c923c0ace18e75732e106 (diff)
Fix T53830: Cycles OpenCL debug assert on macOS,
This was probably harmless besides some unnecessary memory usage due to aligning allocations too much.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_aligned_malloc.h3
-rw-r--r--intern/cycles/util/util_vector.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/util/util_aligned_malloc.h b/intern/cycles/util/util_aligned_malloc.h
index cf1e86ca916..66d77c83454 100644
--- a/intern/cycles/util/util_aligned_malloc.h
+++ b/intern/cycles/util/util_aligned_malloc.h
@@ -21,6 +21,9 @@
CCL_NAMESPACE_BEGIN
+/* Minimum alignment needed by all CPU native data types (SSE, AVX). */
+#define MIN_ALIGNMENT_CPU_DATA_TYPES 16
+
/* Allocate block of size bytes at least aligned to a given value. */
void *util_aligned_malloc(size_t size, int alignment);
diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h
index ca6b56c9c7e..67bf82b47a5 100644
--- a/intern/cycles/util/util_vector.h
+++ b/intern/cycles/util/util_vector.h
@@ -86,9 +86,9 @@ public:
* this was actually showing up in profiles quite significantly. it
* also does not run any constructors/destructors
* - if this is used, we are not tempted to use inefficient operations
- * - aligned allocation for SSE data types */
+ * - aligned allocation for CPU native data types */
-template<typename T, size_t alignment = 16>
+template<typename T, size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
class array
{
public: