diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index d25830b3c48..11c7bc6f099 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -892,8 +892,16 @@ public: void tex_free(device_memory& mem) { - if(mem.data_pointer) + if(mem.device_pointer) { + foreach(const MemMap::value_type& value, mem_map) { + if(value.second == mem.device_pointer) { + mem_map.erase(value.first); + break; + } + } + mem_free(mem); + } } size_t global_size_round_up(int group_size, int global_size) diff --git a/intern/cycles/kernel/kernel_film.h b/intern/cycles/kernel/kernel_film.h index 8868a335037..721eceabc37 100644 --- a/intern/cycles/kernel/kernel_film.h +++ b/intern/cycles/kernel/kernel_film.h @@ -70,8 +70,8 @@ __device void kernel_film_convert_to_half_float(KernelGlobals *kg, /* buffer offset */ int index = offset + x + y*stride; - float4 *in = (float4*)(buffer + index*kernel_data.film.pass_stride); - half *out = (half*)rgba + index*4; + __global float4 *in = (__global float4*)(buffer + index*kernel_data.film.pass_stride); + __global half *out = (__global half*)rgba + index*4; float scale = kernel_data.film.exposure*sample_scale; float4_store_half(out, in, scale); diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 1afe8480616..5c4e812b496 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -468,7 +468,9 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R float min_ray_pdf = FLT_MAX; float ray_pdf = 0.0f; +#ifdef __LAMP_MIS__ float ray_t = 0.0f; +#endif PathState state; int rng_offset = PRNG_BASE_NUM; #ifdef __CMJ__ diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index f48fd1e124b..a8f514864db 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -545,10 +545,7 @@ template __device_inline const __m12 #ifdef __KERNEL_OPENCL__ -__device_inline void float4_store_half(half *h, const float4 *f, float scale) -{ - vstore_half4(*f * scale, 0, h); -} +#define float4_store_half(h, f, scale) vstore_half4(*(f) * (scale), 0, h); #else