Use a linear allocator for most per-execution GPU allocations

Currently we heavily thrash the heap each draw, with malloc/free taking up about 10% of GPFIFOs execution time. Using a linear allocator for the main offenders of buffer usage callbacks and index/vertex state helps to reduce this to about 4%
This commit is contained in:
Billy Laws
2022-07-31 13:41:28 +01:00
parent 70eec5a414
commit 683cd594ad
6 changed files with 22 additions and 20 deletions

View File

@ -152,8 +152,9 @@ namespace skyline::gpu {
// Transfer all delegates references from the overlapping buffer to the new buffer
for (auto &delegate : srcBuffer->delegates) {
delegate->buffer = *newBuffer;
if (delegate->usageCallback)
delegate->usageCallback(*delegate->view, *newBuffer);
if (delegate->usageCallbacks)
for (auto &callback : *delegate->usageCallbacks)
callback(*delegate->view, *newBuffer);
}
newBuffer->delegates.splice(newBuffer->delegates.end(), srcBuffer->delegates);