From 11af0ff2702ccd02f5dd7528e3f4c5039c635144 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 10 Dec 2009 00:51:13 +0000 Subject: * WITH_BF_RAYOPTIMIZATION cleanup and flag separation by matd. This adds BF_RAYOPTIMIZATION_SSE_FLAGS through which one can manage what SSE flags are best for the platform built for. Note that the ray optimizations coded by jaguarandi are SSE-intrinsics only. --- source/blender/render/SConscript | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index 2642d31bd35..71c60e046cc 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -4,18 +4,28 @@ Import ('env') cflags = env['CCFLAGS'] cxxflags = env['CXXFLAGS'] +defs = [] + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['WITH_BF_RAYOPTIMIZATION']: - cflags = env['CCFLAGS'] + ['/arch:SSE'] + cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + cxxflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] if env['OURPLATFORM'] == 'win32-mingw': if env['WITH_BF_RAYOPTIMIZATION']: - cflags = env['CCFLAGS'] + ['-mfpmath=sse'] + cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] if env['OURPLATFORM'] == 'darwin': if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']: - cflags = env['CFLAGS'] + ['-mfpmath=sse'] - cxxflags = env['CXXFLAGS'] + ['-mfpmath=sse'] + cflags = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + +if env['OURPLATFORM'] == 'linux2': + if env['WITH_BF_RAYOPTIMIZATION']: + cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + incs += ' ../../../extern/binreloc/include' sources = env.Glob('intern/source/*.c') raysources = env.Glob('intern/raytrace/*.cpp') @@ -24,8 +34,6 @@ incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna' incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf' incs += ' ../include ../blenloader ../../../intern/smoke/extern' -defs = [] - if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] @@ -33,15 +41,6 @@ if env['WITH_BF_QUICKTIME']: if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') -if env['OURPLATFORM'] == 'linux2': -# SSE is NOT safe all the time on linux, plus that ignores users compile flags and therefore no no -# cflags = ['-O2','-msse2','-mfpmath=sse', '-pthread'] -# cxxflags = ['-O2','-msse2','-mfpmath=sse', '-pthread'] - if env['WITH_BF_RAYOPTIMIZATION']: - cflags = env['CCFLAGS'] + ['-O2','-msse2','-mfpmath=sse', '-pthread'] - cxxflags = env['CXXFLAGS'] + ['-O2','-msse2','-mfpmath=sse', '-pthread'] - incs += ' ../../../extern/binreloc/include' - if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -- cgit v1.2.3