Implement host-only Buffers

We require certain buffers to only be on the host while being accessible through the same abstractions as a guest buffer as they must be interchangeable in usage.
This commit is contained in:
PixelyIon
2022-04-12 20:50:20 +05:30
parent 2c697ec36a
commit 6f85a66151
3 changed files with 29 additions and 19 deletions

View File

@ -21,7 +21,7 @@ namespace skyline::gpu {
GPU &gpu;
std::mutex mutex; //!< Synchronizes any mutations to the buffer or its backing
memory::Buffer backing;
GuestBuffer guest;
std::optional<GuestBuffer> guest;
span<u8> mirror{}; //!< A contiguous mirror of all the guest mappings to allow linear access on the CPU
span<u8> alignedMirror{}; //!< The mirror mapping aligned to page size to reflect the full mapping
@ -89,6 +89,12 @@ namespace skyline::gpu {
Buffer(GPU &gpu, GuestBuffer guest);
/**
* @brief Creates a host-only Buffer which isn't backed by any guest buffer
* @note The created buffer won't have a mirror so any operations cannot depend on a mirror existing
*/
Buffer(GPU &gpu, vk::DeviceSize size);
~Buffer();
/**