48 tile_manager(
params.progressive,
179 reset_(buffer_params, samples);
221 bool tiles_written =
false;
260 else if (
pause || no_tiles) {
305 bool delayed_denoise =
false;
529 buffer_params.
full_x = rtile.
x;
530 buffer_params.
full_y = rtile.
y;
531 buffer_params.
width = rtile.
w;
532 buffer_params.
height = rtile.
h;
671 for (
int dy = -1, i = 0; dy <= 1; dy++) {
672 for (
int dx = -1; dx <= 1; dx++, i++) {
678 rtile.
x = image_region.
x + tile->
x;
679 rtile.
y = image_region.
y + tile->
y;
701 rtile.
x =
clamp(px, image_region.
x, image_region.
z);
702 rtile.
y =
clamp(py, image_region.
y, image_region.
w);
703 rtile.
w = rtile.
h = 0;
716 neighbors.
target = center_tile;
727 bool tiles_written =
false;
745 bool need_copy_to_display_buffer =
false;
778 else if (
pause || no_tiles) {
823 bool delayed_denoise =
false;
831 need_copy_to_display_buffer = !delayed_denoise;
849 else if (need_copy_to_display_buffer) {
900 return draw_gpu(buffer_params, draw_params);
902 return draw_cpu(buffer_params, draw_params);
953 if (
pause != pause_) {
983 need_denoise =
false;
1036 bool kernel_switch_needed =
false;
1038 if (kernel_switch_needed) {
1055 string status, substatus;
1059 const bool rendering_finished = (tile == num_tiles);
1060 const bool is_last_tile = (tile + 1) == num_tiles;
1062 substatus =
string_printf(
"Rendered %d/%d Tiles", tile, num_tiles);
1084 substatus =
string_printf(
"Path Tracing Sample %d", progressive_sample + 1);
1086 substatus =
string_printf(
"Path Tracing Sample %d/%d", progressive_sample + 1, num_samples);
1089 status =
"Rendering Paused";
1091 else if (show_done) {
1092 status =
"Rendering Done";
1185 task.target_pass_stride =
task.pass_stride;
1189 task.denoising_from_render =
true;
1252 double current_time =
time_dt();
1256 if (!write &&
sample != 1)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool modified(const BufferParams ¶ms)
void get_offset_stride(int &offset, int &stride)
bool need_denoising_task() const
DenoiserTypeMask denoisers
function< void(RenderTile &)> update_tile_sample
static Device * create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background=true)
virtual DeviceKernelStatus get_active_kernel_switch_state()
virtual void task_wait()=0
virtual int device_number(Device *)
virtual void unmap_neighbor_tiles(Device *, RenderTileNeighbors &)
virtual void task_cancel()=0
virtual void map_tile(Device *, RenderTile &)
virtual const string & error_message()
virtual void map_neighbor_tiles(Device *, RenderTileNeighbors &)
virtual void task_add(DeviceTask &task)=0
virtual bool show_samples() const
device_pixels< uchar4 > rgba_byte
void draw_set(int width, int height)
void reset(BufferParams ¶ms)
void draw(Device *device, const DeviceDrawParams &draw_params)
device_pixels< half4 > rgba_half
int get_denoising_data_offset() const
int get_pass_stride() const
int get_denoising_clean_offset() const
static NODE_DECLARE const int MAX_SAMPLES
void reset(int num_shaders, int num_objects)
void set_total_pixel_samples(uint64_t total_pixel_samples_)
void set_cancel(const string &cancel_message_)
void set_status(const string &status_, const string &substatus_="")
void add_samples(uint64_t pixel_samples_, int tile_sample)
void set_error(const string &error_message_)
void set_render_start_time()
void add_finished_tile(bool denoised)
string get_cancel_message()
void add_skip_time(const scoped_timer &start_timer, bool only_render)
device_vector< float > buffer
void reset(BufferParams ¶ms)
void set_bounds_from_center()
StealingState stealing_state
bool display_buffer_linear
double progressive_update_timeout
function< bool(const uchar *pixels, int width, int height, int channels)> write_render_cb
bool acquire_tile(RenderTile &tile, Device *tile_device, uint tile_types)
void reset_cpu(BufferParams ¶ms, int samples)
void set_denoising_start_sample(int sample)
void collect_statistics(RenderStats *stats)
bool draw_cpu(BufferParams ¶ms, DeviceDrawParams &draw_params)
function< void(RenderTile &, bool)> update_render_tile_cb
thread_condition_variable pause_cond
volatile bool display_outdated
std::atomic< TileStealingState > tile_stealing_state
bool steal_tile(RenderTile &tile, Device *tile_device, thread_scoped_lock &tile_lock)
thread_condition_variable denoising_cond
void update_status_time(bool show_pause=false, bool show_done=false)
bool draw(BufferParams ¶ms, DeviceDrawParams &draw_params)
thread_condition_variable tile_steal_cond
void set_pause(bool pause)
thread_condition_variable gpu_need_display_buffer_update_cond
bool draw_gpu(BufferParams ¶ms, DeviceDrawParams &draw_params)
void render(bool use_denoise)
bool update_progressive_refine(bool cancel)
bool render_need_denoise(bool &delayed)
void set_denoising(const DenoiseParams &denoising)
void reset_gpu(BufferParams ¶ms, int samples)
void release_tile(RenderTile &tile, const bool need_denoise)
void reset_(BufferParams ¶ms, int samples)
volatile bool gpu_draw_ready
function< void(RenderTile &)> write_render_tile_cb
volatile bool gpu_need_display_buffer_update
void copy_to_display_buffer(int sample)
Session(const SessionParams ¶ms)
void map_neighbor_tiles(RenderTileNeighbors &neighbors, Device *tile_device)
thread_mutex display_mutex
void reset(BufferParams ¶ms, int samples)
void unmap_neighbor_tiles(RenderTileNeighbors &neighbors, Device *tile_device)
thread_mutex buffers_mutex
void update_tile_sample(RenderTile &tile)
void set_samples(int samples)
struct Session::DelayedReset delayed_reset
function< void(RenderTile &)> read_bake_tile_cb
static void init(int num_threads=0)
void reset(BufferParams ¶ms, int num_samples)
int get_neighbor_index(int index, int neighbor)
bool next_tile(Tile *&tile, int device, uint tile_types)
bool finish_tile(const int index, const bool need_denoise, bool &delete_tile)
struct TileManager::State state
int get_num_effective_samples()
void set_samples(int num_samples)
device_ptr device_pointer
T * copy_from_device(int y, int w, int h)
void move_device(Device *new_device)
@ DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE
@ DENOISER_OPENIMAGEDENOISE
#define CCL_NAMESPACE_END
#define make_int4(x, y, z, w)
static void sample(SocketReader *reader, int x, int y, float color[4])
struct blender::compositor::@172::@174 task
void set_screen_size_and_resolution(int width_, int height_, int resolution_)
KernelIntegrator integrator
int pass_adaptive_aux_buffer
void collect_profiling(Scene *scene, Profiler &prof)
BakeManager * bake_manager
vector< Shader * > shaders
vector< Object * > objects
bool update(Progress &progress, bool &kernel_switch_needed)
void collect_statistics(RenderStats *stats)
uint64_t total_pixel_samples
ccl_device_inline int clamp(int a, int mn, int mx)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
std::unique_lock< std::mutex > thread_scoped_lock
CCL_NAMESPACE_BEGIN double time_dt()