Closed glalonde closed 4 years ago
I have noticed this myself too. The issue seems to trigger whenever we allocate a staging buffer to reupload vertices here:
There is an issue open in wgpu
that I think may be related: https://github.com/gfx-rs/wgpu-rs/issues/261. As mentioned there, downgrading gfx-memory
to 0.1.1
seems to fix the issue.
I think it may be a good idea to come up with an SSCCE that reproduces the issue with only wgpu
as a dependency and report it there.
Oh k, yeah that's definitely an allocator issue, thanks. I think you could fix this by persisting the staging buffer : p
I've been investigating frame stutter in a game and it seems to happen when drawing dynamic characters in this library. "dynamic" meaning characters that change every frame, e.g. FPS counter or score.
I've found that it takes ~10-50ms of CPU time sometimes, which is too much. According to Nvidia's profiler, this is coming from a vkAllocateMemory call. Any ideas what is going on here? I assume this has something to do with caching because of the dynamic aspect, but even when all I am doing is flipping between 0 and 1 displayed in alternating frames it takes 10s of ms. But when I show 0 twice or 1 twice, the second time doesn't cause stutter.
Could also be a faulty gpu memory allocator in wgpu/gfx-rs I suppose, but curious if you know offhand what this might be.