| 1 | #pragma once |
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_DataContainer.h> |
| 4 | #include <nn/gfx/gfx_Common.h> |
| 5 | #include <nn/gfx/gfx_TextureData-api.nvn.8.h> |
| 6 | |
| 7 | namespace nn::gfx { |
| 8 | |
| 9 | class TextureInfo; |
| 10 | class TextureViewInfo; |
| 11 | class ColorTargetViewInfo; |
| 12 | class DepthStencilViewInfo; |
| 13 | |
| 14 | namespace detail { |
| 15 | template <> |
| 16 | class TextureImpl<ApiVariationNvn8> : public DataContainer<TextureImplData<ApiVariationNvn8>> { |
| 17 | NN_NO_COPY(TextureImpl); |
| 18 | |
| 19 | public: |
| 20 | typedef TextureInfo InfoType; |
| 21 | |
| 22 | static const bool IsMemoryPoolRequired; |
| 23 | |
| 24 | static size_t CalculateMipDataAlignment(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 25 | static size_t CalculateMipDataSize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 26 | static void CalculateMipDataOffsets(ptrdiff_t*, DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 27 | static size_t GetRowPitch(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 28 | |
| 29 | TextureImpl(); |
| 30 | ~TextureImpl(); |
| 31 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&, |
| 32 | MemoryPoolImpl<ApiVariationNvn8>*, ptrdiff_t, size_t); |
| 33 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 34 | }; |
| 35 | |
| 36 | template <> |
| 37 | class TextureViewImpl<ApiVariationNvn8> |
| 38 | : public DataContainer<TextureViewImplData<ApiVariationNvn8>> { |
| 39 | NN_NO_COPY(TextureViewImpl); |
| 40 | |
| 41 | public: |
| 42 | typedef TextureViewInfo InfoType; |
| 43 | |
| 44 | TextureViewImpl(); |
| 45 | |
| 46 | ~TextureViewImpl(); |
| 47 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 48 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 49 | }; |
| 50 | |
| 51 | template <> |
| 52 | class ColorTargetViewImpl<ApiVariationNvn8> |
| 53 | : public DataContainer<ColorTargetViewImplData<ApiVariationNvn8>> { |
| 54 | NN_NO_COPY(ColorTargetViewImpl); |
| 55 | |
| 56 | public: |
| 57 | typedef ColorTargetViewInfo InfoType; |
| 58 | |
| 59 | ColorTargetViewImpl(); |
| 60 | |
| 61 | ~ColorTargetViewImpl(); |
| 62 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 63 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 64 | }; |
| 65 | |
| 66 | template <> |
| 67 | class DepthStencilViewImpl<ApiVariationNvn8> |
| 68 | : public DataContainer<DepthStencilViewImplData<ApiVariationNvn8>> { |
| 69 | NN_NO_COPY(DepthStencilViewImpl); |
| 70 | |
| 71 | public: |
| 72 | typedef DepthStencilViewInfo InfoType; |
| 73 | |
| 74 | DepthStencilViewImpl(); |
| 75 | ~DepthStencilViewImpl(); |
| 76 | void Initialize(DeviceImpl<ApiVariationNvn8>*, const InfoType&); |
| 77 | void Finalize(DeviceImpl<ApiVariationNvn8>*); |
| 78 | }; |
| 79 | |
| 80 | } // namespace detail |
| 81 | |
| 82 | } // namespace nn::gfx |