diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-28 15:04:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-28 15:04:27 +0300 |
commit | 8f4166ee495531fa38b676b0a5ef4c482e89f9a5 (patch) | |
tree | a2c8af463cb4abde1659574778e1c63a2b102dfd /intern/cycles/kernel/kernel_image_opencl.h | |
parent | e3fc945fe2ba1883bd706c1fd04acce83c3529c3 (diff) |
Cycles: Fix image textures were completely broken since recent unlimited textures commit
The indexing was totally wrong in both image packing code and image sampling in kernel.
Fixes T51341: Cycles OpenCL corruption in todays buildbot
Diffstat (limited to 'intern/cycles/kernel/kernel_image_opencl.h')
-rw-r--r-- | intern/cycles/kernel/kernel_image_opencl.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_image_opencl.h b/intern/cycles/kernel/kernel_image_opencl.h index 15579f55a41..c1ac39e7f1e 100644 --- a/intern/cycles/kernel/kernel_image_opencl.h +++ b/intern/cycles/kernel/kernel_image_opencl.h @@ -66,7 +66,8 @@ ccl_device_inline float svm_image_texture_frac(float x, int *ix) ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y) { - uint4 info = kernel_tex_fetch(__tex_image_packed_info, id*2); + const int texture_id = kernel_tex_index(id); + uint4 info = kernel_tex_fetch(__tex_image_packed_info, texture_id*2); uint width = info.x; uint height = info.y; uint offset = info.z; @@ -140,11 +141,12 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, fl ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x, float y, float z) { - uint4 info = kernel_tex_fetch(__tex_image_packed_info, id*2); + const int texture_id = kernel_tex_index(id); + uint4 info = kernel_tex_fetch(__tex_image_packed_info, texture_id*2); uint width = info.x; uint height = info.y; uint offset = info.z; - uint depth = kernel_tex_fetch(__tex_image_packed_info, id*2+1).x; + uint depth = kernel_tex_fetch(__tex_image_packed_info, texture_id*2+1).x; /* Image Options */ uint interpolation = (info.w & (1 << 0)) ? INTERPOLATION_CLOSEST : INTERPOLATION_LINEAR; |