diff --git a/include/common/aglGPUMemAddr.h b/include/common/aglGPUMemAddr.h index 0eed3e5..a90637c 100644 --- a/include/common/aglGPUMemAddr.h +++ b/include/common/aglGPUMemAddr.h @@ -10,6 +10,10 @@ class Heap; namespace agl { class GPUMemAddrBase { public: + GPUMemAddrBase() {} + GPUMemAddrBase(const GPUMemAddrBase& other, int alignmentOffset) + : mMemoryPool(other.mMemoryPool), mAlignmentAddr(other.mAlignmentAddr + alignmentOffset), + mMemoryBlock(other.mMemoryBlock) {} GPUMemAddrBase(const GPUMemBlockBase& memBlock, u64 offset); u32 verify_() const; @@ -21,10 +25,12 @@ class GPUMemAddrBase { void flushCPUCache(u64); void invalidateCPUCache(u64); + bool isValid() const { return mMemoryPool != nullptr; } + private: - detail::MemoryPool* mMemoryPool; - int mAlignmentAddr; - GPUMemBlockBase* mMemoryBlock; + detail::MemoryPool* mMemoryPool = nullptr; + int mAlignmentAddr = 0; + GPUMemBlockBase* mMemoryBlock = nullptr; }; template diff --git a/include/common/aglGPUMemBlock.h b/include/common/aglGPUMemBlock.h index 2f9caac..9333dfc 100644 --- a/include/common/aglGPUMemBlock.h +++ b/include/common/aglGPUMemBlock.h @@ -18,7 +18,7 @@ class MemoryPoolHeap; class GPUMemBlockBase { public: - explicit GPUMemBlockBase(sead::Heap* p_heap); + GPUMemBlockBase(); virtual ~GPUMemBlockBase(); void clear(); @@ -50,7 +50,10 @@ static_assert(sizeof(GPUMemBlockBase) == 0x38); // TODO template -class GPUMemBlockT : public GPUMemBlockBase {}; +class GPUMemBlockT : public GPUMemBlockBase { +public: + ~GPUMemBlockT() override { ; } +}; // TODO template