Introduce BufferManager

The Buffer Manager handles mapping of guest buffers to host buffer views with automatic handling of sub-buffers and eventually supporting recreation of overlapping buffers to create a single larger buffer.
This commit is contained in:
PixelyIon
2021-12-06 21:43:43 +05:30
parent bde61d72cc
commit 03314ec7d2
6 changed files with 156 additions and 0 deletions

View File

@ -21,6 +21,7 @@ namespace skyline::gpu {
};
struct BufferView;
class BufferManager;
/**
* @brief A buffer which is backed by host constructs while being synchronized with the underlying guest buffer
@ -36,6 +37,7 @@ namespace skyline::gpu {
std::vector<std::weak_ptr<BufferView>> views; //!< BufferView(s) that are backed by this Buffer, used for repointing to a new Buffer on deletion
friend BufferView;
friend BufferManager;
public:
std::weak_ptr<FenceCycle> cycle; //!< A fence cycle for when any host operation mutating the buffer has completed, it must be waited on prior to any mutations to the backing