Commit: b99f7a9b2aec906fea7528223e15b3fb8c23c9cc
Author: Sergey Sharybin
Date:   Mon Jul 11 14:46:42 2016 +0200
Branches: master
https://developer.blender.org/rBb99f7a9b2aec906fea7528223e15b3fb8c23c9cc

Cycles: Fix Extend image extension mode on OpenCL

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

M       intern/cycles/kernel/svm/svm_image.h

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

diff --git a/intern/cycles/kernel/svm/svm_image.h 
b/intern/cycles/kernel/svm/svm_image.h
index 6a22488..4473273 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -115,16 +115,16 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, 
int id, float x, float y,
                        nix = svm_image_texture_wrap_periodic(ix+1, width);
                        niy = svm_image_texture_wrap_periodic(iy+1, height);
                }
-               else if(extension == EXTENSION_CLIP) {
-                       if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f)
-                               return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
-               }
-               else { /* EXTENSION_EXTEND */
-                       ix = svm_image_texture_wrap_clamp(ix, width);
-                       iy = svm_image_texture_wrap_clamp(iy, height);
-
+               else {
+                       if(extension == EXTENSION_CLIP) {
+                               if(x < 0.0f || y < 0.0f || x > 1.0f || y > 
1.0f) {
+                                       return make_float4(0.0f, 0.0f, 0.0f, 
0.0f);
+                               }
+                       }
                        nix = svm_image_texture_wrap_clamp(ix+1, width);
                        niy = svm_image_texture_wrap_clamp(iy+1, height);
+                       ix = svm_image_texture_wrap_clamp(ix, width);
+                       iy = svm_image_texture_wrap_clamp(iy, height);
                }
 
                r = (1.0f - ty)*(1.0f - tx)*svm_image_texture_read(kg, id, 
offset + ix + iy*width);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to