Move BVHType and shadingsystem enums to top-level of Cycles namespace.
[blender.git] / intern / cycles / render / session.h
index 0874bfee780c4c328913e8a7a6db7921d644aefe..2d29015863c05dbcf9e2b2ded6adac9d1ae27caa 100644 (file)
@@ -24,6 +24,7 @@
 #include "util_progress.h"
 #include "util_stats.h"
 #include "util_thread.h"
+#include "util_types.h"
 #include "util_vector.h"
 
 CCL_NAMESPACE_BEGIN
@@ -49,15 +50,17 @@ public:
        bool experimental;
        int samples;
        int2 tile_size;
-       int tile_order;
+       TileOrder tile_order;
        int start_resolution;
        int threads;
 
+       bool display_buffer_linear;
+
        double cancel_timeout;
        double reset_timeout;
        double text_timeout;
 
-       enum { OSL, SVM } shadingsystem;
+       ShadingSystem shadingsystem;
 
        SessionParams()
        {
@@ -67,16 +70,19 @@ public:
 
                progressive = false;
                experimental = false;
-               samples = INT_MAX;
+               samples = USHRT_MAX;
                tile_size = make_int2(64, 64);
                start_resolution = INT_MAX;
                threads = 0;
 
+               display_buffer_linear = false;
+
                cancel_timeout = 0.1;
                reset_timeout = 0.1;
                text_timeout = 1.0;
 
                shadingsystem = SVM;
+               tile_order = TILE_CENTER;
        }
 
        bool modified(const SessionParams& params)
@@ -91,9 +97,11 @@ public:
                && tile_size == params.tile_size
                && start_resolution == params.start_resolution
                && threads == params.threads
+               && display_buffer_linear == params.display_buffer_linear
                && cancel_timeout == params.cancel_timeout
                && reset_timeout == params.reset_timeout
                && text_timeout == params.text_timeout
+               && tile_order == params.tile_order
                && shadingsystem == params.shadingsystem); }
 
 };
@@ -121,7 +129,7 @@ public:
        ~Session();
 
        void start();
-       bool draw(BufferParams& params);
+       bool draw(BufferParams& params, DeviceDrawParams& draw_params);
        void wait();
 
        bool ready_to_reset();
@@ -129,6 +137,7 @@ public:
        void set_samples(int samples);
        void set_pause(bool pause);
 
+       void update_scene();
        void device_free();
 protected:
        struct DelayedReset {
@@ -140,19 +149,18 @@ protected:
 
        void run();
 
-       void update_scene();
        void update_status_time(bool show_pause = false, bool show_done = false);
 
-       void tonemap();
+       void tonemap(int sample);
        void path_trace();
        void reset_(BufferParams& params, int samples);
 
        void run_cpu();
-       bool draw_cpu(BufferParams& params);
+       bool draw_cpu(BufferParams& params, DeviceDrawParams& draw_params);
        void reset_cpu(BufferParams& params, int samples);
 
        void run_gpu();
-       bool draw_gpu(BufferParams& params);
+       bool draw_gpu(BufferParams& params, DeviceDrawParams& draw_params);
        void reset_gpu(BufferParams& params, int samples);
 
        bool acquire_tile(Device *tile_device, RenderTile& tile);