mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Say in timed_alloc's comment that failed device memory allocations count in the mark.
The review of b4e12f1c found that vk_device.c timed_alloc calls perf_mark_end after a failed vkAllocateMemory too, with 0 bytes, so the "device memory allocations" mark's count now takes in failed attempts, which vk_headroom.c on_allocate's old mark (VMA's callback after an allocation was made) never did. The time of a failed attempt held the frame as well, and VMA may try again with a smaller block after it, so the mark keeps it; the comment now says that failed attempts count with their time and 0 bytes and that the count can pass the number of allocations made. Comment only. vk_device.c compiles with the dev flags and adds no -Wall -Wextra warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -435,7 +435,9 @@ static void fatal_note(void) {
|
||||
// NX2NAVI_TRACE=perf: every device memory allocation VMA makes, timed as the "device memory allocations" work mark
|
||||
// (perf.c mark_text). An area's first visit made 78 of them, 4.4 GB, in a frame of 421 ms of which about 180 ms
|
||||
// showed in no mark; vk_headroom.c measured 8-19 ms per 256 MiB block. VMA takes this one function from the
|
||||
// allocator's create info and the others from its static table (vk_vma.cpp VMA_STATIC_VULKAN_FUNCTIONS).
|
||||
// allocator's create info and the others from its static table (vk_vma.cpp VMA_STATIC_VULKAN_FUNCTIONS). A failed
|
||||
// attempt counts too, with its time and 0 bytes: VMA may then try again with a smaller block, and the failed call held
|
||||
// the frame as well, so the mark's count can pass the number of allocations made.
|
||||
static VkResult VKAPI_PTR timed_alloc(VkDevice d, const VkMemoryAllocateInfo *ai, const VkAllocationCallbacks *cb,
|
||||
VkDeviceMemory *m) {
|
||||
uint64_t t0 = perf_mark_begin();
|
||||
|
||||
Reference in New Issue
Block a user