diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2014-07-23 01:41:01 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2014-07-25 18:42:53 +0400 |
commit | fc55c41bba8121bf3db67280c26e840f8b3f4124 (patch) | |
tree | 181abfb43fbbdf84b85206ddc1c2de7635a0dbaf /intern/cycles/device/device_cpu.cpp | |
parent | 2e50b4dc511567a3dfb280e30b5606873fc62d31 (diff) |
Cycles Bake: show progress bar during bake
Baking progress preview is not possible, in parts due to the way the API
was designed. But at least you get to see the progress bar while baking.
Reviewers: sergey
Differential Revision: https://developer.blender.org/D656
Diffstat (limited to 'intern/cycles/device/device_cpu.cpp')
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 7308d036fe3..4fdeef6bdcb 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -185,7 +185,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } else @@ -207,7 +207,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } else @@ -229,7 +229,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } else @@ -251,7 +251,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } else @@ -273,7 +273,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } else @@ -294,7 +294,7 @@ public: tile.sample = sample + 1; - task.update_progress(tile); + task.update_progress(&tile); } } @@ -433,71 +433,83 @@ public: #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 if(system_cpu_support_avx2()) { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_avx2_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX if(system_cpu_support_avx()) { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_avx_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 if(system_cpu_support_sse41()) { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_sse41_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 if(system_cpu_support_sse3()) { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_sse3_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 if(system_cpu_support_sse2()) { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_sse2_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } else #endif { - for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) { - for(int sample = 0; sample < task.num_samples; sample++) + for(int sample = 0; sample < task.num_samples; sample++) { + for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) kernel_cpu_shader(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, x, sample); if(task.get_cancel() || task_pool.canceled()) break; + + task.update_progress(NULL); } } @@ -506,6 +518,14 @@ public: #endif } + int get_split_task_count(DeviceTask& task) + { + if (task.type == DeviceTask::SHADER) + return task.get_subtask_count(TaskScheduler::num_threads(), 256); + else + return task.get_subtask_count(TaskScheduler::num_threads()); + } + void task_add(DeviceTask& task) { /* split task into smaller ones */ |