summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/texture_cache.h26
-rw-r--r--src/video_core/texture_cache/texture_cache_base.h5
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
18namespace VideoCommon { 19namespace VideoCommon {
19 20
20using Tegra::Texture::SwizzleSource;
21using Tegra::Texture::TextureType;
22using Tegra::Texture::TICEntry; 21using Tegra::Texture::TICEntry;
23using Tegra::Texture::TSCEntry; 22using Tegra::Texture::TSCEntry;
24using VideoCore::Surface::GetFormatType; 23using VideoCore::Surface::GetFormatType;
25using VideoCore::Surface::IsCopyCompatible;
26using VideoCore::Surface::PixelFormat; 24using VideoCore::Surface::PixelFormat;
27using VideoCore::Surface::PixelFormatFromDepthFormat;
28using VideoCore::Surface::PixelFormatFromRenderTargetFormat;
29using VideoCore::Surface::SurfaceType; 25using VideoCore::Surface::SurfaceType;
30using namespace Common::Literals; 26using 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
870template <class P> 867template <class P>
871void TextureCache<P>::DownloadImageIntoBuffer( 868void 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
41namespace VideoCommon { 41namespace VideoCommon {
42 42
43using Tegra::Texture::SwizzleSource;
44using Tegra::Texture::TICEntry; 43using Tegra::Texture::TICEntry;
45using Tegra::Texture::TSCEntry; 44using Tegra::Texture::TSCEntry;
46using VideoCore::Surface::GetFormatType;
47using VideoCore::Surface::IsCopyCompatible;
48using VideoCore::Surface::PixelFormat; 45using VideoCore::Surface::PixelFormat;
49using VideoCore::Surface::PixelFormatFromDepthFormat;
50using VideoCore::Surface::PixelFormatFromRenderTargetFormat;
51using namespace Common::Literals; 46using namespace Common::Literals;
52 47
53struct ImageViewInOut { 48struct ImageViewInOut {