diff options
author | Hristo Gueorguiev <prem.nirved@gmail.com> | 2017-04-25 21:10:51 +0300 |
---|---|---|
committer | Hristo Gueorguiev <prem.nirved@gmail.com> | 2017-04-25 21:10:51 +0300 |
commit | e91dc3a97c0ce1951ce76790210f7197ab9e014a (patch) | |
tree | 1bd7598725bff32661061a966332d243f9e32692 /intern/cycles/device/opencl/opencl_base.cpp | |
parent | 9d26e32ea28b35bf51b27828f7b58fe479a29a68 (diff) |
Cycles: use safe compiler flags for OpenCL.
Using -cl-fast-relaxed-math assumes no NaN/Inf values in any expression.
This causes problems on overflow, division by zero, square root of negative number.
Comparisons with NaN or infinite value are affected as well.
This patch causes <2% slowdown on benchmark scenes.
Fix T50985: Rendering volume scatter with GPU OpenCL comes to an halt after a few seconds
Diffstat (limited to 'intern/cycles/device/opencl/opencl_base.cpp')
-rw-r--r-- | intern/cycles/device/opencl/opencl_base.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index 52d0662a8e3..22aeaddcde8 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -612,7 +612,7 @@ void OpenCLDeviceBase::shader(DeviceTask& task) string OpenCLDeviceBase::kernel_build_options(const string *debug_src) { - string build_options = "-cl-fast-relaxed-math "; + string build_options = "-cl-no-signed-zeros -cl-mad-enable "; if(platform_name == "NVIDIA CUDA") { build_options += "-D__KERNEL_OPENCL_NVIDIA__ " |