[Bf-blender-cvs] [2c898bb079] temp-cycles-denoising: Cycles Denoising: Remove two debugging CMake options

Lukas Stockner noreply at git.blender.org
Fri Mar 24 20:18:59 CET 2017


Commit: 2c898bb07922dca7113586d5ea621e22abf862cb
Author: Lukas Stockner
Date:   Fri Mar 24 20:13:19 2017 +0100
Branches: temp-cycles-denoising
https://developer.blender.org/rB2c898bb07922dca7113586d5ea621e22abf862cb

Cycles Denoising: Remove two debugging CMake options

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

M	CMakeLists.txt
M	intern/cycles/CMakeLists.txt
M	intern/cycles/device/device_cpu.cpp
M	intern/cycles/device/device_denoising.cpp
M	intern/cycles/kernel/bvh/bvh.h
M	intern/cycles/util/util_debug.cpp
M	intern/cycles/util/util_debug.h
M	intern/cycles/util/util_system.cpp
M	intern/cycles/util/util_system.h

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 973e9f15c2..3a91e1b655 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -409,14 +409,10 @@ mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
 unset(PLATFORM_DEFAULT)
 option(WITH_CYCLES_LOGGING	"Build Cycles with logging support" ON)
 option(WITH_CYCLES_DEBUG	"Build Cycles with extra debug capabilities" OFF)
-option(WITH_CYCLES_DEBUG_FILTER	"Build Cycles with extra debug capabilities in the denoising filter" OFF)
 option(WITH_CYCLES_NATIVE_ONLY	"Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
-option(WITH_CYCLES_DEBUG_FPE    "Build Cycles with floating point exceptions enabled for easier debugging of numerical issues (only for CPU rendering)" OFF)
 mark_as_advanced(WITH_CYCLES_LOGGING)
 mark_as_advanced(WITH_CYCLES_DEBUG)
-mark_as_advanced(WITH_CYCLES_DEBUG_FILTER)
 mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
-mark_as_advanced(WITH_CYCLES_DEBUG_FPE)
 
 option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
 mark_as_advanced(WITH_CUDA_DYNLOAD)
@@ -764,9 +760,6 @@ if(WITH_CYCLES)
 	if(WITH_CYCLES_OSL)
 		set(WITH_LLVM ON CACHE BOOL "" FORCE)
 	endif()
-	if(WITH_CYCLES_DEBUG_FPE AND APPLE)
-		message(FATAL_ERROR "WITH_CYCLES_DEBUG_FPE is not supported on OSX!")
-	endif()
 else()
 	set(WITH_CYCLES_OSL OFF)
 endif()
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 6269b51b2e..9d9c86f383 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -109,10 +109,6 @@ if(CXX_HAS_AVX2)
 	add_definitions(-DWITH_KERNEL_AVX2)
 endif()
 
-if(WITH_CYCLES_DEBUG_FPE)
-	add_definitions(-DWITH_CYCLES_DEBUG_FPE)
-endif()
-
 if(WITH_CYCLES_OSL)
 	if(WIN32 AND MSVC)
 		set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
@@ -204,10 +200,6 @@ if(WITH_CYCLES_DEBUG)
 	add_definitions(-DWITH_CYCLES_DEBUG)
 endif()
 
-if(WITH_CYCLES_DEBUG_FILTER)
-	add_definitions(-DWITH_CYCLES_DEBUG_FILTER)
-endif()
-
 include_directories(
 	SYSTEM
 	${BOOST_INCLUDE_DIR}
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index d61ca79358..fdf72e7a8e 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -605,9 +605,6 @@ public:
 		int end_sample = tile.start_sample + tile.num_samples;
 
 		for(int sample = start_sample; sample < end_sample; sample++) {
-#ifdef WITH_CYCLES_DEBUG_FPE
-			scoped_fpe fpe(FPE_ENABLED);
-#endif
 			if(task.get_cancel() || task_pool.canceled()) {
 				if(task.need_finish_queue == false)
 					break;
@@ -622,9 +619,6 @@ public:
 
 			tile.sample = sample + 1;
 
-#ifdef WITH_CYCLES_DEBUG_FPE
-			fpe.restore();
-#endif
 			task.update_progress(&tile, tile.w*tile.h);
 		}
 	}
diff --git a/intern/cycles/device/device_denoising.cpp b/intern/cycles/device/device_denoising.cpp
index 6e3a5bb399..308c8e0ff1 100644
--- a/intern/cycles/device/device_denoising.cpp
+++ b/intern/cycles/device/device_denoising.cpp
@@ -67,10 +67,6 @@ void DenoisingTask::tiles_from_rendertiles(RenderTile *rtiles)
 
 bool DenoisingTask::run_denoising()
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_ENABLED);
-#endif
-
 	/* Allocate denoising buffer. */
 	buffer.passes = use_cross_denoising? 20 : 14;
 	buffer.w = align_up(rect.z - rect.x, 4);
@@ -262,4 +258,4 @@ bool DenoisingTask::run_denoising()
 	return true;
 }
 
-CCL_NAMESPACE_END
\ No newline at end of file
+CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h
index 439d0cb162..1358288f83 100644
--- a/intern/cycles/kernel/bvh/bvh.h
+++ b/intern/cycles/kernel/bvh/bvh.h
@@ -166,10 +166,6 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg,
                                           float difl,
                                           float extmax)
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_DISABLED);
-#endif
-
 #ifdef __OBJECT_MOTION__
 	if(kernel_data.bvh.have_motion) {
 #  ifdef __HAIR__
@@ -214,10 +210,6 @@ ccl_device_intersect void scene_intersect_subsurface(KernelGlobals *kg,
                                                      uint *lcg_state,
                                                      int max_hits)
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_DISABLED);
-#endif
-
 #ifdef __OBJECT_MOTION__
 	if(kernel_data.bvh.have_motion) {
 		return bvh_intersect_subsurface_motion(kg,
@@ -245,10 +237,6 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg,
                                                      uint max_hits,
                                                      uint *num_hits)
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_DISABLED);
-#endif
-
 #  ifdef __OBJECT_MOTION__
 	if(kernel_data.bvh.have_motion) {
 #    ifdef __HAIR__
@@ -308,10 +296,6 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals *kg,
                                                  Intersection *isect,
                                                  const uint visibility)
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_DISABLED);
-#endif
-
 #  ifdef __OBJECT_MOTION__
 	if(kernel_data.bvh.have_motion) {
 		return bvh_intersect_volume_motion(kg, ray, isect, visibility);
@@ -340,10 +324,6 @@ ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals *kg,
                                                      const uint max_hits,
                                                      const uint visibility)
 {
-#ifdef WITH_CYCLES_DEBUG_FPE
-	scoped_fpe fpe(FPE_DISABLED);
-#endif
-
 #  ifdef __OBJECT_MOTION__
 	if(kernel_data.bvh.have_motion) {
 		return bvh_intersect_volume_all_motion(kg, ray, isect, max_hits, visibility);
diff --git a/intern/cycles/util/util_debug.cpp b/intern/cycles/util/util_debug.cpp
index 7191aa8421..da3ccae45b 100644
--- a/intern/cycles/util/util_debug.cpp
+++ b/intern/cycles/util/util_debug.cpp
@@ -18,10 +18,6 @@
 
 #include <stdlib.h>
 
-#ifdef WITH_CYCLES_DEBUG_FILTER
-#include <stdio.h>
-#endif
-
 #include "util_logging.h"
 #include "util_string.h"
 
@@ -193,41 +189,4 @@ std::ostream& operator <<(std::ostream &os,
 	return os;
 }
 
-#ifdef WITH_CYCLES_DEBUG_FILTER
-void DebugPasses::add_pass(std::string name, float *data)
-{
-    int pass_index = passnames.size();
-    passnames.push_back(name);
-    pixels.resize(w*h*passnames.size());
-    for (int y = 0, i = pass_index*w*h; y < h; y++) {
-        for (int x = 0; x < w; x++, i++) {
-            pixels[i] = data[(y*linestride + x)*pixelstride];
-        }
-    }
-}
-
-bool DebugPasses::write(std::string name)
-{
-    ImageOutput *out = ImageOutput::create(name);
-    if (!out) return false;
-
-    int num_channels = passnames.size();
-    ImageSpec spec(w, h, num_channels, TypeDesc::FLOAT);
-    spec.channelnames = passnames;
-
-    vector<float> write_pixels(w*h*num_channels);
-    for(int i = 0; i < w*h; i++) {
-        for(int c = 0; c < num_channels; c++) {
-            write_pixels[i*num_channels+c] = pixels[c*w*h + i];
-        }
-    }
-    out->open(name, spec);
-    out->write_image(TypeDesc::FLOAT, &write_pixels[0]);
-    out->close();
-    ImageOutput::destroy(out);
-
-    return true;
-}
-#endif
-
 CCL_NAMESPACE_END
diff --git a/intern/cycles/util/util_debug.h b/intern/cycles/util/util_debug.h
index 1bfc919968..5aa0d91188 100644
--- a/intern/cycles/util/util_debug.h
+++ b/intern/cycles/util/util_debug.h
@@ -21,12 +21,6 @@
 #include <iostream>
 
 #include "util_static_assert.h"
-#include "util_vector.h"
-
-#ifdef WITH_CYCLES_DEBUG_FILTER
-#include "OpenImageIO/imageio.h"
-OIIO_NAMESPACE_USING
-#endif
 
 CCL_NAMESPACE_BEGIN
 
@@ -166,32 +160,6 @@ inline DebugFlags& DebugFlags() {
 std::ostream& operator <<(std::ostream &os,
                           DebugFlagsConstRef debug_flags);
 
-class DebugPasses {
-public:
-
-#ifdef WITH_CYCLES_DEBUG_FILTER
-	DebugPasses(int w, int h, int channels, int pixelstride, int linestride)
-	: w(w),
-	  h(h),
-	  pixelstride(pixelstride),
-	  linestride(linestride)
-	{
-		pixels.resize(w*h*channels);
-	}
-
-	void add_pass(std::string name, float *data);
-	bool write(std::string name);
-
-	int w, h, pixelstride, linestride;
-	vector<float> pixels;
-	vector<std::string> passnames;
-#else
-	DebugPasses(int, int, int, int, int) {}
-	void add_pass(std::string, float*) {}
-	bool write(std::string) { return true; }
-#endif
-};
-
 CCL_NAMESPACE_END
 
 #endif /* __UTIL_DEBUG_H__ */
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 4482ff8448..87d885c44c 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -33,12 +33,6 @@
 #  include <unistd.h>
 #endif
 
-#ifdef __GNUC__
-#  include <fenv.h>
-#elif defined(_MSC_VER)
-#  include <float.h>
-#endif
-
 CCL_NAMESPACE_BEGIN
 
 int system_cpu_group_count()
@@ -298,68 +292,5 @@ bool system_cpu_support_avx2()
 
 #endif
 
-void system_enable_ftz()
-{
-#ifdef _MSC_VER
-	_controlfp(_DN_FLUSH, _MCW_DN);
-#endif
-}
-
-#ifdef WITH_CYCLES_DEBUG_FPE
-static void system_enable_fpe()
-{
-#ifdef __GNUC__
-	feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO);
-#elif defined(_MSC_VER)
-	_controlfp(0, _EM_INVALID | _EM_OVERFLOW | _EM_ZERODIVIDE);
-#endif
-}
-
-static void system_disable_fpe()
-{
-#ifdef __GNUC__
-	fedisableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO);
-#elif defined(_MSC_VER)
-	_controlfp(0xffffffff, _EM_INVALID | _EM_OVERFLOW | _EM_ZERODIVIDE);
-#endif
-}
-
-static bool system_check_fpe()
-{
-#ifdef __GNUC__
-	return fegetexcept() & FE_INVALID;
-#elif defined(_MSC_VER)
-	return !(_controlfp(0, 0) & _EM_INVALID);
-#endif
-}
-
-scoped_fpe::scoped_fpe(FPEState state)
-{
-	was_enabled = system_check_fpe();
-	if(state == FPE_ENABLED) {
-		system_enable_fpe();
-	}
-	else {
-		system_disable_fpe();
-	}
-}
-
-void scoped_fpe::restore()
-{
-	if(was_enabled) {
-		system_enable_fpe();
-	}
-	else {
-		system_disable_fpe();
-	}
-}
-
-scoped_fpe::~scoped_fpe()
-{
-	restore();
-}
-
-#endif
-
 CCL_NAMESPACE_END
 
diff --git a/intern/cycles/util/util_system.h b/intern/cycles/util/util_system.h
index 76fb5338c2..ff61b260be 100644
--- a/intern/cycles/util/util_system.h
+++ b/intern/cycles/util/util_system.h
@@ -42,26 +42,6 @@ bool system_cpu_support_sse41();
 boo

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list