From d84b4becd3bce34b75385155535b17d77f68578a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Wed, 23 Mar 2022 22:01:32 +0100 Subject: Fix compile error on GCC Explicit template specialization has to happen outside of class definition (some compilers are more lenient). Since it is not possible to specialize the method without also specializing the enclosing class for all of its possible types, the method is moved outside of the class, and specialized there. --- intern/cycles/kernel/device/cpu/image.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'intern') diff --git a/intern/cycles/kernel/device/cpu/image.h b/intern/cycles/kernel/device/cpu/image.h index 94eeaed7698..ebddc1989bd 100644 --- a/intern/cycles/kernel/device/cpu/image.h +++ b/intern/cycles/kernel/device/cpu/image.h @@ -31,18 +31,19 @@ ccl_device_inline float frac(float x, int *ix) return x - (float)i; } -template struct TextureInterpolator { - template static ccl_always_inline ZeroT zero(); +template ccl_always_inline ZeroT zero(); - template<> static ccl_always_inline float zero() - { - return 0.0f; - } +template<> ccl_always_inline float zero() +{ + return 0.0f; +} - template<> static ccl_always_inline float4 zero() - { - return zero_float4(); - } +template<> ccl_always_inline float4 zero() +{ + return zero_float4(); +} + +template struct TextureInterpolator { static ccl_always_inline float4 read(float4 r) { -- cgit v1.2.3