From b224fbf2e741c20ac1020f4da1b4e63fd6b8e626 Mon Sep 17 00:00:00 2001 From: Martijn Berger Date: Mon, 7 Apr 2014 14:01:31 +0200 Subject: OpenCL + AMD adapt kernel to newer driver --- intern/cycles/kernel/kernel_compat_opencl.h | 23 ++++++++++++++++------- intern/cycles/kernel/kernel_types.h | 25 +++++++++++-------------- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'intern') diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h index 4f4414cc298..8346b09619e 100644 --- a/intern/cycles/kernel/kernel_compat_opencl.h +++ b/intern/cycles/kernel/kernel_compat_opencl.h @@ -85,27 +85,36 @@ #define __float_as_uint(x) as_uint(x) #define __int_as_float(x) as_float(x) #define __float_as_int(x) as_int(x) -#define sqrtf(x) sqrt(((float)x)) -#define cosf(x) cos(((float)x)) -#define sinf(x) sin(((float)x)) #define powf(x, y) pow(((float)x), ((float)y)) #define fabsf(x) fabs(((float)x)) #define copysignf(x, y) copysign(((float)x), ((float)y)) -#define cosf(x) cos(((float)x)) #define asinf(x) asin(((float)x)) #define acosf(x) acos(((float)x)) #define atanf(x) atan(((float)x)) -#define tanf(x) tan(((float)x)) -#define logf(x) log(((float)x)) #define floorf(x) floor(((float)x)) #define ceilf(x) ceil(((float)x)) -#define expf(x) exp(((float)x)) #define hypotf(x, y) hypot(((float)x), ((float)y)) #define atan2f(x, y) atan2(((float)x), ((float)y)) #define fmaxf(x, y) fmax(((float)x), ((float)y)) #define fminf(x, y) fmin(((float)x), ((float)y)) #define fmodf(x, y) fmod((float)x, (float)y) +#ifndef __CL_USE_NATIVE__ +#define sinf(x) native_sin(((float)x)) +#define cosf(x) native_cos(((float)x)) +#define tanf(x) native_tan(((float)x)) +#define expf(x) native_exp(((float)x)) +#define sqrtf(x) native_sqrt(((float)x)) +#define logf(x) native_log(((float)x)) +#else +#define sinf(x) sin(((float)x)) +#define cosf(x) cos(((float)x)) +#define tanf(x) tan(((float)x)) +#define expf(x) exp(((float)x)) +#define sqrtf(x) sqrt(((float)x)) +#define logf(x) log(((float)x)) +#endif + /* data lookup defines */ #define kernel_data (*kg->data) #define kernel_tex_fetch(t, index) kg->t[index] diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 1045b0add73..75151a32a65 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -92,23 +92,20 @@ CCL_NAMESPACE_BEGIN #endif #ifdef __KERNEL_OPENCL_AMD__ -#define __SVM__ -#define __EMISSION__ -#define __IMAGE_TEXTURES__ -#define __PROCEDURAL_TEXTURES__ -#define __EXTRA_NODES__ -#define __HOLDOUT__ -#define __NORMAL_MAP__ -//#define __BACKGROUND_MIS__ -//#define __LAMP_MIS__ -//#define __AO__ -//#define __ANISOTROPIC__ +#define __CL_USE_NATIVE__ +#define __KERNEL_SHADING__ +//__KERNEL_ADV_SHADING__ +#define __MULTI_CLOSURE__ +#define __TRANSPARENT_SHADOWS__ +#define __PASSES__ +#define __BACKGROUND_MIS__ +#define __LAMP_MIS__ +#define __AO__ +#define __ANISOTROPIC__ //#define __CAMERA_MOTION__ //#define __OBJECT_MOTION__ //#define __HAIR__ -//#define __MULTI_CLOSURE__ -//#define __TRANSPARENT_SHADOWS__ -//#define __PASSES__ +//end __KERNEL_ADV_SHADING__ #endif #ifdef __KERNEL_OPENCL_INTEL_CPU__ -- cgit v1.2.3