From f01bc597a8e6bf5df19f1af0c422918c96b25e41 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 26 Feb 2020 17:31:33 +0100 Subject: Cleanup: stop encoding image data type in slot index This is legacy code from when we had a fixed number of textures. --- intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h | 4 ++-- intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h | 4 ++-- intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'intern/cycles/kernel/kernels') diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 8f311baf010..7eb66b0b4ca 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -474,7 +474,7 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, fl { const TextureInfo &info = kernel_tex_fetch(__texture_info, id); - switch (kernel_tex_type(id)) { + switch (info.data_type) { case IMAGE_DATA_TYPE_HALF: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_BYTE: @@ -503,7 +503,7 @@ ccl_device float4 kernel_tex_image_interp_3d( { const TextureInfo &info = kernel_tex_fetch(__texture_info, id); - switch (kernel_tex_type(id)) { + switch (info.data_type) { case IMAGE_DATA_TYPE_HALF: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_BYTE: diff --git a/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h b/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h index 7c68f08ea10..24bc3c7b59e 100644 --- a/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h +++ b/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h @@ -124,7 +124,7 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, fl CUtexObject tex = (CUtexObject)info.data; /* float4, byte4, ushort4 and half4 */ - const int texture_type = kernel_tex_type(id); + const int texture_type = info.data_type; if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 || texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) { if (info.interpolation == INTERPOLATION_CUBIC) { @@ -156,7 +156,7 @@ ccl_device float4 kernel_tex_image_interp_3d( CUtexObject tex = (CUtexObject)info.data; uint interpolation = (interp == INTERPOLATION_NONE) ? info.interpolation : interp; - const int texture_type = kernel_tex_type(id); + const int texture_type = info.data_type; if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 || texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) { if (interpolation == INTERPOLATION_CUBIC) { diff --git a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h index b6390679331..f7dea383b82 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h +++ b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h @@ -47,7 +47,7 @@ ccl_device_inline float4 svm_image_texture_read(KernelGlobals *kg, int id, int offset) { - const int texture_type = kernel_tex_type(id); + const int texture_type = info->data_type; /* Float4 */ if (texture_type == IMAGE_DATA_TYPE_FLOAT4) { -- cgit v1.2.3