Merge branch 'blender-v3.2-release'
This commit is contained in:
@@ -74,9 +74,9 @@ struct half4 {
|
||||
ccl_device_inline half float_to_half_image(float f)
|
||||
{
|
||||
#if defined(__KERNEL_METAL__)
|
||||
return half(f);
|
||||
return half(min(f, 65504.0f));
|
||||
#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__)
|
||||
return __float2half(f);
|
||||
return __float2half(min(f, 65504.0f));
|
||||
#else
|
||||
const uint u = __float_as_uint(f);
|
||||
/* Sign bit, shifted to its position. */
|
||||
@@ -137,9 +137,9 @@ ccl_device_inline float4 half4_to_float4_image(const half4 h)
|
||||
ccl_device_inline half float_to_half_display(const float f)
|
||||
{
|
||||
#if defined(__KERNEL_METAL__)
|
||||
return half(f);
|
||||
return half(min(f, 65504.0f));
|
||||
#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__)
|
||||
return __float2half(f);
|
||||
return __float2half(min(f, 65504.0f));
|
||||
#else
|
||||
const int x = __float_as_int((f > 0.0f) ? ((f < 65504.0f) ? f : 65504.0f) : 0.0f);
|
||||
const int absolute = x & 0x7FFFFFFF;
|
||||
|
Reference in New Issue
Block a user