Gfx.WaitForPresentOnGfxThread costing over 30ms at RANDOM
I've looked around for reasons and/or solutions and all I could find were people claiming they only had issues within the editor. I however am getting these same completely random performance spikes on builds, x86 and 64 bit, regardless of hardware. I've tried disabling stuff in the scene to no avail - sometimes disabling the JeepFox does it, sometimes disabling all NPCs, sometimes disabling Water4. It's no use. Here are some screenshots of the profiler showing the issue. Note that the issue persists in Editor, with profiler on and off, and in build.
The next frame:
Then, suddenly, it goes back to normal..
.. only to get even worse a few seconds after that.
I'm really at a loss here. I've been working on this project since January of last year non-stop, always keeping the Unity version in use up-to-date. I've seen people suggest it's the GPU waiting for the CPU, because the CPU is too slow - if that were the case then it wouldn't be 90% of the CPU time dedicated to just waiting, now would it? Nor would it fluctuate as randomly as it does. Obviously 15 frames per second is unacceptable for any kind of game, especially a first person shooter, so I really need this fixed in the next few months. I saw it marked as a bug introduced in some version of 2019, then fixed in another one, only to be fixed again in Unity 2020? How do you fix the same thing twice? Unless it was never fixed. Is there ANYTHING I can do to at least remedy this terrible performance without mechanically or visually downgrading my game? I'm running it on Vulkan as you can see on the first screenshot, and with as few packages as possible.
On a side note, all the thumbnails for assets in the project (materials, models, terrain layers, etc) are now just black squares. Reimporting all assets fixes it for the current Unity instance, but the moment I close and re-open it again they're all black once more. That, and I'm getting a LOT of "Requesting non existent keyword at index [number]" errors on startup. Both of these might be relevant, but I have no idea. Really, I'd just like for everything to work again...
BY THE WAY: I am fine with buying an asset that fixes this issue if that's the only solution present at the moment. Just putting it out there. Also, here's an example of the Gfx.WaitForPresentOnGfxThread making everything even worse:
Your answer
Follow this Question
Related Questions
AICharacterControl Spike in Profiler 0 Answers
Mobile Performance Issues 0 Answers
3D Optimization Problem 1 Answer
Horrible Lag spike when Looking at an object that's showing GUI 1 Answer