Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device_cpu.cpp
| Show First 20 Lines • Show All 974 Lines • ▼ Show 20 Lines | else { | ||||
| y, | y, | ||||
| task.offset, | task.offset, | ||||
| task.stride); | task.stride); | ||||
| } | } | ||||
| } | } | ||||
| void thread_shader(DeviceTask &task) | void thread_shader(DeviceTask &task) | ||||
| { | { | ||||
| KernelGlobals kg = kernel_globals; | KernelGlobals *kg = new KernelGlobals(thread_kernel_globals_init()); | ||||
| #ifdef WITH_OSL | |||||
| OSLShader::thread_init(&kg, &kernel_globals, &osl_globals); | |||||
| #endif | |||||
| 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++) | for (int x = task.shader_x; x < task.shader_x + task.shader_w; x++) | ||||
| shader_kernel()(&kg, | shader_kernel()(kg, | ||||
| (uint4 *)task.shader_input, | (uint4 *)task.shader_input, | ||||
| (float4 *)task.shader_output, | (float4 *)task.shader_output, | ||||
| task.shader_eval_type, | task.shader_eval_type, | ||||
| task.shader_filter, | task.shader_filter, | ||||
| x, | x, | ||||
| task.offset, | task.offset, | ||||
| sample); | sample); | ||||
| if (task.get_cancel() || task_pool.canceled()) | if (task.get_cancel() || task_pool.canceled()) | ||||
| break; | break; | ||||
| task.update_progress(NULL); | task.update_progress(NULL); | ||||
| } | } | ||||
| #ifdef WITH_OSL | thread_kernel_globals_free(kg); | ||||
brecht: Missing `delete kg;`? | |||||
| OSLShader::thread_free(&kg); | |||||
| #endif | |||||
| } | } | ||||
| int get_split_task_count(DeviceTask &task) | int get_split_task_count(DeviceTask &task) | ||||
| { | { | ||||
| if (task.type == DeviceTask::SHADER) | if (task.type == DeviceTask::SHADER) | ||||
| return task.get_subtask_count(info.cpu_threads, 256); | return task.get_subtask_count(info.cpu_threads, 256); | ||||
| else | else | ||||
| return task.get_subtask_count(info.cpu_threads); | return task.get_subtask_count(info.cpu_threads); | ||||
| ▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines | |||||
Missing delete kg;?