Remember a read-only buffer bind until its pool changes #392

Merged
SkippySteve merged 1 commit from fix/bind-memo into main 2026-11-08 00:03:07 +00:00
SkippySteve commented 2026-11-07 23:24:50 +00:00 (Migrated from github.com)

Summary

  • A draw looks up the same guest ranges again: vertex streams, the index buffer, indirect arguments, uniform buffers, and storage-buffer entries. A successful read is kept until a pool leaves, a mirror is made, or the next submission starts.
  • A written bind still notes the write and is not remembered. An empty lookup is not remembered either: a pool can be imported later without the stamp changing. The stamp is read again after the lookup, so a mirror made during that call is what gets kept. #327 adds the same gpu_bind_stamp and the same pools_gen bump after a mirror is made; if both land, one copy of each is enough.

Test plan

  • python -I -B tests/test_bind_memo.py passes. With gpu/vk/vk_memory.cpp and gpu/vk/vk_internal.h stashed, it fails because the remembered-bind check is gone.
  • python -I -B tests/test_pool_span.py and python -I -B tests/test_submitted_page.py still pass.
  • Source regressions workflow, Linux step "Check a repeated read bind is not looked up again"
## Summary - A draw looks up the same guest ranges again: vertex streams, the index buffer, indirect arguments, uniform buffers, and storage-buffer entries. A successful read is kept until a pool leaves, a mirror is made, or the next submission starts. - A written bind still notes the write and is not remembered. An empty lookup is not remembered either: a pool can be imported later without the stamp changing. The stamp is read again after the lookup, so a mirror made during that call is what gets kept. #327 adds the same `gpu_bind_stamp` and the same `pools_gen` bump after a mirror is made; if both land, one copy of each is enough. ## Test plan - [x] `python -I -B tests/test_bind_memo.py` passes. With `gpu/vk/vk_memory.cpp` and `gpu/vk/vk_internal.h` stashed, it fails because the remembered-bind check is gone. - [x] `python -I -B tests/test_pool_span.py` and `python -I -B tests/test_submitted_page.py` still pass. - [ ] Source regressions workflow, Linux step "Check a repeated read bind is not looked up again"
Commenting is not possible because the repository is archived.
No description provided.