diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-31 19:18:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-31 19:18:13 +0400 |
commit | b5595298d36a5023cc33ed41463fd6c032f2ec7b (patch) | |
tree | e3a404393ff4a8e39a991f9a3d8ca78c0d3033a7 /intern/cycles/device/device.cpp | |
parent | 1b4487e813edac9c5b57b6d5c6175c46c4a54b1c (diff) |
Cycles code refactoring: change displace kernel into more generic shader
evaluate kernel, added background shader evaluate.
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r-- | intern/cycles/device/device.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 6ebc359fdb3..55fc3bacbba 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -38,7 +38,8 @@ CCL_NAMESPACE_BEGIN DeviceTask::DeviceTask(Type type_) : type(type_), x(0), y(0), w(0), h(0), rng_state(0), rgba(0), buffer(0), sample(0), resolution(0), - displace_input(0), displace_offset(0), displace_x(0), displace_w(0) + shader_input(0), shader_output(0), + shader_eval_type(0), shader_x(0), shader_w(0) { } @@ -46,8 +47,8 @@ void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size) { int num; - if(type == DISPLACE) { - num = (displace_w + max_size - 1)/max_size; + if(type == SHADER) { + num = (shader_w + max_size - 1)/max_size; } else { max_size = max(1, max_size/w); @@ -68,17 +69,17 @@ void DeviceTask::split(ThreadQueue<DeviceTask>& queue, int num) void DeviceTask::split(list<DeviceTask>& tasks, int num) { - if(type == DISPLACE) { - num = min(displace_w, num); + if(type == SHADER) { + num = min(shader_w, num); for(int i = 0; i < num; i++) { - int tx = displace_x + (displace_w/num)*i; - int tw = (i == num-1)? displace_w - i*(displace_w/num): displace_w/num; + int tx = shader_x + (shader_w/num)*i; + int tw = (i == num-1)? shader_w - i*(shader_w/num): shader_w/num; DeviceTask task = *this; - task.displace_x = tx; - task.displace_w = tw; + task.shader_x = tx; + task.shader_w = tw; tasks.push_back(task); } |