2
* Copyright 2011, Blender Foundation.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
#ifndef __DEVICE_TASK_H__
20
#define __DEVICE_TASK_H__
22
#include "device_memory.h"
24
#include "util_function.h"
25
#include "util_list.h"
26
#include "util_task.h"
37
class DeviceTask : public Task {
39
typedef enum { PATH_TRACE, TONEMAP, SHADER } Type;
50
device_ptr shader_input;
51
device_ptr shader_output;
53
int shader_x, shader_w;
55
DeviceTask(Type type = PATH_TRACE);
57
void split(list<DeviceTask>& tasks, int num);
58
void split_max_size(list<DeviceTask>& tasks, int max_size);
60
void update_progress(RenderTile &rtile);
62
boost::function<bool(Device *device, RenderTile&)> acquire_tile;
63
boost::function<void(void)> update_progress_sample;
64
boost::function<void(RenderTile&)> update_tile_sample;
65
boost::function<void(RenderTile&)> release_tile;
66
boost::function<bool(void)> get_cancel;
68
bool need_finish_queue;
70
double last_update_time;
75
#endif /* __DEVICE_TASK_H__ */