forked from bartvdbraak/blender
Fix cycles OpenCL compile error on AMD, and fix assert in debug builds.
This commit is contained in:
parent
8e70db78f4
commit
cbb783f1d6
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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__
|
||||
|
@ -545,10 +545,7 @@ template<size_t i0, size_t i1, size_t i2, size_t i3> __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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user