diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-05 20:25:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-05 20:46:06 +0300 |
commit | 88b72925d0ef59dc0d67df05f4ad74742175653c (patch) | |
tree | 20e13cd7be9c3c56c242da71b6e61e32e331619b /CMakeLists.txt | |
parent | bb6fbc64ae2bf4d1cba4a4b6f1831e6df58e2e6b (diff) |
Optimize linear<->sRGB conversion for SSE2 processors
Using SSE2 intrinsics when available for this kind of conversions.
It's not totally accurate, but accurate enough for the purposes where
we're using direct colorspace conversion by-passing OCIO.
Partially based on code from Cycles, partially based on other online
articles:
https://stackoverflow.com/questions/6475373/optimizations-for-pow-with-const-non-integer-exponent
Makes projection painting on hi-res float textures smoother.
This commit also enables global SSE2 in Blender. It shouldn't
bring any regressions in supported hardware (we require SSE2 since
2.64 now), but should keep an eye on because compilers might have
some bugs with that (unlikely, but possible).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 438cb1cdd9f..6fc4ca2729d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2357,17 +2357,17 @@ endif() # See TEST_SSE_SUPPORT() for how this is defined. -if(WITH_RAYOPTIMIZATION) - if(SUPPORT_SSE_BUILD) - set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}") - add_definitions(-D__SSE__ -D__MMX__) - endif() - if(SUPPORT_SSE2_BUILD) - set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}") - add_definitions(-D__SSE2__) - if(NOT SUPPORT_SSE_BUILD) # dont double up - add_definitions(-D__MMX__) - endif() +# Do it globally, SSE2 is required for quite some time now. +# Doing it now allows to use SSE/SSE2 in inline headers. +if(SUPPORT_SSE_BUILD) + set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}") + add_definitions(-D__SSE__ -D__MMX__) +endif() +if(SUPPORT_SSE2_BUILD) + set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}") + add_definitions(-D__SSE2__) + if(NOT SUPPORT_SSE_BUILD) # dont double up + add_definitions(-D__MMX__) endif() endif() |