diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-07-18 18:40:14 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:27 +0100 |
commit | 22f4b290b6f0894d29302102f539dd8753961f04 (patch) | |
tree | d0777996569139bb07a152bedd03509951da0402 /src/video_core/renderer_vulkan/vk_texture_cache.h | |
parent | Merge pull request #7326 from ameerj/vp8 (diff) | |
download | yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar.gz yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar.bz2 yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar.lz yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar.xz yuzu-22f4b290b6f0894d29302102f539dd8753961f04.tar.zst yuzu-22f4b290b6f0894d29302102f539dd8753961f04.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.h')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index b09c468e4..f7e782c44 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -6,7 +6,9 @@ #include <span> +#include "common/settings.h" #include "shader_recompiler/shader_info.h" +#include "video_core/delayed_destruction_ring.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/texture_cache/image_view_base.h" #include "video_core/texture_cache/texture_cache_base.h" @@ -15,6 +17,7 @@ namespace Vulkan { +using VideoCommon::DelayedDestructionRing; using VideoCommon::ImageId; using VideoCommon::NUM_RT; using VideoCommon::Region2D; @@ -39,6 +42,14 @@ struct TextureCacheRuntime { BlitImageHelper& blit_image_helper; ASTCDecoderPass& astc_decoder_pass; RenderPassCache& render_pass_cache; + static constexpr size_t TICKS_TO_DESTROY = 6; + DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images; + DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits; + DelayedDestructionRing<vk::ImageView, TICKS_TO_DESTROY> prescaled_views; + Settings::ResolutionScalingInfo resolution; + bool is_rescaling_on{}; + + void Init(); void Finish(); @@ -74,6 +85,8 @@ struct TextureCacheRuntime { return true; } + void TickFrame(); + u64 GetDeviceLocalMemory() const; }; @@ -113,6 +126,10 @@ public: return std::exchange(initialized, true); } + void ScaleUp(); + + void ScaleDown(); + private: VKScheduler* scheduler; vk::Image image; @@ -121,6 +138,8 @@ private: std::vector<vk::ImageView> storage_image_views; VkImageAspectFlags aspect_mask = 0; bool initialized = false; + TextureCacheRuntime* runtime; + u32 scaling_count{}; }; class ImageView : public VideoCommon::ImageViewBase { |