| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_DataContainer.h> |
| 4 | #include <nn/gfx/gfx_Common.h> |
| 5 | #include <nn/gfx/gfx_MemoryPoolData-api.nvn.8.h> |
| 6 | |
| 7 | namespace nn::gfx { |
| 8 | |
| 9 | class MemoryPoolInfo; |
| 10 | |
| 11 | namespace detail { |
| 12 | |
| 13 | template <> |
| 14 | class MemoryPoolImpl<ApiVariationNvn8> |
| 15 | : public DataContainer<MemoryPoolImplData<ApiVariationNvn8>> { |
| 16 | NN_NO_COPY(MemoryPoolImpl); |
| 17 | |
| 18 | public: |
| 19 | typedef MemoryPoolInfo InfoType; |
| 20 | |
| 21 | static size_t GetPoolMemoryAlignment(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 22 | static size_t GetPoolMemorySizeGranularity(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 23 | |
| 24 | MemoryPoolImpl(); |
| 25 | ~MemoryPoolImpl(); |
| 26 | |
| 27 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 28 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 29 | void* Map() const; |
| 30 | void Unmap() const; |
| 31 | void FlushMappedRange(ptrdiff_t, size_t) const; |
| 32 | void InvalidateMappedRange(ptrdiff_t, size_t) const; |
| 33 | }; |
| 34 | |
| 35 | } // namespace detail |
| 36 | |
| 37 | } // namespace nn::gfx |
| 38 |