1#pragma once
2
3#include <nn/gfx/detail/gfx_MemoryPool-api.nvn.8.h>
4#include <nn/gfx/gfx_Common.h>
5
6namespace nn::gfx {
7
8template <class TTarget>
9class TMemoryPool : public detail::MemoryPoolImpl<TTarget> {
10 NN_NO_COPY(TMemoryPool);
11
12public:
13 typedef MemoryPoolInfo InfoType;
14
15 static size_t GetPoolMemoryAlignment(TDevice<TTarget>*, const InfoType&);
16 static size_t GetPoolMemorySizeGranularity(TDevice<TTarget>*, const InfoType&);
17
18 TMemoryPool();
19
20 void Initialize(TDevice<TTarget>*, const InfoType&);
21 void Finalize(TDevice<TTarget>*);
22 void* Map() const;
23 void Unmap() const;
24 void FlushMappedRange(ptrdiff_t, size_t) const;
25 void InvalidateMappedRange(ptrdiff_t, size_t) const;
26 void SetUserPtr(void*);
27 void* GetUserPtr();
28 const void* GetUserPtr() const;
29};
30
31} // namespace nn::gfx
32