From 087331c495b04ebd37903c0dc0e46262354cf026 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Thu, 9 Nov 2017 00:49:15 -0500 Subject: Cycles: Replace __MAX_CLOSURE__ build option with runtime integrator variable Goal is to reduce OpenCL kernel recompilations. Currently viewport renders are still set to use 64 closures as this seems to be faster and we don't want to cause a performance regression there. Needs to be investigated. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2775 --- intern/cycles/device/device.cpp | 1 - intern/cycles/device/device.h | 6 ------ intern/cycles/device/device_cpu.cpp | 1 - intern/cycles/device/device_cuda.cpp | 4 ---- intern/cycles/device/device_split_kernel.cpp | 3 --- intern/cycles/device/device_split_kernel.h | 3 --- 6 files changed, 18 deletions(-) (limited to 'intern/cycles/device') diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 641e3fde140..a3ff5481cef 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -47,7 +47,6 @@ std::ostream& operator <<(std::ostream &os, { os << "Experimental features: " << (requested_features.experimental ? "On" : "Off") << std::endl; - os << "Max closure count: " << requested_features.max_closure << std::endl; os << "Max nodes group: " << requested_features.max_nodes_group << std::endl; /* TODO(sergey): Decode bitflag into list of names. */ os << "Nodes features: " << requested_features.nodes_features << std::endl; diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 6bf3bbe6c25..35b545388f2 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -91,9 +91,6 @@ public: /* Use experimental feature set. */ bool experimental; - /* Maximum number of closures in shader trees. */ - int max_closure; - /* Selective nodes compilation. */ /* Identifier of a node group up to which all the nodes needs to be @@ -146,7 +143,6 @@ public: { /* TODO(sergey): Find more meaningful defaults. */ experimental = false; - max_closure = 0; max_nodes_group = 0; nodes_features = 0; use_hair = false; @@ -167,7 +163,6 @@ public: bool modified(const DeviceRequestedFeatures& requested_features) { return !(experimental == requested_features.experimental && - max_closure == requested_features.max_closure && max_nodes_group == requested_features.max_nodes_group && nodes_features == requested_features.nodes_features && use_hair == requested_features.use_hair && @@ -198,7 +193,6 @@ public: string_printf("%d", max_nodes_group); build_options += " -D__NODES_FEATURES__=" + string_printf("%d", nodes_features); - build_options += string_printf(" -D__MAX_CLOSURE__=%d", max_closure); if(!use_hair) { build_options += " -D__NO_HAIR__"; } diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 1a54c3380ee..0f4001ab1a6 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -760,7 +760,6 @@ public: CPUSplitKernel *split_kernel = NULL; if(use_split_kernel) { split_kernel = new CPUSplitKernel(this); - requested_features.max_closure = MAX_CLOSURE; if(!split_kernel->load_kernels(requested_features)) { thread_kernel_globals_free((KernelGlobals*)kgbuffer.device_pointer); kgbuffer.free(); diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 14e3ddc8c7b..d230a0c565d 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1861,10 +1861,6 @@ public: DeviceRequestedFeatures requested_features; if(use_split_kernel()) { - if(!use_adaptive_compilation()) { - requested_features.max_closure = 64; - } - if(split_kernel == NULL) { split_kernel = new CUDASplitKernel(this); split_kernel->load_kernels(requested_features); diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index 115273d9f0a..566d4020b33 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -34,7 +34,6 @@ DeviceSplitKernel::DeviceSplitKernel(Device *device) use_queues_flag(device, "use_queues_flag"), work_pool_wgs(device, "work_pool_wgs") { - current_max_closure = -1; first_tile = true; avg_time_per_sample = 0.0; @@ -116,8 +115,6 @@ bool DeviceSplitKernel::load_kernels(const DeviceRequestedFeatures& requested_fe #undef LOAD_KERNEL - current_max_closure = requested_features.max_closure; - return true; } diff --git a/intern/cycles/device/device_split_kernel.h b/intern/cycles/device/device_split_kernel.h index 0647c664447..2ec0261e847 100644 --- a/intern/cycles/device/device_split_kernel.h +++ b/intern/cycles/device/device_split_kernel.h @@ -92,9 +92,6 @@ private: /* Work pool with respect to each work group. */ device_only_memory work_pool_wgs; - /* clos_max value for which the kernels have been loaded currently. */ - int current_max_closure; - /* Marked True in constructor and marked false at the end of path_trace(). */ bool first_tile; -- cgit v1.2.3