diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index bfe8f31117..93413cb4b5 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -520,6 +520,7 @@ void GPU_Vulkan::BeginHostFrame() { void GPU_Vulkan::EndHostFrame() { drawEngine_.EndFrame(); framebufferManager_->EndFrame(); + textureCache_.EndFrame(); } // Needs to be called on GPU thread, not reporting thread. diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index d552f07dbb..831e7c0498 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -564,15 +564,10 @@ void TextureCacheVulkan::SetFramebufferSamplingParams(u16 bufferWidth, u16 buffe } void TextureCacheVulkan::StartFrame() { - // TODO: Better place? - allocator_->End(); lastBoundTexture = nullptr; timesInvalidatedAllThisFrame_ = 0; - - if (texelsScaledThisFrame_) { - // INFO_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); - } texelsScaledThisFrame_ = 0; + if (clearCacheNextFrame_) { Clear(true); clearCacheNextFrame_ = false; @@ -583,6 +578,14 @@ void TextureCacheVulkan::StartFrame() { allocator_->Begin(); } +void TextureCacheVulkan::EndFrame() { + allocator_->End(); + + if (texelsScaledThisFrame_) { + // INFO_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); + } +} + static inline u32 MiniHash(const u32 *ptr) { return ptr[0]; } diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index f47164d77a..8f4a9b03aa 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -91,6 +91,7 @@ public: void Clear(bool delete_them); void StartFrame(); + void EndFrame(); void Invalidate(u32 addr, int size, GPUInvalidationType type); void InvalidateAll(GPUInvalidationType type); void ClearNextFrame();