Closed theAfish closed 2 years ago
Could be a different handling for out-of-bound color values. Can you try to clamp the values between 0 and 1 and check whether they have the same output?
Not work. I believe this is not because of coloring of the "img field", since once the "white square" appears, it won't disappear in the following frames. And this will make my simulation based on the noise unstable in the vulkan backend but not in gpu/cpu backend.
I think it's because of floating overflow on vulkan backend, the randn
function can return arbitrarily large float in 32-bit range, and multiplying them together may result in overflow. The squares dissapear if one clamps phi
to a small range like [-10, 10]
.
Thank you very much!
I am writing a simulation based on blurring Gaussian noise field and happen to find the simulation is abnormal in vulkan backend but works fine in GPU and CPU backend (Please see the screenshots below).
To Reproduce Here's a sample code extracted from my code
Log/Screenshots Let the code run for several seconds and I can see something different Running with GPU/CPU:
Running with vulkan:
The log for vulkan, GPU, and CPU are all the same:
Additional comments