Vulkan: Before cleaning the shader managers, drain the shader compile queue.

Mainly paranoia, but might help with the mutex crash from #17364
This commit is contained in:
Henrik Rydgård 2023-05-02 22:04:14 +02:00
parent 1a2d599942
commit 97488c0a79
2 changed files with 4 additions and 1 deletions

View file

@ -456,13 +456,13 @@ public:
void Invalidate(InvalidationFlags flags);
void ResetStats();
void DrainCompileQueue();
private:
void EndCurRenderStep();
void ThreadFunc();
void CompileThreadFunc();
void DrainCompileQueue();
void Run(VKRRenderThreadTask &task);

View file

@ -182,6 +182,9 @@ void GPU_Vulkan::SaveCache(const Path &filename) {
}
GPU_Vulkan::~GPU_Vulkan() {
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
rm->DrainCompileQueue();
SaveCache(shaderCachePath_);
// Note: We save the cache in DeviceLost
DestroyDeviceObjects();