Add GuestTexture::GetSize helper function

This code was getting duplicated a bit so commonise into a helper function.
This commit is contained in:
Billy Laws
2022-06-03 19:30:54 +01:00
parent 31d418ad54
commit 581a016991
4 changed files with 8 additions and 3 deletions

View File

@ -62,6 +62,10 @@ namespace skyline::gpu {
return dimensions.depth;
}
size_t GuestTexture::GetSize() {
return GetLayerStride() * (layerCount - baseArrayLayer);
}
TextureView::TextureView(std::shared_ptr<Texture> texture, vk::ImageViewType type, vk::ImageSubresourceRange range, texture::Format format, vk::ComponentMapping mapping) : texture(std::move(texture)), type(type), format(format), mapping(mapping), range(range) {}
Texture::TextureViewStorage::TextureViewStorage(vk::ImageViewType type, texture::Format format, vk::ComponentMapping mapping, vk::ImageSubresourceRange range, vk::raii::ImageView &&vkView) : type(type), format(format), mapping(mapping), range(range), vkView(std::move(vkView)) {}