summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_texture_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.h')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 958a64651..9c39a6d99 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -34,21 +34,16 @@ class RenderPassCache;
class StagingBufferPool;
class VKScheduler;
-struct TextureCacheRuntime {
- const Device& device;
- VKScheduler& scheduler;
- MemoryAllocator& memory_allocator;
- StagingBufferPool& staging_buffer_pool;
- BlitImageHelper& blit_image_helper;
- ASTCDecoderPass& astc_decoder_pass;
- RenderPassCache& render_pass_cache;
+class TextureCacheRuntime {
+public:
static constexpr size_t TICKS_TO_DESTROY = 6;
- DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images;
- DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits;
- Settings::ResolutionScalingInfo resolution;
- bool is_rescaling_on{};
- void Init();
+ explicit TextureCacheRuntime(const Device& device_, VKScheduler& scheduler_,
+ MemoryAllocator& memory_allocator_,
+ StagingBufferPool& staging_buffer_pool_,
+ BlitImageHelper& blit_image_helper_,
+ ASTCDecoderPass& astc_decoder_pass_,
+ RenderPassCache& render_pass_cache_);
void Finish();
@@ -56,6 +51,10 @@ struct TextureCacheRuntime {
StagingBufferRef DownloadStagingBuffer(size_t size);
+ void TickFrame();
+
+ u64 GetDeviceLocalMemory() const;
+
void BlitImage(Framebuffer* dst_framebuffer, ImageView& dst, ImageView& src,
const Region2D& dst_region, const Region2D& src_region,
Tegra::Engines::Fermi2D::Filter filter,
@@ -84,15 +83,25 @@ struct TextureCacheRuntime {
return true;
}
- void TickFrame();
+ const Device& device;
+ VKScheduler& scheduler;
+ MemoryAllocator& memory_allocator;
+ StagingBufferPool& staging_buffer_pool;
+ BlitImageHelper& blit_image_helper;
+ ASTCDecoderPass& astc_decoder_pass;
+ RenderPassCache& render_pass_cache;
- u64 GetDeviceLocalMemory() const;
+ DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images;
+ DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits;
+ Settings::ResolutionScalingInfo resolution;
+ bool is_rescaling_on{};
};
class Image : public VideoCommon::ImageBase {
public:
explicit Image(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, GPUVAddr gpu_addr,
VAddr cpu_addr);
+ explicit Image(const VideoCommon::NullImageParams&);
~Image();
@@ -151,7 +160,7 @@ public:
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&);
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo&,
const VideoCommon::ImageViewInfo&, GPUVAddr);
- explicit ImageView(TextureCacheRuntime&, const VideoCommon::NullImageParams&);
+ explicit ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParams&);
[[nodiscard]] VkImageView DepthView();