2012-09-04 13:29:07 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2012-09-04 13:29:07 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2012-09-04 13:29:07 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2012-09-04 13:29:07 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License
|
2012-09-04 13:29:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DEVICE_TASK_H__
|
|
|
|
#define __DEVICE_TASK_H__
|
|
|
|
|
|
|
|
#include "device_memory.h"
|
|
|
|
|
|
|
|
#include "util_function.h"
|
|
|
|
#include "util_list.h"
|
|
|
|
#include "util_task.h"
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
/* Device Task */
|
|
|
|
|
|
|
|
class Device;
|
|
|
|
class RenderBuffers;
|
|
|
|
class RenderTile;
|
|
|
|
class Tile;
|
|
|
|
|
|
|
|
class DeviceTask : public Task {
|
|
|
|
public:
|
2013-08-30 23:49:38 +00:00
|
|
|
typedef enum { PATH_TRACE, FILM_CONVERT, SHADER } Type;
|
2012-09-04 13:29:07 +00:00
|
|
|
Type type;
|
|
|
|
|
|
|
|
int x, y, w, h;
|
2013-08-30 23:49:38 +00:00
|
|
|
device_ptr rgba_byte;
|
|
|
|
device_ptr rgba_half;
|
2012-09-04 13:29:07 +00:00
|
|
|
device_ptr buffer;
|
|
|
|
int sample;
|
|
|
|
int num_samples;
|
|
|
|
int offset, stride;
|
|
|
|
|
|
|
|
device_ptr shader_input;
|
|
|
|
device_ptr shader_output;
|
|
|
|
int shader_eval_type;
|
|
|
|
int shader_x, shader_w;
|
|
|
|
|
|
|
|
DeviceTask(Type type = PATH_TRACE);
|
|
|
|
|
|
|
|
void split(list<DeviceTask>& tasks, int num);
|
|
|
|
void split_max_size(list<DeviceTask>& tasks, int max_size);
|
|
|
|
|
|
|
|
void update_progress(RenderTile &rtile);
|
|
|
|
|
|
|
|
boost::function<bool(Device *device, RenderTile&)> acquire_tile;
|
|
|
|
boost::function<void(void)> update_progress_sample;
|
|
|
|
boost::function<void(RenderTile&)> update_tile_sample;
|
|
|
|
boost::function<void(RenderTile&)> release_tile;
|
|
|
|
boost::function<bool(void)> get_cancel;
|
|
|
|
|
2012-10-13 12:38:32 +00:00
|
|
|
bool need_finish_queue;
|
2013-08-23 14:34:34 +00:00
|
|
|
bool integrator_branched;
|
2012-09-04 13:29:07 +00:00
|
|
|
protected:
|
|
|
|
double last_update_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
#endif /* __DEVICE_TASK_H__ */
|
|
|
|
|