diff options
author | Brecht Van Lommel <brecht> | 2021-09-30 17:51:03 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-09-30 21:53:27 +0300 |
commit | 1a134c4c30a643ada1b9a7a037040b5f5c173a28 (patch) | |
tree | b4216998527ff24fb3fc9e9351ced05cd7b7eb08 /intern/cycles/integrator/path_trace.h | |
parent | a754e35198d852ea34e2b82cd2b126538e6f5a3b (diff) |
Cycles: refactor API for render output
* Add OutputDriver, replacing function callbacks in Session.
* Add PathTraceTile, replacing tile access methods in Session.
* Add more detailed comments about how this driver should be implemented.
* Add OIIOOutputDriver for Cycles standalone to output an image.
Differential Revision: https://developer.blender.org/D12627
Diffstat (limited to 'intern/cycles/integrator/path_trace.h')
-rw-r--r-- | intern/cycles/integrator/path_trace.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/intern/cycles/integrator/path_trace.h b/intern/cycles/integrator/path_trace.h index 46eb0435c91..dbb22c204d9 100644 --- a/intern/cycles/integrator/path_trace.h +++ b/intern/cycles/integrator/path_trace.h @@ -37,6 +37,7 @@ class RenderBuffers; class RenderScheduler; class RenderWork; class PathTraceDisplay; +class OutputDriver; class Progress; class TileManager; @@ -99,7 +100,10 @@ class PathTrace { * Use this to configure the adaptive sampler before rendering any samples. */ void set_adaptive_sampling(const AdaptiveSampling &adaptive_sampling); - /* Set display driver which takes care of drawing the render result. */ + /* Sets output driver for render buffer output. */ + void set_output_driver(unique_ptr<OutputDriver> driver); + + /* Set display driver for interactive render buffer display. */ void set_display_driver(unique_ptr<DisplayDriver> driver); /* Clear the display buffer by filling it in with all zeroes. */ @@ -158,6 +162,7 @@ class PathTrace { * instead. */ int2 get_render_tile_size() const; int2 get_render_tile_offset() const; + int2 get_render_size() const; /* Get buffer parameters of the current tile. * @@ -169,18 +174,6 @@ class PathTrace { * times, and so on. */ string full_report() const; - /* Callback which communicates an updates state of the render buffer of the current big tile. - * Is called during path tracing to communicate work-in-progress state of the final buffer. */ - function<void(void)> tile_buffer_update_cb; - - /* Callback which communicates final rendered buffer. Is called after path-tracing is done. */ - function<void(void)> tile_buffer_write_cb; - - /* Callback which initializes rendered buffer. Is called before path-tracing starts. - * - * This is used for baking. */ - function<bool(void)> tile_buffer_read_cb; - /* Callback which is called to report current rendering progress. * * It is supposed to be cheaper than buffer update/write, hence can be called more often. @@ -253,8 +246,12 @@ class PathTrace { RenderScheduler &render_scheduler_; TileManager &tile_manager_; + /* Display driver for interactive render buffer display. */ unique_ptr<PathTraceDisplay> display_; + /* Output driver to write render buffer to. */ + unique_ptr<OutputDriver> output_driver_; + /* Per-compute device descriptors of work which is responsible for path tracing on its configured * device. */ vector<unique_ptr<PathTraceWork>> path_trace_works_; |