Closed phr00t closed 4 months ago
Example crash:
This commit: https://github.com/phr00t/FocusEngine/commit/1cba6b654b212ba5350ffb64d97b513cda048e68
... doesn't help flicker, but I'm hoping will help with the crashing, maybe.
I still got a "device lost" crashing error, but this time it was outside of shadow rendering (but same context resetting part of drawing). I'm still unsure why this happens, but at least it is very rare (which also makes it very hard to reproduce and debug).
I fixed it! The flickering was not actually related to shadows at all... shadows just increased the draw count enough to cause a buffer pool to be exhausted. Simply increasing the buffer pool larger solves the problem! I do not notice any significant increase of memory. I'm hoping this also resolves "device lost" Vulkan errors, but I suspect it doesn't. I'm closing this for now as "fixed" and may need to reopen some "device lost" issue later if that problem returns.
Fixed with https://github.com/phr00t/FocusEngine/commit/eb3ee01b72b6e64e1a238a4098d1226e9b9f883a
With a very high number of shadow casters and the directional shadow system, sometimes flicker begins to happen where rendering seems to get corrupted randomly... likely due to some multithreading problem. Occasionally, the Vulkan device will be lost during this instability. This very rarely happens even with reasonable shadow caster counts. Problem is greatly exacerbated when using multiple cascades.