From d784568805732fd7929c93cf30b7df7c07a16e5e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 5 Oct 2015 12:40:50 +0500 Subject: Cycles: Fix missing z-coordinate check in volume sampling --- intern/cycles/kernel/kernel_compat_cpu.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'intern/cycles/kernel/kernel_compat_cpu.h') diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index ed145b4a967..7908293589a 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -279,7 +279,9 @@ template struct texture_image { iz = wrap_periodic(iz, depth); break; case EXTENSION_CLIP: - if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) { + if (x < 0.0f || y < 0.0f || z < 0.0f || + x > 1.0f || y > 1.0f || z > 1.0f) + { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } /* Fall through. */ @@ -308,7 +310,9 @@ template struct texture_image { niz = wrap_periodic(iz+1, depth); break; case EXTENSION_CLIP: - if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) { + if (x < 0.0f || y < 0.0f || z < 0.0f || + x > 1.0f || y > 1.0f || z > 1.0f) + { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } /* Fall through. */ @@ -363,7 +367,9 @@ template struct texture_image { nniz = wrap_periodic(iz+2, depth); break; case EXTENSION_CLIP: - if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) { + if (x < 0.0f || y < 0.0f || z < 0.0f || + x > 1.0f || y > 1.0f || z > 1.0f) + { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } /* Fall through. */ -- cgit v1.2.3