Skip to content

Commit

Permalink
Update a handful of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Valakor committed Jan 8, 2024
1 parent 3db954d commit bebb5a2
Showing 1 changed file with 5 additions and 4 deletions.
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.
// 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

0 comments on commit bebb5a2

Please sign in to comment.