diff options
| author | DrChat <arkolbed@gmail.com> | 2018-02-09 20:57:26 -0600 |
|---|---|---|
| committer | DrChat <arkolbed@gmail.com> | 2018-02-09 20:57:26 -0600 |
| commit | 3ad45f4186f9c57ab85a15f2b28b358a8b4c90ae (patch) | |
| tree | c5a238ce839a35f692e8327ccb0a4d9c8553483c | |
| parent | a1677d34e15c081c403c0b5fef3df8dc35c2c87f (diff) | |
[Vulkan] New docs for buffer cache
| -rw-r--r-- | src/xenia/gpu/vulkan/vulkan_command_processor.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 9bab7fda5..6112d9a3d 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -860,14 +860,13 @@ bool VulkanCommandProcessor::PopulateVertexBuffers( // TODO: Make the buffer cache ... actually cache buffers. We can have // a list of buffers that were cached, and store those in chunks in a // multiple of the host's page size. - // WRITE WATCHES: We need to invalidate vertex buffers if they're written - // to. Since most vertex buffers aren't aligned to a page boundary, this - // means a watch may cover more than one vertex buffer. - // We need to maintain a list of write watches, and what memory ranges - // they cover. If a vertex buffer lies within a write watch's range, assign - // it to the watch. If there's partial alignment where a buffer lies within - // one watch and outside of it, should we create a new watch or extend the - // existing watch? + // So, we need to track all vertex buffers in a sorted map, and track all + // write watches in a sorted map. When a vertex buffer is uploaded, track + // all untracked pages with 1-page write watches. In the callback, + // invalidate any overlapping vertex buffers. + // + // We would keep the old transient buffer as a staging buffer, and upload + // to a GPU-only buffer that tracks all cached vertex buffers. auto buffer_ref = buffer_cache_->UploadVertexBuffer( current_setup_buffer_, physical_address, source_length, static_cast<Endian>(fetch->endian), current_batch_fence_); |
