diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-21 15:13:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-21 15:13:46 +0400 |
commit | e5b457dbc9f009740fe3cca2c8cb44fa88f1f03a (patch) | |
tree | 63e1eeba718717d0c18db9f2a0542639c8f4e2ec /intern/cycles/app/cycles_server.cpp | |
parent | 5f4c7e5da48c488b807635dccee03e1476e2f0bc (diff) |
Cycles: merge some changes from a local branch to bring network rendering a bit
more up to date, still nowhere near working though, but might as well commit this
in case someone else is interested in working on it.
Diffstat (limited to 'intern/cycles/app/cycles_server.cpp')
-rw-r--r-- | intern/cycles/app/cycles_server.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/intern/cycles/app/cycles_server.cpp b/intern/cycles/app/cycles_server.cpp index e6a13e04b48..f94a29b9451 100644 --- a/intern/cycles/app/cycles_server.cpp +++ b/intern/cycles/app/cycles_server.cpp @@ -23,7 +23,9 @@ #include "util_args.h" #include "util_foreach.h" #include "util_path.h" +#include "util_stats.h" #include "util_string.h" +#include "util_task.h" using namespace ccl; @@ -32,29 +34,29 @@ int main(int argc, const char **argv) path_init(); /* device types */ - string devices = ""; + string devicelist = ""; string devicename = "cpu"; bool list = false; vector<DeviceType>& types = Device::available_types(); foreach(DeviceType type, types) { - if(devices != "") - devices += ", "; + if(devicelist != "") + devicelist += ", "; - devices += Device::string_from_type(type); + devicelist += Device::string_from_type(type); } /* parse options */ ArgParse ap; ap.options ("Usage: cycles_server [options]", - "--device %s", &devicename, ("Devices to use: " + devices).c_str(), + "--device %s", &devicename, ("Devices to use: " + devicelist).c_str(), "--list-devices", &list, "List information about all available devices", NULL); if(ap.parse(argc, argv) < 0) { - fprintf(stderr, "%s\n", ap.error_message().c_str()); + fprintf(stderr, "%s\n", ap.geterror().c_str()); ap.usage(); exit(EXIT_FAILURE); } @@ -84,13 +86,18 @@ int main(int argc, const char **argv) } } + TaskScheduler::init(); + while(1) { - Device *device = Device::create(device_info); - printf("Cycles Server with device: %s\n", device->description().c_str()); + Stats stats; + Device *device = Device::create(device_info, stats); + printf("Cycles Server with device: %s\n", device->info.description.c_str()); device->server_run(); delete device; } + TaskScheduler::exit(); + return 0; } |