diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_image_opencl.h')
-rw-r--r-- | intern/cycles/kernel/kernel_image_opencl.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_image_opencl.h b/intern/cycles/kernel/kernel_image_opencl.h index 0352c58037d..15579f55a41 100644 --- a/intern/cycles/kernel/kernel_image_opencl.h +++ b/intern/cycles/kernel/kernel_image_opencl.h @@ -20,18 +20,19 @@ ccl_device_inline float4 svm_image_texture_read(KernelGlobals *kg, int id, int offset) { + const texture_type = kernel_tex_type(id); /* Float4 */ - if(id < TEX_START_BYTE4_OPENCL) { + if(texture_type == IMAGE_DATA_TYPE_FLOAT4) { return kernel_tex_fetch(__tex_image_float4_packed, offset); } /* Byte4 */ - else if(id < TEX_START_FLOAT_OPENCL) { + else if(texture_type == IMAGE_DATA_TYPE_BYTE4) { uchar4 r = kernel_tex_fetch(__tex_image_byte4_packed, offset); float f = 1.0f/255.0f; return make_float4(r.x*f, r.y*f, r.z*f, r.w*f); } /* Float */ - else if(id < TEX_START_BYTE_OPENCL) { + else if(texture_type == IMAGE_DATA_TYPE_FLOAT) { float f = kernel_tex_fetch(__tex_image_float_packed, offset); return make_float4(f, f, f, 1.0f); } |