mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 10:09:59 -04:00
Count a texture pool take only when its sync left no slot behind, so a retired texture is not freed while a set still holds its view.
Once the frame's creation time is spent, pool_refill skips a slot it left earlier in the frame, and pool_sync_entries may return before the walk. Such a slot keeps its old view in the current set with nothing in the change log, so the takes after it do not carry the change into the other sets. vk_pool_takes counted those takes all the same, and at about six submissions a frame, more than VK_POOL_SETS of them could pass within one frame while a retired texture's slot was skipped every time. retire_sweep would then free the image while every set still named it. A take now counts only when its sync left no slot behind (PL.retry clear): after it, every slot change made before it is in that set and in the log, and the takes after it bring it into the others. A sealed second take inside one submission still goes uncounted, which only delays the free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5cd431f792e00ca3b9a03657cd4aab64fc38dae7)
This commit is contained in:
@@ -498,8 +498,9 @@ int vk_pool_marks_enabled(void); // NX2NAVI_TEX_DISUSE: modu
|
||||
extern volatile int32_t vk_pool_marks_missed; // modules indexing the pool that could not be marked
|
||||
void vk_pool_marks_read(const uint32_t *marks, uint32_t n); // vk_texture.c: slots marked since the last read
|
||||
// The texture pool's ring of descriptor sets (vk_exec_draw.c pool_take_set): a submission's first pool use takes the next
|
||||
// set and brings it up to date. vk_pool_takes counts those takes; once it has moved on by more than VK_POOL_SETS since a
|
||||
// pool entry changed, every set holds the change (vk_texture.c retire_sweep).
|
||||
// set and brings it up to date. vk_pool_takes counts the takes whose sync left no slot behind (vk_exec_draw.c pool_sync);
|
||||
// once it has moved on by more than VK_POOL_SETS since a pool entry changed, every set holds the change (vk_texture.c
|
||||
// retire_sweep). It may count fewer takes than there were, which only delays that.
|
||||
#define VK_POOL_SETS 4
|
||||
uint64_t vk_pool_takes(void);
|
||||
// Texture lock held: 1 while the texture pool refresh looks its slots up (vk_exec_draw.c pool_sync_entries), 0 after.
|
||||
|
||||
Reference in New Issue
Block a user