diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 26 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 5 |
2 files changed, 14 insertions, 17 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 63b8b5af5..543ceb5aa 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <unordered_set> | 6 | #include <unordered_set> |
| 7 | #include <boost/container/small_vector.hpp> | ||
| 7 | 8 | ||
| 8 | #include "common/alignment.h" | 9 | #include "common/alignment.h" |
| 9 | #include "common/settings.h" | 10 | #include "common/settings.h" |
| @@ -17,15 +18,10 @@ | |||
| 17 | 18 | ||
| 18 | namespace VideoCommon { | 19 | namespace VideoCommon { |
| 19 | 20 | ||
| 20 | using Tegra::Texture::SwizzleSource; | ||
| 21 | using Tegra::Texture::TextureType; | ||
| 22 | using Tegra::Texture::TICEntry; | 21 | using Tegra::Texture::TICEntry; |
| 23 | using Tegra::Texture::TSCEntry; | 22 | using Tegra::Texture::TSCEntry; |
| 24 | using VideoCore::Surface::GetFormatType; | 23 | using VideoCore::Surface::GetFormatType; |
| 25 | using VideoCore::Surface::IsCopyCompatible; | ||
| 26 | using VideoCore::Surface::PixelFormat; | 24 | using VideoCore::Surface::PixelFormat; |
| 27 | using VideoCore::Surface::PixelFormatFromDepthFormat; | ||
| 28 | using VideoCore::Surface::PixelFormatFromRenderTargetFormat; | ||
| 29 | using VideoCore::Surface::SurfaceType; | 25 | using VideoCore::Surface::SurfaceType; |
| 30 | using namespace Common::Literals; | 26 | using namespace Common::Literals; |
| 31 | 27 | ||
| @@ -674,7 +670,8 @@ void TextureCache<P>::CommitAsyncFlushes() { | |||
| 674 | bool any_none_dma = false; | 670 | bool any_none_dma = false; |
| 675 | for (PendingDownload& download_info : download_ids) { | 671 | for (PendingDownload& download_info : download_ids) { |
| 676 | if (download_info.is_swizzle) { | 672 | if (download_info.is_swizzle) { |
| 677 | total_size_bytes += slot_images[download_info.object_id].unswizzled_size_bytes; | 673 | total_size_bytes += |
| 674 | Common::AlignUp(slot_images[download_info.object_id].unswizzled_size_bytes, 64); | ||
| 678 | any_none_dma = true; | 675 | any_none_dma = true; |
| 679 | download_info.async_buffer_id = last_async_buffer_id; | 676 | download_info.async_buffer_id = last_async_buffer_id; |
| 680 | } | 677 | } |
| @@ -868,12 +865,16 @@ std::pair<typename TextureCache<P>::Image*, BufferImageCopy> TextureCache<P>::Dm | |||
| 868 | } | 865 | } |
| 869 | 866 | ||
| 870 | template <class P> | 867 | template <class P> |
| 871 | void TextureCache<P>::DownloadImageIntoBuffer( | 868 | void TextureCache<P>::DownloadImageIntoBuffer(typename TextureCache<P>::Image* image, |
| 872 | typename TextureCache<P>::Image* image, typename TextureCache<P>::BufferType buffer, | 869 | typename TextureCache<P>::BufferType buffer, |
| 873 | size_t buffer_offset, std::span<const VideoCommon::BufferImageCopy> copies, GPUVAddr address, size_t size) { | 870 | size_t buffer_offset, |
| 871 | std::span<const VideoCommon::BufferImageCopy> copies, | ||
| 872 | GPUVAddr address, size_t size) { | ||
| 874 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { | 873 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { |
| 875 | auto slot = slot_buffer_downloads.insert(address, size); | 874 | const BufferDownload new_buffer_download{address, size}; |
| 876 | uncommitted_downloads.emplace_back(false, uncommitted_async_buffers.size(), slot); | 875 | auto slot = slot_buffer_downloads.insert(new_buffer_download); |
| 876 | const PendingDownload new_download{false, uncommitted_async_buffers.size(), slot}; | ||
| 877 | uncommitted_downloads.emplace_back(new_download); | ||
| 877 | auto download_map = runtime.DownloadStagingBuffer(size, true); | 878 | auto download_map = runtime.DownloadStagingBuffer(size, true); |
| 878 | uncommitted_async_buffers.emplace_back(download_map); | 879 | uncommitted_async_buffers.emplace_back(download_map); |
| 879 | std::array buffers{ | 880 | std::array buffers{ |
| @@ -2269,7 +2270,8 @@ void TextureCache<P>::BindRenderTarget(ImageViewId* old_id, ImageViewId new_id) | |||
| 2269 | if (new_id) { | 2270 | if (new_id) { |
| 2270 | const ImageViewBase& old_view = slot_image_views[new_id]; | 2271 | const ImageViewBase& old_view = slot_image_views[new_id]; |
| 2271 | if (True(old_view.flags & ImageViewFlagBits::PreemtiveDownload)) { | 2272 | if (True(old_view.flags & ImageViewFlagBits::PreemtiveDownload)) { |
| 2272 | uncommitted_downloads.emplace_back(true, 0, old_view.image_id); | 2273 | const PendingDownload new_download{true, 0, old_view.image_id}; |
| 2274 | uncommitted_downloads.emplace_back(new_download); | ||
| 2273 | } | 2275 | } |
| 2274 | } | 2276 | } |
| 2275 | *old_id = new_id; | 2277 | *old_id = new_id; |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index d5bba3379..bb9ddb70e 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -40,14 +40,9 @@ struct ChannelState; | |||
| 40 | 40 | ||
| 41 | namespace VideoCommon { | 41 | namespace VideoCommon { |
| 42 | 42 | ||
| 43 | using Tegra::Texture::SwizzleSource; | ||
| 44 | using Tegra::Texture::TICEntry; | 43 | using Tegra::Texture::TICEntry; |
| 45 | using Tegra::Texture::TSCEntry; | 44 | using Tegra::Texture::TSCEntry; |
| 46 | using VideoCore::Surface::GetFormatType; | ||
| 47 | using VideoCore::Surface::IsCopyCompatible; | ||
| 48 | using VideoCore::Surface::PixelFormat; | 45 | using VideoCore::Surface::PixelFormat; |
| 49 | using VideoCore::Surface::PixelFormatFromDepthFormat; | ||
| 50 | using VideoCore::Surface::PixelFormatFromRenderTargetFormat; | ||
| 51 | using namespace Common::Literals; | 46 | using namespace Common::Literals; |
| 52 | 47 | ||
| 53 | struct ImageViewInOut { | 48 | struct ImageViewInOut { |