[Bf-blender-cvs] [3902bebf180] master: Cycles: make smart interpolation fallback to cubic for GPU

Ethan-Hall noreply at git.blender.org
Fri Mar 11 18:28:05 CET 2022


Commit: 3902bebf1809e4243b2184852aeb82e57ca68421
Author: Ethan-Hall
Date:   Fri Mar 11 14:26:01 2022 +0100
Branches: master
https://developer.blender.org/rB3902bebf1809e4243b2184852aeb82e57ca68421

Cycles: make smart interpolation fallback to cubic for GPU

Matching CPU and Eevee behavior.

Differential Revision: https://developer.blender.org/D14296

===================================================================

M	intern/cycles/kernel/device/gpu/image.h

===================================================================

diff --git a/intern/cycles/kernel/device/gpu/image.h b/intern/cycles/kernel/device/gpu/image.h
index 9c92f6a693c..83e7aa869c1 100644
--- a/intern/cycles/kernel/device/gpu/image.h
+++ b/intern/cycles/kernel/device/gpu/image.h
@@ -186,7 +186,7 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, flo
   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) {
+    if (info.interpolation == INTERPOLATION_CUBIC || info.interpolation == INTERPOLATION_SMART) {
       return kernel_tex_image_interp_bicubic<float4>(info, x, y);
     }
     else {
@@ -198,7 +198,7 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, flo
   else {
     float f;
 
-    if (info.interpolation == INTERPOLATION_CUBIC) {
+    if (info.interpolation == INTERPOLATION_CUBIC || info.interpolation == INTERPOLATION_SMART) {
       f = kernel_tex_image_interp_bicubic<float>(info, x, y);
     }
     else {
@@ -241,7 +241,7 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg,
 #endif
   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) {
+    if (interpolation == INTERPOLATION_CUBIC || interpolation == INTERPOLATION_SMART) {
       return kernel_tex_image_interp_tricubic<float4>(info, x, y, z);
     }
     else {
@@ -252,7 +252,7 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg,
   else {
     float f;
 
-    if (interpolation == INTERPOLATION_CUBIC) {
+    if (interpolation == INTERPOLATION_CUBIC || interpolation == INTERPOLATION_SMART) {
       f = kernel_tex_image_interp_tricubic<float>(info, x, y, z);
     }
     else {



More information about the Bf-blender-cvs mailing list