Page MenuHome

Cycles: Pass all buffers to each kernel call for OpenCL
AbandonedPublic

Authored by Mai Lavelle (maiself) on Jun 5 2017, 4:39 PM.

Details

Summary

Technically not passing all buffers used by a kernel is undefined behavior. We haven't had any issues with this so far on AMD or Nvidia, but it's known to be a problem with Intel and we received a report from AMD that this is a problem on newer hardware, so we need to make this change at some point.

Unfortunately there a cost to being correct, about 5% for the benchmark scenes. For low sample counts it's even worse, I've seen up to 50% slowdown. For the latter case I think adjusting tile updating logic can help, but not sure what that would look like yet (it would be just a few lines change however).

Diff Detail

Event Timeline

Guess this is something we should apply, since it's how OpenCL is expecting us to work with it.

intern/cycles/device/opencl/opencl_split.cpp
181

In Cycles we for Type *variable.

intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl
24

Usually we're adding #undef to the helper header, so you don't need to worry about undef on every use of that header.

intern/cycles/kernel/kernels/opencl/kernel_split_function.h
1

Copyright header.