Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Vulkan sampling support #256

Merged
merged 28 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5d76b16
WIP: First-pass implementation of Vulkan profiling. Currently assumes…
Valakor Jan 6, 2024
dff750b
Update comment describing compilation requirements for Vulkan profiling
Valakor Jan 6, 2024
11314f7
Fix calling rmt_GetLastErrorMessage from C++
Valakor Jan 7, 2024
45f4887
Fix rmt_ScopedD3D12Sample and rmt_ScopedVulkanSample. Extra parens co…
Valakor Jan 7, 2024
e608550
Fix Remotery_Destructor when D3D12 or Vulkan sampling are enabled. Ne…
Valakor Jan 7, 2024
067ba82
WIP: Fix getting Vulkan function pointers
Valakor Jan 7, 2024
433a90c
Update readme.md
Valakor Jan 7, 2024
bf90e0d
Fix visualization of uint64 and sint64 properties
Valakor Jan 7, 2024
fce6e3b
WIP: Vulkan spec states that you can't call vkGetQueryPoolResults wit…
Valakor Jan 7, 2024
533f7cf
WIP: First-pass Vulkan profiling implementation complete
Valakor Jan 7, 2024
083be58
Default RMT_USE_VULKAN back to 0
Valakor Jan 8, 2024
3db954d
Merge branch 'Celtoys:main' into main
Valakor Jan 8, 2024
bebb5a2
Update a handful of comments
Valakor Jan 8, 2024
5502716
Add missing ZeroMemory macro on non-Windows platforms
Valakor Jan 8, 2024
90c8e2e
Support thread naming on MacOS
Valakor Jan 8, 2024
d41b2bf
Vulkan on MacOS (via MoltenVK) only allows query pools of up to size …
Valakor Jan 8, 2024
6e3cbbf
Add missing comment about query pool size limits on MacOS
Valakor Jan 8, 2024
af38067
Fix timestamp calibration on MacOS. Turns out MoltenVK actually retur…
Valakor Jan 8, 2024
6f957e8
Update some comments in GetTimestampCalibration to reflect correct in…
Valakor Jan 8, 2024
8ceedd3
Remove ZeroMemory macro hack, just use memset
Valakor Jan 10, 2024
f38c000
Clarify that the function pointer passed to rmt_BindVulkan is the vkG…
Valakor Jan 10, 2024
0c96a6f
Rename VulkanGetInstanceProcAddr to rmtVulkanGetInstanceProcAddr
Valakor Jan 10, 2024
53897b4
Update readme.md
Valakor Jan 10, 2024
b0bf7c5
Ensure we delete VulkanBindImpl::mqToVulkanUpdate
Valakor Jan 10, 2024
70a13a9
Cleaner shutdown by automatically consuming all pending GPU samples. …
Valakor Jan 10, 2024
e7141d6
Clarify Vulkan compilation and extension/version requirements in Remo…
Valakor Jan 14, 2024
2e56a7b
Have the user specify Vulkan functions pointers instead of loading th…
Valakor Jan 17, 2024
2f28ede
Fix a handful of issues:
Valakor Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/Remotery.c
Original file line number Diff line number Diff line change
Expand Up @@ -10091,7 +10091,8 @@ typedef struct VulkanBindImpl
VulkanSample** sampleRingBuffer;

// Read/write positions of the ring buffer allocator, synchronising access to all the ring buffers at once
// TODO(don): Separate by cache line?
// NOTE(valakor): These are 64-bit instead of 32-bit so that we can reasonably assume they never wrap.
dwilliamson marked this conversation as resolved.
Show resolved Hide resolved
// TODO(valakor): Separate by cache line?
rmtAtomicU64 ringBufferRead;
rmtAtomicU64 ringBufferWrite;

Expand Down Expand Up @@ -10248,7 +10249,7 @@ static rmtError UpdateGpuTicksToUs(VulkanBindImpl* bind, VkPhysicalDevice vulkan
static rmtError GetTimestampCalibration(VulkanBindImpl* bind, VkPhysicalDevice vulkan_physical_device, VkDevice vulkan_device, double* gpu_ticks_to_us, rmtS64* gpu_to_cpu_timestamp_us)
{
// TODO(valakor): Honor RMT_GPU_CPU_SYNC_SECONDS? It's unclear to me how expensive vkGetCalibratedTimestampsEXT is
// on all supported platforms, but at least on Windows on my machine it was on the order of 100-150us.
// on all supported platforms, but at least on my Windows/NVIDIA machine it was on the order of 100-150us.

rmtU64 gpu_timestamp_ticks;
rmtU64 cpu_timestamp_ticks;
Expand Down Expand Up @@ -10474,8 +10475,8 @@ RMT_API rmtError _rmt_BindVulkan(void* instance, void* physical_device, void* de
rmtTry(LoadVulkanFunctions(bind, vulkan_instance, pfn_vkGetInstanceProcAddr));

// Create the independent ring buffer storage items
// TODO(don): Leave space beetween start and end to stop invalidating cache lines?
// NOTE(don): ABA impossible due to non-wrapping ring buffer indices
// TODO(valakor): Leave space beetween start and end to stop invalidating cache lines?
// NOTE(valakor): ABA impossible due to non-wrapping ring buffer indices
rmtTry(CreateQueryPool(bind, vulkan_device, bind->maxNbQueries));
rmtTryMallocArray(VulkanSample*, bind->sampleRingBuffer, bind->maxNbQueries / 2);
rmtTryMallocArray(rmtU64, bind->cpuTimestampRingBuffer, bind->maxNbQueries);
Expand Down