Commit Graph

15 Commits

Author SHA1 Message Date
nilsoncore 790bf25263 vk: devmem: fix previously conflicting code.
- `mem->priv_.devmem` -> `slot_index`;
- Move static `VK_DevMemUsageTypeString()` out of `devmem.h` header.
2024-03-22 06:31:39 +03:00
nilsoncore 8363cedf93 vk: devmem: resolve conflicts with `w23:vulkan` branch. 2024-03-22 06:05:51 +03:00
nilsoncore a06998321e vk: devmem: track peak single allocation size 2023-12-14 08:13:26 +03:00
nilsoncore cba1b02103 vk: devmem: print human-friendly memory size values
Raw values are still printed in subsequent messages.
2023-12-14 08:00:21 +03:00
nilsoncore ceb4437f8c vk: devmem: print number of alloc slots on overflow 2023-12-14 07:54:23 +03:00
nilsoncore 05ac770c81 vk: devmem: track alignment holes correctly
Get `alignment_hole` right from the `alolcator` instead of calculating
outside.
Improve allocation slot variable naming on slot allocation selection.
Restructure internal `vk_devmem_t` fields into `internal` struct.
Make `VK_DevMemUsageTypeString` visibility scope to file-only.
2023-12-14 07:50:15 +03:00
nilsoncore 1117c5969e vk: devmem: simplify flags formatting
Use `PRI_VKxxxFLAGS_FMT` as an inline format macro and
`PRI_VKxxxFLAGS_ARG( ... )` as an inline argument macro for that format.
Also bring back those `!!`.
2023-12-14 07:39:44 +03:00
nilsoncore 79e0e52061 vk: profiler: devmem: save `peak` instead of `total` metrics
Also minor code structure changes.
2023-10-07 16:58:04 +03:00
nilsoncore e3d86af5ab vk: profiler: devmem: code style consistency
Also clarify one comment about enabling stats metrics only with
`-vkdebugmem` parameter.
2023-09-25 23:47:04 +03:00
nilsoncore 95223077b6 vk: profiler: devmem: take into account alignment holes
Also improve `VK_DevMemFree` debug printing: include usage type, size,
alignment, and unusable alignment hole size.
2023-09-25 23:43:45 +03:00
nilsoncore c7f8a2a8f6 vk: profiler: devmem: store stats for each devmem usage type
Make struct `vk_devmem_allocation_stats_t` which will be able to store
overall stats and stats generic for each usage type.
Move Vulkan related devmem allocation arguments into their own type -
`vk_devmem_allocate_args_t`.
Store `vk_devmem_usage_type_t` inside `vk_devmem_t`, so we can handle
deallocations (frees) for each corresponding type aside from overall
stats.
Make `VK_DevMemAllocateBuffer` and `VK_DevMemAllocateImage` macros which
call generic function `VK_DevMemAllocate` with correspoding usage type
set.
Make function `VK_DevMemUsageTypeString` to be able to get short string
of long enum name.
2023-09-24 06:06:42 +03:00
nilsoncore f515228142 vk: devmem: fix debug message so it builds on linux (hopefully) 2023-09-24 06:06:42 +03:00
nilsoncore 4f6d9b8e1e vk: devmem: code style consistency 2023-09-22 05:01:46 +03:00
nilsoncore 5a745249e1 vk: devmem: integrate it with `r_speeds` metrics
Clarify type name `vk_device_memory_t` as `vk_device_memory_slot_t`
to not confuse it with `vk_devmem_t` as their names are pretty much
the same.
Add additional helper functions to standardize VK flags output format.
Also maybe it is a good idea to have it inside `vk_flags.{h,c}`,
for example.
Improve debug printing: bring colors and improve readability.
Add internal (private) field `_block_size` to `vk_devmem_t` so we can
keep track of how much memory we freed.
2023-09-22 04:59:23 +03:00
Ivan Avdeev 053d26e870 move ref_vk to ref/vk 2023-02-16 10:30:31 -08:00