From d8066fb0f145395594d0a952a4c0f70206dc0214 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Sun, 5 Nov 2017 21:43:23 +0100 Subject: Cycles: Refactor closure roughness detection to fix a potential bug with Denoising of specular shaders --- intern/cycles/util/util_math.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'intern/cycles/util') diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index fb04d49bcd9..39ce6a93982 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -518,6 +518,11 @@ ccl_device float safe_modulo(float a, float b) return (b != 0.0f)? fmodf(a, b): 0.0f; } +ccl_device_inline float sqr(float a) +{ + return a * a; +} + ccl_device_inline float beta(float x, float y) { #ifndef __KERNEL_OPENCL__ -- cgit v1.2.3