[Bf-blender-cvs] [e91dc3a97c0] master: Cycles: use safe compiler flags for OpenCL.

Hristo Gueorguiev noreply at git.blender.org
Tue Apr 25 20:26:05 CEST 2017


Commit: e91dc3a97c0ce1951ce76790210f7197ab9e014a
Author: Hristo Gueorguiev
Date:   Tue Apr 25 20:10:51 2017 +0200
Branches: master
https://developer.blender.org/rBe91dc3a97c0ce1951ce76790210f7197ab9e014a

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

===================================================================

M	intern/cycles/device/opencl/opencl_base.cpp

===================================================================

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__ "




More information about the Bf-blender-cvs mailing list