| 1 | #pragma once |
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_Buffer-api.nvn.8.h> |
| 4 | #include <nn/gfx/gfx_Common.h> |
| 5 | |
| 6 | namespace nn::gfx { |
| 7 | |
| 8 | template <class TTarget> |
| 9 | class TBuffer : public detail::BufferImpl<TTarget> { |
| 10 | NN_NO_COPY(TBuffer); |
| 11 | |
| 12 | public: |
| 13 | typedef BufferInfo InfoType; |
| 14 | |
| 15 | static const bool IsMemoryPoolRequired = true; |
| 16 | |
| 17 | static size_t GetBufferAlignment(TDevice<TTarget>*, const InfoType&); |
| 18 | |
| 19 | TBuffer(); |
| 20 | void Initialize(TDevice<TTarget>*, const InfoType&, TMemoryPool<TTarget>*, ptrdiff_t, size_t); |
| 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 GetGpuAddress(GpuAddress*) const; |
| 27 | void SetUserPtr(void*); |
| 28 | void* GetUserPtr(); |
| 29 | const void* GetUserPtr() const; |
| 30 | }; |
| 31 | |
| 32 | } // namespace nn::gfx |