diff options
author | bunnei <bunneidev@gmail.com> | 2023-04-29 20:46:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 20:46:01 +0200 |
commit | fe57f3967639616142889bf1b638117ca6c879cf (patch) | |
tree | 43879297dd91ac1ab824010610e724c37ec3cb95 /src/video_core/texture_cache/texture_cache_base.h | |
parent | Merge pull request #10051 from liamwhite/surface-capabilities (diff) | |
parent | Texture Cache: Release stagging buffers on tick frame (diff) | |
download | yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar.gz yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar.bz2 yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar.lz yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar.xz yuzu-fe57f3967639616142889bf1b638117ca6c879cf.tar.zst yuzu-fe57f3967639616142889bf1b638117ca6c879cf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 5a5b4179c..758b7e212 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 yuzu Emulator Project +// SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later #pragma once @@ -40,14 +40,9 @@ struct ChannelState; namespace VideoCommon { -using Tegra::Texture::SwizzleSource; using Tegra::Texture::TICEntry; using Tegra::Texture::TSCEntry; -using VideoCore::Surface::GetFormatType; -using VideoCore::Surface::IsCopyCompatible; using VideoCore::Surface::PixelFormat; -using VideoCore::Surface::PixelFormatFromDepthFormat; -using VideoCore::Surface::PixelFormatFromRenderTargetFormat; using namespace Common::Literals; struct ImageViewInOut { @@ -119,6 +114,7 @@ class TextureCache : public VideoCommon::ChannelSetupCaches<TextureCacheChannelI using Sampler = typename P::Sampler; using Framebuffer = typename P::Framebuffer; using AsyncBuffer = typename P::AsyncBuffer; + using BufferType = typename P::BufferType; struct BlitImages { ImageId dst_id; @@ -215,6 +211,10 @@ public: const Tegra::DMA::ImageCopy& copy_info, const Tegra::DMA::BufferOperand& buffer_operand, 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, + 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); @@ -424,17 +424,32 @@ 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; + std::deque<AsyncBuffer> async_buffers_death_ring; struct LRUItemParams { using ObjectType = ImageId; |