diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2017-11-09 16:38:17 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2017-11-09 16:38:17 +0300 |
commit | 83d9f8e37963e622fbd7d8c0902d077b67618f7b (patch) | |
tree | 6299a29bda1c72f719c60e47ce5b79de01e95c56 /source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | |
parent | 08a023d7cac24f97531220c953d225c7bfefbd01 (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/operations/COM_GaussianXBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | 7 |
1 files changed, 7 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; |