From 2840a5de8f26835df8e8a43972fd3eb2bae0ef73 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 9 May 2015 19:56:38 +0500 Subject: [PATCH] Cycles: Workaround for AMD compiler crashing building the split kernel It's a but in compiler but it's nice to have working kernel for until that bug is fixed. --- intern/cycles/kernel/kernel_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 303a78d8ac0..d8c47e48702 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -470,11 +470,27 @@ typedef struct differential { /* Ray */ typedef struct Ray { +/* TODO(sergey): This is only needed because current AMD + * compilet has hard time bulding the kernel with this + * reshuffle. And at the same time reshuffle will cause + * less optimal CPU code in certain places. + * + * We'll get rid of this nasty eception once AMD compiler + * is fixed. + */ +#ifndef __KERNEL_OPENCL_AMD__ float3 P; /* origin */ float3 D; /* direction */ float t; /* length of the ray */ float time; /* time (for motion blur) */ +#else + float t; /* length of the ray */ + float time; /* time (for motion blur) */ + float3 P; /* origin */ + float3 D; /* direction */ +#endif + #ifdef __RAY_DIFFERENTIALS__ differential3 dP; differential3 dD;