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:
authorStefan Werner <stefan.werner@tangent-animation.com>2017-11-09 16:38:17 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2017-11-09 16:38:17 +0300
commit83d9f8e37963e622fbd7d8c0902d077b67618f7b (patch)
tree6299a29bda1c72f719c60e47ce5b79de01e95c56 /source/blender/compositor
parent08a023d7cac24f97531220c953d225c7bfefbd01 (diff)
Compositor: Ensured 16 byte alignment for variables accessed by SSE instructions.
Before this patch, the XBlur/YBlur compositor nodes would crash for me when run in a MSVC 2015 debug build (test scene: BMW27_cpu). I added the compiler instructions to explicitly align the local variables that the SSE instructions are accessing.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp7
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
index 29ed4334412..c413e94c173 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
@@ -85,6 +85,13 @@ void GaussianXBlurOperation::updateGauss()
void GaussianXBlurOperation::executePixel(float output[4], int x, int y, void *data)
{
+#ifdef __SSE2__
+# if defined(_WIN32) && !defined(FREE_WINDOWS)
+ __declspec(align(16))
+# else
+ __attribute__((aligned(16)))
+# endif
+#endif
float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float multiplier_accum = 0.0f;
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
index 4b55333c08c..5c8c6399981 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
@@ -84,6 +84,13 @@ void GaussianYBlurOperation::updateGauss()
void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *data)
{
+#ifdef __SSE2__
+# if defined(_WIN32) && !defined(FREE_WINDOWS)
+ __declspec(align(16))
+# else
+ __attribute__((aligned(16)))
+# endif
+#endif
float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float multiplier_accum = 0.0f;
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;