Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/device/gpu/image.h
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | case INTERPOLATION_LINEAR: | ||||
| return SampleFromVoxels<AccessorType, 1, false>(acc)(Vec3f(x - 0.5f, y - 0.5f, z - 0.5f)); | return SampleFromVoxels<AccessorType, 1, false>(acc)(Vec3f(x - 0.5f, y - 0.5f, z - 0.5f)); | ||||
| default: | default: | ||||
| SampleFromVoxels<AccessorType, 1, false> s(acc); | SampleFromVoxels<AccessorType, 1, false> s(acc); | ||||
| return kernel_tex_image_interp_tricubic_nanovdb<T>(s, x - 0.5f, y - 0.5f, z - 0.5f); | return kernel_tex_image_interp_tricubic_nanovdb<T>(s, x - 0.5f, y - 0.5f, z - 0.5f); | ||||
| } | } | ||||
| } | } | ||||
| #endif | #endif | ||||
| ccl_device float4 kernel_tex_image_interp(const KernelGlobals *kg, int id, float x, float y) | ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, float y) | ||||
| { | { | ||||
| const TextureInfo &info = kernel_tex_fetch(__texture_info, id); | const TextureInfo &info = kernel_tex_fetch(__texture_info, id); | ||||
| /* float4, byte4, ushort4 and half4 */ | /* float4, byte4, ushort4 and half4 */ | ||||
| const int texture_type = info.data_type; | const int texture_type = info.data_type; | ||||
| if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 || | 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) { | texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) { | ||||
| if (info.interpolation == INTERPOLATION_CUBIC) { | if (info.interpolation == INTERPOLATION_CUBIC) { | ||||
| Show All 15 Lines | else { | ||||
| ccl_gpu_tex_object tex = (ccl_gpu_tex_object)info.data; | ccl_gpu_tex_object tex = (ccl_gpu_tex_object)info.data; | ||||
| f = ccl_gpu_tex_object_read_2D<float>(tex, x, y); | f = ccl_gpu_tex_object_read_2D<float>(tex, x, y); | ||||
| } | } | ||||
| return make_float4(f, f, f, 1.0f); | return make_float4(f, f, f, 1.0f); | ||||
| } | } | ||||
| } | } | ||||
| ccl_device float4 kernel_tex_image_interp_3d(const KernelGlobals *kg, | ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg, | ||||
| int id, | int id, | ||||
| float3 P, | float3 P, | ||||
| InterpolationType interp) | InterpolationType interp) | ||||
| { | { | ||||
| const TextureInfo &info = kernel_tex_fetch(__texture_info, id); | const TextureInfo &info = kernel_tex_fetch(__texture_info, id); | ||||
| if (info.use_transform_3d) { | if (info.use_transform_3d) { | ||||
| P = transform_point(&info.transform_3d, P); | P = transform_point(&info.transform_3d, P); | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||