| 123 | } |
| 124 | |
| 125 | LLGL_EXPORT Extent3D GetMipExtent(const TextureType type, const Extent3D& e, std::uint32_t m) |
| 126 | { |
| 127 | if (m < NumMipLevels(type, e)) |
| 128 | { |
| 129 | switch (type) |
| 130 | { |
| 131 | case TextureType::Texture1D: return Extent3D{ MipExtent(e.width, m), 1u, 1u }; |
| 132 | case TextureType::Texture2D: return Extent3D{ MipExtent(e.width, m), MipExtent(e.height, m), 1u }; |
| 133 | case TextureType::Texture3D: return Extent3D{ MipExtent(e.width, m), MipExtent(e.height, m), MipExtent(e.depth, m) }; |
| 134 | case TextureType::TextureCube: return Extent3D{ MipExtent(e.width, m), MipExtent(e.height, m), 1u }; |
| 135 | case TextureType::Texture1DArray: return Extent3D{ MipExtent(e.width, m), e.height, 1u }; |
| 136 | case TextureType::Texture2DArray: return Extent3D{ MipExtent(e.width, m), MipExtent(e.height, m), e.depth }; |
| 137 | case TextureType::TextureCubeArray: return Extent3D{ MipExtent(e.width, m), MipExtent(e.height, m), e.depth }; |
| 138 | case TextureType::Texture2DMS: return Extent3D{ e.width, e.height, 1u }; |
| 139 | case TextureType::Texture2DMSArray: return Extent3D{ e.width, e.height, e.depth }; |
| 140 | } |
| 141 | } |
| 142 | return {}; |
| 143 | } |
| 144 | |
| 145 | std::uint32_t GetMemoryFootprint(const TextureType type, const Format format, const Extent3D& extent, const TextureSubresource& subresource) |
| 146 | { |
no test coverage detected