On Thu Apr 4 14:14:51 2024 +0000, Elizabeth Figura wrote:
Rebased, moved the periodic submit to wined3d_context_vk_get_command_buffer(), and added a related fix. Concerning performance:
- From my understanding (mostly informed by discussion with Arek Hiler),
even recent hardware has serious reliability problems with rdtsc. Some of those problems go away for our more limited use case of measuring time differences, but not all do. E.g. it's possible for two cores to become seriously offset from each other, and unless we were to pin the CS to a single thread (dubious) that would mean our measurements could be constantly broken.
- On my machine, one call to QueryPerformanceCounter() seems to take
about 80 ns.
- I constructed a simple benchmark that just makes a bunch of draw calls
per frame (and nothing else). That benchmark is artificial, shows a consistent performance hit from this commit: 10000 draws: 217 vs 183 2000 draws: 860 vs 772 500 draws: 1900 vs 1840
- I can't perceive a difference in Grounded, however. This may be
because Grounded doesn't call the function enough [it makes about 4200 draw calls per frame, at least in the scene I was testing, and that ends up being about 14600 calls to wined3d_context_vk_get_command_buffer()], or because the CS thread isn't a bottleneck [but it is pretty consistently at at least 90% CPU], or because the game's performance is too variable to measure. If we are worried about performance—and I'm not really sure whether to be worried—then I'm open to trying the aforementioned approach with a separate submit thread.
Re Grounded, what was the improvement vs not submitting? You're not seeing a difference between QueryPerformanceCounter and rdtsc?