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 <brecht@blender.org>2021-02-14 16:20:51 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-02-17 18:26:24 +0300
commit859118d8f6ff022a16acbc6435488883424bad25 (patch)
treee0f708929a884070f7c3758f7fb58527cbdfd555 /source/blender/compositor
parentac680c569e1b979f20c2e81dbd4f232085141aad (diff)
BLI: add BLI_simd.h header to wrap SSE includes
In preparation of adding Neon support. Ref D8237, T78710
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp10
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp10
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.h2
6 files changed, 15 insertions, 17 deletions
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index 3fe154c397e..612a71037f7 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -88,7 +88,7 @@ float *BlurBaseOperation::make_gausstab(float rad, int size)
return gausstab;
}
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 *BlurBaseOperation::convert_gausstab_sse(const float *gausstab, int size)
{
int n = 2 * size + 1;
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h
index c452b2e4ea1..56dacc96710 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.h
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h
@@ -23,16 +23,14 @@
#define MAX_GAUSSTAB_RADIUS 30000
-#ifdef __SSE2__
-# include <emmintrin.h>
-#endif
+#include "BLI_simd.h"
class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
private:
protected:
BlurBaseOperation(DataType data_type);
float *make_gausstab(float rad, int size);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 *convert_gausstab_sse(const float *gausstab, int size);
#endif
float *make_dist_fac_inverse(float rad, int size, int falloff);
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
index e08d30e5ddf..90333f7dd79 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
@@ -26,7 +26,7 @@
GaussianXBlurOperation::GaussianXBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
{
this->m_gausstab = nullptr;
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = nullptr;
#endif
this->m_filtersize = 0;
@@ -55,7 +55,7 @@ void GaussianXBlurOperation::initExecution()
/* TODO(sergey): De-duplicate with the case below and Y blur. */
this->m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = BlurBaseOperation::convert_gausstab_sse(this->m_gausstab, m_filtersize);
#endif
}
@@ -70,7 +70,7 @@ void GaussianXBlurOperation::updateGauss()
m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS);
this->m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = BlurBaseOperation::convert_gausstab_sse(this->m_gausstab, m_filtersize);
#endif
}
@@ -95,7 +95,7 @@ void GaussianXBlurOperation::executePixel(float output[4], int x, int y, void *d
int offsetadd = getOffsetAdd();
int bufferindex = ((xmin - bufferstartx) * 4) + ((ymin - bufferstarty) * 4 * bufferwidth);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 accum_r = _mm_load_ps(color_accum);
for (int nx = xmin, index = (xmin - x) + this->m_filtersize; nx < xmax;
nx += step, index += step) {
@@ -162,7 +162,7 @@ void GaussianXBlurOperation::deinitExecution()
MEM_freeN(this->m_gausstab);
this->m_gausstab = nullptr;
}
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
if (this->m_gausstab_sse) {
MEM_freeN(this->m_gausstab_sse);
this->m_gausstab_sse = nullptr;
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
index 9348c05f906..b2bcd79e716 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
@@ -24,7 +24,7 @@
class GaussianXBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 *m_gausstab_sse;
#endif
int m_filtersize;
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
index 7710b065ccd..c5b3cf24239 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
@@ -26,7 +26,7 @@
GaussianYBlurOperation::GaussianYBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
{
this->m_gausstab = nullptr;
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = nullptr;
#endif
this->m_filtersize = 0;
@@ -54,7 +54,7 @@ void GaussianYBlurOperation::initExecution()
m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS);
this->m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = BlurBaseOperation::convert_gausstab_sse(this->m_gausstab, m_filtersize);
#endif
}
@@ -69,7 +69,7 @@ void GaussianYBlurOperation::updateGauss()
m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS);
this->m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
this->m_gausstab_sse = BlurBaseOperation::convert_gausstab_sse(this->m_gausstab, m_filtersize);
#endif
}
@@ -94,7 +94,7 @@ void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *d
int step = getStep();
const int bufferIndexx = ((xmin - bufferstartx) * 4);
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 accum_r = _mm_load_ps(color_accum);
for (int ny = ymin; ny < ymax; ny += step) {
index = (ny - y) + this->m_filtersize;
@@ -162,7 +162,7 @@ void GaussianYBlurOperation::deinitExecution()
MEM_freeN(this->m_gausstab);
this->m_gausstab = nullptr;
}
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
if (this->m_gausstab_sse) {
MEM_freeN(this->m_gausstab_sse);
this->m_gausstab_sse = nullptr;
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
index 7ab4ecb5506..d921780876a 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
@@ -24,7 +24,7 @@
class GaussianYBlurOperation : public BlurBaseOperation {
private:
float *m_gausstab;
-#ifdef __SSE2__
+#ifdef BLI_HAVE_SSE2
__m128 *m_gausstab_sse;
#endif
int m_filtersize;