Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-12 14:00:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-01-12 14:21:30 +0300
commitac7aefd7c2bc0e87b2787e374d414f18b7887baa (patch)
tree9dddc76953051052793639d4d59a934d1e97f250 /intern/cycles/device/device.cpp
parentc6c223ade6470e7a9b61ea4a4a3ab6ed62abe79d (diff)
Cycles: Use special debug panel to fine-tune debug flags
This panel is only visible when debug_value is set to 256 and has no affect in other cases. However, if debug value is not set to this value, environment variables will be used to control which features are enabled, so there's no visible changes to anyone in fact. There are some changes needed to prevent devices re-enumeration on every Cycles session create. Reviewers: juicyfruit, lukasstockner97, dingto, brecht Reviewed By: lukasstockner97, dingto Differential Revision: https://developer.blender.org/D1720
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r--intern/cycles/device/device.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index 929f810eaa1..fd52b11c06d 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -32,6 +32,9 @@
CCL_NAMESPACE_BEGIN
+bool Device::need_types_update = true;
+bool Device::need_devices_update = true;
+
/* Device Requested Features */
std::ostream& operator <<(std::ostream &os,
@@ -278,9 +281,9 @@ string Device::string_from_type(DeviceType type)
vector<DeviceType>& Device::available_types()
{
static vector<DeviceType> types;
- static bool types_init = false;
- if(!types_init) {
+ if(need_types_update) {
+ types.clear();
types.push_back(DEVICE_CPU);
#ifdef WITH_CUDA
@@ -300,7 +303,7 @@ vector<DeviceType>& Device::available_types()
types.push_back(DEVICE_MULTI);
#endif
- types_init = true;
+ need_types_update = false;
}
return types;
@@ -309,9 +312,9 @@ vector<DeviceType>& Device::available_types()
vector<DeviceInfo>& Device::available_devices()
{
static vector<DeviceInfo> devices;
- static bool devices_init = false;
- if(!devices_init) {
+ if(need_types_update) {
+ devices.clear();
#ifdef WITH_CUDA
if(device_cuda_init())
device_cuda_info(devices);
@@ -332,7 +335,7 @@ vector<DeviceInfo>& Device::available_devices()
device_network_info(devices);
#endif
- devices_init = true;
+ need_types_update = false;
}
return devices;
@@ -359,4 +362,10 @@ string Device::device_capabilities()
return capabilities;
}
+void Device::tag_update()
+{
+ need_types_update = true;
+ need_devices_update = true;
+}
+
CCL_NAMESPACE_END