| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_DataContainer.h> |
| 4 | #include <nn/gfx/gfx_BufferData-api.nvn.8.h> |
| 5 | #include <nn/gfx/gfx_Common.h> |
| 6 | #include <nn/types.h> |
| 7 | |
| 8 | namespace nn::gfx { |
| 9 | |
| 10 | class BufferInfo; |
| 11 | class BufferTextureViewInfo; |
| 12 | class GpuAddress; |
| 13 | |
| 14 | namespace detail { |
| 15 | |
| 16 | template <> |
| 17 | class BufferImpl<ApiVariationNvn8> : public DataContainer<BufferImplData<ApiVariationNvn8>> { |
| 18 | NN_NO_COPY(BufferImpl); |
| 19 | |
| 20 | public: |
| 21 | typedef BufferInfo InfoType; |
| 22 | |
| 23 | static const bool IsMemoryPoolRequired = true; |
| 24 | |
| 25 | static size_t GetBufferAlignment(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 26 | |
| 27 | BufferImpl(); |
| 28 | ~BufferImpl(); |
| 29 | |
| 30 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const BufferInfo&, |
| 31 | MemoryPoolImpl<ApiVariationNvn8>*, ptrdiff_t, size_t); |
| 32 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 33 | void* Map() const; |
| 34 | void Unmap() const; |
| 35 | void FlushMappedRange(ptrdiff_t, size_t) const; |
| 36 | void InvalidateMappedRange(ptrdiff_t, size_t) const; |
| 37 | void GetGpuAddress(GpuAddress*) const; |
| 38 | }; |
| 39 | |
| 40 | template <> |
| 41 | class BufferTextureViewImpl<ApiVariationNvn8> |
| 42 | : public DataContainer<BufferTextureViewImplData<ApiVariationNvn8>> { |
| 43 | NN_NO_COPY(BufferTextureViewImpl); |
| 44 | |
| 45 | public: |
| 46 | typedef BufferTextureViewInfo InfoType; |
| 47 | |
| 48 | static size_t GetOffsetAlignment(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 49 | |
| 50 | BufferTextureViewImpl(); |
| 51 | ~BufferTextureViewImpl(); |
| 52 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 53 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 54 | }; |
| 55 | |
| 56 | } // namespace detail |
| 57 | |
| 58 | } // namespace nn::gfx |