Commit Graph

3350 Commits

Author SHA1 Message Date
Ivan Avdeev
1bf6f6ee74 vk: profiler: extract gpu timestamps in a generic manner 2023-04-10 10:24:57 -07:00
Ivan Avdeev
73a6cf596a vk: init combuf
it does just work lol
2023-04-10 10:24:57 -07:00
Ivan Avdeev
4bd62ccbc0 [draft] vk: start refactoring commandbuffer/gpu profiler
Consolidate VkCommandBuffer management into a single entity. (somewhat
done for framectl, not done for staging)

Make sure that we pass enough metadata to be able to timestamp scopes in
cmdbuf.

It does compile, but it won't work: not all init code paths are used.
Also, there are many changes, so other failure modes are totally
possible.
2023-04-10 10:24:57 -07:00
Ivan Avdeev
5c7bd9d285 vk: profiler: add low/hi watermarks for frame time graph 2023-03-29 11:59:22 -07:00
Ivan Avdeev
cea37acfd2 vk: profiler: add width, and other improvements
- r_speeds_graphs_width now can be used to limit graphs width
- tweak layout slightly
- improve range printing based on metric semantic
2023-03-29 11:59:22 -07:00
Ivan 'provod' Avdeev
b5dfef5574 vk: profiler: scale graphs properly
respect dpi scale
2023-03-29 11:59:22 -07:00
Ivan Avdeev
adab64b797 vk: profiler: make graphs thin, add background 2023-03-29 11:59:22 -07:00
Ivan Avdeev
33aa4bc259 vk: profiler: add cvar for selecting metrics to plot
also:
- invert graphs
- add text labels
- fix vertical gaps
2023-03-29 11:59:22 -07:00
Ivan Avdeev
af96609c04 vk: profiler: automatic graph range 2023-03-29 11:59:22 -07:00
Ivan Avdeev
2b2e69da72 vk: profiler: start implementing universal metric graphs 2023-03-29 11:59:22 -07:00
Ivan Avdeev
8afd23a2d4 vk: profiler: clear metrics explicitly 2023-03-25 12:03:41 -07:00
Ivan Avdeev
1ae3ae4774 vk: profiler: register scopes and cpu/frame/gpu times as metrics
Make all the numbers we show as universal metrics
2023-03-25 12:03:41 -07:00
Ivan Avdeev
89f49276a5 vk: profiler: add beams count metric 2023-03-25 12:03:41 -07:00
Ivan Avdeev
68761fbbbb vk: profiler: add sprites count metric 2023-03-25 12:03:41 -07:00
Ivan Avdeev
2976f753e1 vk: profiler: add more lights metrics 2023-03-25 12:03:41 -07:00
Ivan Avdeev
2db83a22a5 vk: profiler: add studio models count metric 2023-03-25 12:03:41 -07:00
Ivan Avdeev
f2ebcd663b vk: profiler: explicit metric types; also more metrics 2023-03-25 12:03:41 -07:00
Ivan Avdeev
8ecfae5bf0 vk: profiler: simplify metric registration 2023-03-25 12:03:41 -07:00
Ivan Avdeev
cdc2a1258a vk: profiler: add staging stats 2023-03-25 12:03:41 -07:00
Ivan Avdeev
3b47c7315a vk: profiler: add dynamic model count 2023-03-25 12:03:41 -07:00
Ivan Avdeev
160a69d2cc vk: profiler: add BLAS stats 2023-03-25 12:03:41 -07:00
Ivan Avdeev
e0e9305628 vk: profiler: add a way to add arbitrary metrics to profiler 2023-03-25 12:03:41 -07:00
Ivan Avdeev
576b4163b9 vk: profiler: rename slows to speeds (enough kekage) 2023-03-25 12:03:41 -07:00
Ivan 'provod' Avdeev
5f38f3467d rt: originate ray on the near plane
fixes #63

also, compute max distance based on the far plane distance
2023-03-24 14:04:30 -07:00
Ivan 'provod' Avdeev
4a5fc186ea vk: profiler: fixup incorrect __FUNCTION__ macro usage
No idea how it could work before
2023-03-21 11:59:57 -07:00
Ivan Avdeev
e1afb2a9de vk: profiler: collect and display ref cpu busy and waiting times 2023-03-21 11:59:57 -07:00
Ivan Avdeev
5d23494cfc vk: profiler: use existing R_SpeedsMessage to display profiling data 2023-03-21 11:59:57 -07:00
Ivan Avdeev
9d8ec1bc9d vk: profiler: control profiler with r_speeds command
use bits to enable particular performance data display:
0 -- off
1 -- simple frame time
2 -- more object count and sizes statistics (TODO)
4 -- overall gpu usage (TODO)
8 -- extended intra-frame data, function times graph, etc
2023-03-21 11:59:57 -07:00
Ivan Avdeev
55af70c422 vk: profiler: remove noisy printf 2023-03-21 11:59:57 -07:00
Ivan Avdeev
bcb1d367b9 vk: profiler: refactor plotting functions slightly 2023-03-21 11:59:57 -07:00
Ivan Avdeev
2b8f74ff0e vk: profiler: minor cleanup 2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
b4b63492f2 vk: profiler: fixup time scaling on windows 2023-03-21 11:59:57 -07:00
Ivan Avdeev
22d4202ad9 vk: profiler: draw total gpu time
Use VK_EXT_calibrated_timestamps to convert to host time.
2023-03-21 11:59:57 -07:00
Ivan Avdeev
a66c44a266 vk: convert query timestamps to ns
also, fix linux build
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
93a539df74 vk: display gpu time taken for a previous frame
its value will be incorrect for non-nv cards which have non-1 timestampPeriod
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
be95b65b22 vk: add better scope macro for profiler
also cover synchrnoized slow uploading for staging
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
9a5e1fec4a vk: scale profiling bars the same way the font is scale
make sizes consistent with the default font on hidpi displays
2023-03-21 11:59:57 -07:00
Ivan Avdeev
2872b4d237 vk: add profiling pause, add swapchain acquire scope 2023-03-21 11:59:57 -07:00
Ivan Avdeev
1c9ff300a9 vk: draw profiler scope blocks
also add a couple more scopes to rendering
2023-03-21 11:59:57 -07:00
Ivan Avdeev
be59d1d8e9 vk: tune profiler colors and animation a bit 2023-03-21 11:59:57 -07:00
Ivan Avdeev
39f2d78199 vk: start refactoring profiler
Convert direct stack manipulation to simple and cheap event writing.
Draw rudimentary frame times graph.

Related to #412
2023-03-21 11:59:57 -07:00
NightFox
190a691c6d Add simple soft shadows by @LifeKILLED
This is a temporary solution.
2023-03-18 11:39:56 -07:00
NightFox
e5658f59cd
Update rads & patches (#479) 2023-03-18 11:38:11 -07:00
Ivan Avdeev
01de5957d8
vk: respect TF_NEAREST/CLAMP/BORDER flags (#471)
Use these flags to pick the right sampler. Fixes issues with blurry and leaking fonts, lines in main menu tiles, etc.

fixes #439, fixes #79
2023-03-08 14:16:21 -08:00
Ivan 'provod' Avdeev
6d7fd41494 rt: increase model cache size, fix #449
Apparently just increasing the model cache size limit is fine.
"LRU" cache eviction was not even used when testing.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
21534c044b rt: fix uploading too many light cells, fix #451
c5a1 has ~230k light cells, and tries to upload 77MiB of them. Previous staging size of 64MiB wasn't enough.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
62392ac4b6 rt: increase kusochki limit to 32768, fix #85
boot_camp worldmodel has ~11k surfaces, which means it will need at least 22k kusochki for 1:1 static:dynamic split.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
c1483216ef rt: increase MAX_ACCELS to 2048, fix #366
test_shaders_room3 has lots of sprites, and currently we create a new BLAS for each sprite.
This is not great, and a proper fix would probably mean consolidating all dynamic transparent things into BLASes per render mode or something. But for now we can just increase the limit
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
78a1b24e11 rt: enable entity light, fix #115 2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
dc698c16dc vk: make sure deleted textures are not referenced in staging
This fixes -vkvalidate and fixes #464
2023-03-04 12:46:37 -08:00