Closed SRSaunders closed 10 months ago
Added a few minor fixes for:
##__VA_ARGS__
in Optick macros)GPUProfiler::Stop()
This is a big one. Good job! I only tested DX12 vs Vulkan on Windows. You might also want to make a PR to the original Optick repo because many might be interested in your changes.
Thanks Robert. I will likely prepare a PR for the original Optick repo, but I notice that no commits have been applied for over 1 year. I wonder if the developer is still active, or perhaps just busy on other things?
This pull request adds 2 main items:
* _requires the Vulkan
VK_GOOGLE_display_timing
extension - currently supported on macOS with MoltenVK, too bad this is not available generally on Vulkan for Windows and linux, at least for my AMD graphics card. Note the MoltenVK implementation has bug fixes for improved presentation timing inthe comingVulkan SDK 1.3.250 and merged pull request https://github.com/KhronosGroup/MoltenVK/pull/1936 (pending MVK 1.2.5 release, date TBD)._Item 2 above is cool since it allows direct visualization of game input to display presentation latency end-to-end. I have compared the DX12 results with PresentMon (https://github.com/GameTechDev/PresentMon) on Windows and they line up very well. I will use this capability in a follow-up PR regarding latency optimization for RBDoom3BFG.
To achieve the above, the Optick profiler was bug-fixed / extended as follows:
threadTLS
nullptr check (now works cross platform)OPTICK_SET_MEMORY_ALLOCATOR()
stub definitionvkCmdResetQueryPool()
tovkResetQueryPool()
inGPUProfilerVulkan::ResolveTimestamps()
to avoid Vulkan validation errorsResolveTimestamps()
andWaitForFrame()
with node visibility and making their interfaces publicGPUProfiler::Dump()
to prevent random failures during data dump (stop capture)GPUProfiler::AddVSyncEvent()
to support an optional text label (vs hardcoded VSync label)GPUProfiler::AddVSyncTag()
to allow labeling of Vsync event with frame ID informationPlatform::GetTime()
to use Monotonic clock on macOS - now the same as other platforms and works with data returned byvkGetPastPresentationTimingGOOGLE()
vkGetPastPresentationTimingGOOGLE()
ifVK_GOOGLE_display_timing
availableOPTICK_GPU_FLIP()
to support optionalframeID
parameter (needed for DX12 presentID to frameID mapping for VSync queue labeling, not required for Vulkan)GPUContextScope()
for runtime selection of graphics APII kept all the Optick-specific commits separate from RBDoom3BFG commits to allow potential future pushing of these changes to the upstream Optick repo.
This has been tested on Windows 10, Manjaro linux, and macOS Monterey, using the Optick GUI app running on a separate, networked PC.
Here's a screen grab for borderless fullscreen Vulkan running on macOS/MoltenVK with VSync/Present queue frameID labeling:
Here's another screen grab for borderless fullscreen DX12 on Windows with VSync/Present queue frameID labeling: