Cycles: Fix Extend image extension mode on OpenCL
This commit is contained in:
@@ -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);
|
nix = svm_image_texture_wrap_periodic(ix+1, width);
|
||||||
niy = svm_image_texture_wrap_periodic(iy+1, height);
|
niy = svm_image_texture_wrap_periodic(iy+1, height);
|
||||||
}
|
}
|
||||||
else if(extension == EXTENSION_CLIP) {
|
else {
|
||||||
if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f)
|
if(extension == EXTENSION_CLIP) {
|
||||||
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
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);
|
|
||||||
|
|
||||||
nix = svm_image_texture_wrap_clamp(ix+1, width);
|
nix = svm_image_texture_wrap_clamp(ix+1, width);
|
||||||
niy = svm_image_texture_wrap_clamp(iy+1, height);
|
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);
|
r = (1.0f - ty)*(1.0f - tx)*svm_image_texture_read(kg, id, offset + ix + iy*width);
|
||||||
|
|||||||
Reference in New Issue
Block a user