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.
This commit is contained in:
Kévin Dietrich 2022-03-23 22:01:32 +01:00
parent 945dfd200b
commit d84b4becd3
1 changed files with 12 additions and 11 deletions

View File

@ -31,18 +31,19 @@ ccl_device_inline float frac(float x, int *ix)
return x - (float)i;
}
template<typename ZeroT> ccl_always_inline ZeroT zero();
template<> ccl_always_inline float zero<float>()
{
return 0.0f;
}
template<> ccl_always_inline float4 zero<float4>()
{
return zero_float4();
}
template<typename TexT, typename OutT = float4> struct TextureInterpolator {
template<typename ZeroT> static ccl_always_inline ZeroT zero();
template<> static ccl_always_inline float zero()
{
return 0.0f;
}
template<> static ccl_always_inline float4 zero()
{
return zero_float4();
}
static ccl_always_inline float4 read(float4 r)
{