Add move-assignment semantics to ActiveCommandBuffer/MegaBuffer

We need move-assignment semantics to viably utilize these objects as class members, they cannot be replaced without move-assign (or copy-assign but that is undesirable here). This commit fixes that by introducing a move assignment operator to them while making the `slot` a pointer which has the necessary nullability semantics.
This commit is contained in:
PixelyIon
2022-06-05 15:50:49 +05:30
parent 8991ccac65
commit 5129d2ae78
3 changed files with 42 additions and 21 deletions

View File

@ -60,7 +60,7 @@ namespace skyline::gpu {
*/
class MegaBuffer {
private:
BufferManager::MegaBufferSlot &slot;
BufferManager::MegaBufferSlot *slot;
span<u8> freeRegion; //!< The unallocated space in the megabuffer
public:
@ -68,6 +68,8 @@ namespace skyline::gpu {
~MegaBuffer();
MegaBuffer &operator=(MegaBuffer &&other);
/**
* @brief Resets the free region of the megabuffer to its initial state, data is left intact but may be overwritten
*/