summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/texture_cache_base.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-04-14 18:07:38 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-04-29 00:18:21 +0200
commite3a2ca96bd2350471ebb6c2907c67b10254a4f7e (patch)
tree5238364cdea97449adb0766df0d6263123ed06da /src/video_core/texture_cache/texture_cache_base.h
parentTextureCache: refactor DMA downloads to allow multiple buffers. (diff)
downloadyuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar.gz
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar.bz2
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar.lz
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar.xz
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.tar.zst
yuzu-e3a2ca96bd2350471ebb6c2907c67b10254a4f7e.zip
Diffstat (limited to 'src/video_core/texture_cache/texture_cache_base.h')
-rw-r--r--src/video_core/texture_cache/texture_cache_base.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h
index 51f44aed5..d5bba3379 100644
--- a/src/video_core/texture_cache/texture_cache_base.h
+++ b/src/video_core/texture_cache/texture_cache_base.h
@@ -217,7 +217,8 @@ public:
const Tegra::DMA::ImageOperand& image_operand, ImageId image_id, bool modifies_image);
void DownloadImageIntoBuffer(Image* image, BufferType buffer, size_t buffer_offset,
- std::span<const VideoCommon::BufferImageCopy> copies);
+ std::span<const VideoCommon::BufferImageCopy> copies,
+ GPUVAddr address = 0, size_t size = 0);
/// Return true when a CPU region is modified from the GPU
[[nodiscard]] bool IsRegionGpuModified(VAddr addr, size_t size);
@@ -428,17 +429,31 @@ private:
u64 critical_memory;
size_t critical_gc;
+ struct BufferDownload {
+ GPUVAddr address;
+ size_t size;
+ };
+
+ struct PendingDownload {
+ bool is_swizzle;
+ size_t async_buffer_id;
+ SlotId object_id;
+ };
+
SlotVector<Image> slot_images;
SlotVector<ImageMapView> slot_map_views;
SlotVector<ImageView> slot_image_views;
SlotVector<ImageAlloc> slot_image_allocs;
SlotVector<Sampler> slot_samplers;
SlotVector<Framebuffer> slot_framebuffers;
+ SlotVector<BufferDownload> slot_buffer_downloads;
// TODO: This data structure is not optimal and it should be reworked
- std::vector<ImageId> uncommitted_downloads;
- std::deque<std::vector<ImageId>> committed_downloads;
- std::deque<std::optional<AsyncBuffer>> async_buffers;
+
+ std::vector<PendingDownload> uncommitted_downloads;
+ std::deque<std::vector<PendingDownload>> committed_downloads;
+ std::vector<AsyncBuffer> uncommitted_async_buffers;
+ std::deque<std::vector<AsyncBuffer>> async_buffers;
struct LRUItemParams {
using ObjectType = ImageId;