| 1 | #pragma once |
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_DescriptorPool-api.nvn.8.h> |
| 4 | |
| 5 | namespace nn::gfx { |
| 6 | |
| 7 | template <class TTarget> |
| 8 | class TDescriptorPool : public detail::DescriptorPoolImpl<TTarget> { |
| 9 | NN_NO_COPY(TDescriptorPool); |
| 10 | |
| 11 | public: |
| 12 | typedef DescriptorPoolInfo InfoType; |
| 13 | |
| 14 | static size_t CalculateDescriptorPoolSize(TDevice<TTarget>*, const InfoType&); |
| 15 | static size_t GetDescriptorPoolAlignment(TDevice<TTarget>*, const InfoType&); |
| 16 | static ptrdiff_t GetDescriptorSlotIncrementSize(TDevice<TTarget>*, DescriptorPoolType); |
| 17 | |
| 18 | TDescriptorPool(); |
| 19 | void Initialize(TDevice<TTarget>*, const InfoType&, TMemoryPool<TTarget>*, ptrdiff_t, size_t); |
| 20 | void Finalize(TDevice<TTarget>*); |
| 21 | void BeginUpdate(); |
| 22 | void EndUpdate(); |
| 23 | void SetBufferView(int, const GpuAddress&, size_t); |
| 24 | void SetSampler(int, const TSampler<TTarget>*); |
| 25 | void SetTextureView(int, const TTextureView<TTarget>*); |
| 26 | void SetImage(int, const TTextureView<TTarget>*); |
| 27 | void SetBufferTextureView(int, const TBufferTextureView<TTarget>*); |
| 28 | void SetBufferImage(int, const TBufferTextureView<TTarget>*); |
| 29 | void GetDescriptorSlot(DescriptorSlot*, int) const; |
| 30 | int GetDescriptorSlotIndex(const DescriptorSlot&) const; |
| 31 | void SetUserPtr(void*); |
| 32 | void* GetUserPtr(); |
| 33 | const void* GetUserPtr() const; |
| 34 | }; |
| 35 | |
| 36 | } // namespace nn::gfx |