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
This commit is contained in:
parent
f0b72a776e
commit
7ad21c3876
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user