From c2d36cde9fa175950d7eeb61320802ffed0cb32d Mon Sep 17 00:00:00 2001 From: xperia64 Date: Sun, 21 Feb 2021 23:05:27 +0000 Subject: [PATCH] Fix destructor order in rasterizer cache (#5725) --- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 1c4ab7174..108aa7bad 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -317,6 +317,12 @@ public: /// Clear all cached resources tracked by this cache manager void ClearAll(bool flush); + // Textures from destroyed surfaces are stored here to be recyled to reduce allocation overhead + // in the driver + // this must be placed above the surface_cache to ensure all cached surfaces are destroyed + // before destroying the recycler + std::unordered_multimap host_texture_recycler; + private: void DuplicateSurface(const Surface& src_surface, const Surface& dest_surface); @@ -362,10 +368,6 @@ private: public: OGLTexture AllocateSurfaceTexture(const FormatTuple& format_tuple, u32 width, u32 height); - // Textures from destroyed surfaces are stored here to be recyled to reduce allocation overhead - // in the driver - std::unordered_multimap host_texture_recycler; - std::unique_ptr texture_filterer; std::unique_ptr format_reinterpreter; };