Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-11 16:22:03 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-11 16:44:09 +0300
commit7ad21c3876c2453f11fd509a0157639d615567fc (patch)
tree40ee2e28d2bc2f4e702bb0106bd8b6873e8a2ec1
parentf0b72a776ed888da798b41ce43995f7b5ac11ec0 (diff)
Fix T66604: Cycles bake crash on specific scene with volume
The issue was caused by un-initialized local storage for volume intersection hits which are supposed to be stored in per-thread KernelGlobals. Fix is to make thread_shader() be the same as thread_render() in respect of KernelGlobals. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D5230
-rw-r--r--intern/cycles/device/device_cpu.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index dc9adcb1537..b2d923dfdf0 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -980,14 +980,11 @@ class CPUDevice : public Device {
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 x = task.shader_x; x < task.shader_x + task.shader_w; x++)
- shader_kernel()(&kg,
+ shader_kernel()(kg,
(uint4 *)task.shader_input,
(float4 *)task.shader_output,
task.shader_eval_type,
@@ -1002,9 +999,8 @@ class CPUDevice : public Device {
task.update_progress(NULL);
}
-#ifdef WITH_OSL
- OSLShader::thread_free(&kg);
-#endif
+ thread_kernel_globals_free(kg);
+ delete kg;
}
int get_split_task_count(DeviceTask &task)