diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 19:13:38 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 19:13:38 +0400 |
commit | db8024f4b54ac4cf83b5346fe1548c009fd21082 (patch) | |
tree | b005764126eff5502fcbae63048b0d17a46d6778 /intern/cycles/SConscript | |
parent | 2bc78219135eba9b8079dc69ea7fd062a283a9b3 (diff) |
Fix #29259: cycles issues on certain processors. Now two versions of the kernel
are compiled, one SSE optimized and the other not, and it will choose between
them at runtime.
Diffstat (limited to 'intern/cycles/SConscript')
-rw-r--r-- | intern/cycles/SConscript | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript index e2c81edea37..1acb7321f09 100644 --- a/intern/cycles/SConscript +++ b/intern/cycles/SConscript @@ -10,11 +10,10 @@ sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob(' sources.remove(path.join('util', 'util_view.cpp')) sources.remove(path.join('render', 'film_response.cpp')) +sources.remove(path.join('kernel', 'kernel_optimized.cpp')) incs = [] defs = [] -ccflags = [] -cxxflags = [] defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {') defs.append('CCL_NAMESPACE_END=}') @@ -23,14 +22,6 @@ defs.append('WITH_OPENCL') defs.append('WITH_MULTI') defs.append('WITH_CUDA') -if env['OURPLATFORM'] in ('win32-mingw'): - if env['WITH_BF_RAYOPTIMIZATION']: - cxxflags.append('-ffast-math -msse -msse2 -msse3'.split()) - ccflags.append('-ffast-math -msse -msse2 -msse3'.split()) - # not needed yet, is for open shading language - # cxxflags.append('-fno-rtti'.split()) - # defs.append('BOOST_NO_RTTI BOOST_NO_TYPEID'.split()) - incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split()) incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split()) incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split()) @@ -39,5 +30,20 @@ incs.append(cycles['BF_OIIO_INC']) incs.append(cycles['BF_BOOST_INC']) incs.append(cycles['BF_PYTHON_INC']) -cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None], cc_compileflags=ccflags, cxx_compileflags=cxxflags) +# optimized kernel +if env['WITH_BF_RAYOPTIMIZATION']: + optim_cxxflags = [] + + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): + optim_cxxflags.append('/Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast'.split()) + else: + optim_cxxflags.append('-ffast-math -msse -msse2 -msse3'.split()) + + optim_defs = defs + ['WITH_OPTIMIZED_KERNEL'] + optim_sources = [path.join('kernel', 'kernel_optimized.cpp')] + + cycles_optim = cycles.Clone() + cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[0], compileflags=[None], cxx_compileflags=optim_cxxflags) + +cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None]) |