protonscr

VA LUT prototype

vkd3dclosed
HansKristian-Work/vkd3d-proton#107 · opened 2020-04-23 by doitsujin · updated 2021-02-19 · 0 comments · github
Ddoitsujin 2020-04-23 github

frog.cpp.txt

Couple of notes:

  • We can store up to two mappings per 1MB block, since VAs aren't necessarily aligned.
  • Allocations need to cover at least one block, so that we never have >2 allocations per block.
  • alloc/free are O(size), with one iteration per 1MB block.
  • We store a VA in the block metadata so that we don't have to unconditionally dereference the heaps. Doing so could create a race condition when destroying a heap, even if the VA we are dereferencing lies outside that heap.
  • free must be called before actually freeing the memory allocation, otherwise we could create a race with alloc.

Nothing extracted yet.