--Bug fixes

-Fix improper usage of rand() in cpow2, cpow3, hypertile1, hypertile3D1, hypertile3D2, juliac, juliaq.
 -Fix program crashing during density filtering on some Nvidia cards.
 -hypertile3D1 was wrong.
 -Parsing phoenix_julia when coming from Apophysis was wrong.
 -Density filtering was freezing on certain Nvidia cards.

--Code changes
 -Optimize juliac, npolar.
 -Add a new function Crand() which behaves like the legacy C rand() which returns an integer between 0 and 32766, inclusive.
 -Use RandBit() in some places.
 -Remove Zeps() from vignette, it's not needed.
 -Restructure OpenCL code for density filtering such that it does not hang after being compiled on some Nvidia cards, such as the gtx 1660. Remove barriers from conditionals where possible.
This commit is contained in:
Person
2020-12-28 21:46:55 -08:00
parent d68deb1255
commit 47b6614c8a
18 changed files with 224 additions and 153 deletions

View File

@ -143,6 +143,26 @@ public:
return t;
}
/// <summary>
/// Legacy rand() in the C language returns a number in the range of (0, RAND_MAX], which yields 0-32766.
/// This function is used to simulate that behavior.
/// </summary>
/// <returns>The next random integer in the range of 0-32766 inclusive</returns>
inline T Crand()
{
return Rand(32767);
}
/// <summary
/// Locked version of Crand().
/// </summary>
inline T LockedCrand()
{
rlg l(*s_CS.get());
T t = GlobalRand->Crand();
return t;
}
/// <summary>
/// Return the next random integer between 0 and the value passed in minus 1.
/// </summary>