Fix T92103: Update BLI hash_float_to_float functions to be shader compatible

Previously the functions called `hash_float` instead of `uint_to_float_01`.
This meant that the float was hashed twice instead of once.
The new functions are also compatible with Cycles/Eevee.

Differential Revision: https://developer.blender.org/D12832
This commit is contained in:
Charlie Jolly
2021-10-11 21:59:04 +01:00
committed by Charlie Jolly
parent ca8e8fd8d4
commit e005ad5b54

View File

@@ -222,22 +222,22 @@ float hash_to_float(uint32_t kx, uint32_t ky, uint32_t kz, uint32_t kw)
float hash_float_to_float(float k)
{
return hash_to_float(hash_float(k));
return uint_to_float_01(hash_float(k));
}
float hash_float_to_float(float2 k)
{
return hash_to_float(hash_float(k));
return uint_to_float_01(hash_float(k));
}
float hash_float_to_float(float3 k)
{
return hash_to_float(hash_float(k));
return uint_to_float_01(hash_float(k));
}
float hash_float_to_float(float4 k)
{
return hash_to_float(hash_float(k));
return uint_to_float_01(hash_float(k));
}
/* ------------