Page MenuHome

Cycles: Pass all buffers to each kernel call for OpenCL

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



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.


In Cycles we for Type *variable.


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


Copyright header.