Fix #33411: crash baking smoke with FFT high resolution.

CMake had FFTW disabled by default, and when FFTW was not enabled it lead to
uninitialized memory usage. Now it falls back to wavelet if there is no FFTW,
and I've enabled it by default in CMake. If it's not found on Linux it will get
disabled automatically.
This commit is contained in:
Brecht Van Lommel 2012-12-05 15:46:31 +00:00
parent 4742dc3fd7
commit 2b962212c8
2 changed files with 17 additions and 13 deletions

View File

@ -127,7 +127,7 @@ option(WITH_PYTHON_MODULE "Enable building as a python module which runs without
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON)
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_GAMEENGINE "Enable Game Engine" ON)
option(WITH_PLAYER "Build Player" OFF)
@ -387,10 +387,6 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
endif()
if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
endif()
# may as well build python module without a UI
if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
@ -1670,6 +1666,10 @@ if(APPLE OR WIN32)
endif()
endif()
if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
endif()
if(WITH_CYCLES)
if(NOT WITH_OPENIMAGEIO)
message(FATAL_ERROR "Cycles reqires WITH_OPENIMAGEIO, the library may not have been found. Configure OIIO or disable WITH_CYCLES")

View File

@ -220,21 +220,25 @@ void WTURBULENCE::setNoise(int type)
{
if(type == (1<<1)) // FFT
{
#ifdef WITH_FFTW3
// needs fft
#ifdef WITH_FFTW3
std::string noiseTileFilename = std::string("noise.fft");
generatTile_FFT(_noiseTile, noiseTileFilename);
#endif
return;
#else
fprintf(stderr, "FFTW not enabled, falling back to wavelet noise.\n");
#endif
}
else if(type == (1<<2)) // curl
#if 0
if(type == (1<<2)) // curl
{
// TODO: not supported yet
return;
}
else // standard - wavelet
{
std::string noiseTileFilename = std::string("noise.wavelets");
generateTile_WAVELET(_noiseTile, noiseTileFilename);
}
#endif
std::string noiseTileFilename = std::string("noise.wavelets");
generateTile_WAVELET(_noiseTile, noiseTileFilename);
}
// init direct access functions from blender