PoC: feat(gui): add developer diagnostics - #73
Conversation
70e3493 to
a5630d1
Compare
|
Fixed the linter warning about the shadowed symbol. |
|
@ralgar I've added a few draft PRs ontop of this to give you a glimpse of what follows. Feel free to look into them and comment but do not consider them final until rebased on top of the previous merge. |
|
Hey, I've had a proper look through #73 and I think I'd like to split this up a bit. I'm pretty happy with the GUI changes (the tabs and log buffer) and would like to get those separated out so I can merge them, pending a couple of minor changes. They actually fit well with the GUI work I was already planning. :D For the Vulkan resource tracking, though, I think I'd rather take that part on myself. There are some architectural/performance concerns I have with the current approach, particularly around tracking every image and putting a shared mutex into the rendering/command-recording path. I have a fairly specific direction in mind for how I want to approach the depth-image side of this, so I'd rather implement that part myself than have you rework the current tracker. More generally, I'm happy for you to keep contributing fixes and smaller features, but I'd like to discuss larger architectural changes before they're implemented. Opening an issue to discuss the approach first would probably be a good way to handle that. There are a few areas of the project where I already have plans for the underlying architecture, and I'd rather coordinate those up front. So, for #73, I'd suggest splitting out the first two commits and putting the resource-tracking side on hold for now. I also need to slow down a bit on new feature work while I catch up with the existing bugs and tech debt from my initial hack-a-thon. My priority right now is getting to a stable v0.1. The only major feature I consider necessary before that is the preset/uniform integration I'm currently working on, and I'd like to keep the scope tightly controlled until we get there. Pretty much everything until then should be fixes, cleanup, and small QoL features. I haven't looked at your other PRs in detail yet, but scope-wise they're all fine I think. |
|
Yeah sure, please let me know, how to split. The resource tracking has actually been a very late addition to my patch queue. I added it to better understand what's going on. I just bundled it up with the other changes as one first diagnostic tool. While working on that, I discovered that the actually is a "File" menu, but I'm not sure how it works or what it does. It certainly can clear the effects list. :-D For the resource tracking itself, yes, please go on with your own idea. You know your ideas, plans and current remaining code bugs best. Actually, it feels better, if the bigger integrations are made by you. No rush please. I can easily rebase my pending commits onto your work until then. The only thing that's current left for me would be depth buffer access. I didn't want to add that before understanding the buffers. But that can wait, I have other projects running that could need some attention. ;-) For now:
Again, no rush. vkShade is a great project. But my local changes can stay rebased until the next project phase starts. For my effects list, I currently only need the bit depth variable. For some near future ideas, I would need depth buffer access but I can hack that on locally for now. So, please, do not feel rushed. Rather understand my PRs as an idea what might be needed next but stay with your own decisions about the implementation details. I keep my PRs updated until they become obsolete or you feel like they could go in and comment on them. Let me know if I can prioritize things for the v0.1 release. We could create issues about pending issues to coordinate work, and create a Github milestone. Thanks a lot for this project, and keeping it alive. You probably know, why you created it: Other projects became stale, or were missing ideas, and it's just fun to approach new ideas and improve skills. I that spirit, I will keep sharing my ideas - with no requirement or expectations to get them merged fast or as-is. |
From this, I get that I should extract those changes into a new PR. I will do that later today, stay tuned. |
|
Demoted to draft. BTW: I'm fine with throwing code designs away or redesigning them - no worries on your side, there will be no wasted effort on my side, because every effort is learning. ;-) If you feel a different architectural approach is needed, I very much appreciate that feedback. I now created another PR instead, containing only the tabbed GUI and live log. The colorization commit has been excluded from it for now: Let me know if you want to include it. |
|
As a final note: I think my implementation is still useful as a proof of concept and provider of functional insights which can give valuable feedback for a final design. So I leave it open as a draft and keep the branch available until it is obsoleted by current code. |
f4e56f9 to
f24d5dd
Compare
Track application, swapchain, and vkShade-owned images per device. Resolve image views and framebuffer attachments while observing both classic render passes and dynamic rendering. Keep diagnostics thread-safe and observational so tracking failures do not alter application Vulkan calls.
Show device-scoped render image snapshots between the Effects and Log tabs. Include factual origin, role, extent, type, format, sample, mip, layer, usage, and observation metadata. Refresh the table only while visible and keep semantic classifications out of this initial diagnostics view.
Add soft filters for color, depth/stencil, storage, swapchain, and internal images. Combine active categories with OR and move matching rows ahead of the existing stable order without hiding other resources. Show the prioritized and total image counts so the resulting grouping remains explicit.
Use the theme's disabled text color for rows below the soft-filter priority group. Keep all resources visible while making the selected categories visually distinct.
Record timestamp queries around the complete vkShade render path and its effect chain. Read the previous sample only after the existing per-swapchain fence wait, so enabling diagnostics does not introduce another synchronization point. Create the query pool lazily and record timestamps only while the performance overlay is requested. Account for devices exposing fewer than 64 valid timestamp bits, including counter wraparound.
Add a View-menu toggle for a non-interactive HUD that remains visible while the main window is closed. Show current, average, minimum, and maximum GPU time over the latest 120 samples for the complete vkShade path, the effect chain, and remaining work. Use a renderer sequence to ingest each query result once and reset the rolling windows when timing becomes unavailable.
f24d5dd to
9d49d91
Compare
|
@ralgar Updated with a few new ideas. |
Summary
Add developer-oriented Vulkan resource and performance diagnostics to the vkShade overlay.
This remains a draft proof of concept. The image tracker provides a concrete reference for the required metadata and GUI workflows, while the final resource and depth architecture may be replaced by the maintainer's planned implementation.
The branch is kept current so that functionality can be compared against new upstream work and removed as equivalent facilities become available.
Vulkan image tracking
Add device-scoped image tracking for:
The tracker records factual metadata including:
Tracking is observational. Errors are caught and logged without changing Vulkan calls, return values, or application-visible behavior.
Buffers panel
Add a Buffers tab containing a scrollable image table.
Soft category controls can prioritize:
Active categories use OR matching and stable partitioning. Non-matching images remain visible in their original order and use the theme's disabled text color.
Snapshots are refreshed only while the panel is visible and the table uses
ImGuiListClipperfor large image lists.GPU timing
Measure GPU time using Vulkan timestamp queries around:
The query pool is created lazily and timestamps are recorded only while the performance HUD is enabled. Results are collected after the existing per-swapchain fence wait, avoiding an additional synchronization point.
Timestamp counters with fewer than 64 valid bits and counter wraparound are handled explicitly.
Performance HUD
Add a View-menu toggle for a non-interactive HUD which remains visible while the main window is closed.
For total vkShade work, effects, and remaining work, the HUD displays:
Statistics cover the latest 120 published samples. A sequence counter ensures that each query result is consumed once, and the rolling windows are reset when timing becomes unavailable.
The retained sample window can later serve as the basis for a timing graph. Per-effect measurements are intentionally left for separate work because they require additional timestamp ranges around individual effect passes.
Scope
This draft does not add:
The previous live-log commits were removed because that functionality is now provided upstream by #92.
Validation
git diff --checkis clean.The PR deliberately remains in draft while the resource/depth architecture is developed upstream. Tracker commits can be removed as they are superseded, while the independent performance-diagnostics commits can be retained or split out later.