Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions include/common/aglGPUMemAddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <typename T>
Expand Down
7 changes: 5 additions & 2 deletions include/common/aglGPUMemBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MemoryPoolHeap;

class GPUMemBlockBase {
public:
explicit GPUMemBlockBase(sead::Heap* p_heap);
GPUMemBlockBase();
virtual ~GPUMemBlockBase();

void clear();
Expand Down Expand Up @@ -50,7 +50,10 @@ static_assert(sizeof(GPUMemBlockBase) == 0x38);

// TODO
template <typename T>
class GPUMemBlockT : public GPUMemBlockBase {};
class GPUMemBlockT : public GPUMemBlockBase {
public:
~GPUMemBlockT() override { ; }
};

// TODO
template <typename T>
Expand Down