Skip to content

Commit

Permalink
~GPU_Vulkan: Check that we still have a draw_ pointer before trying t…
Browse files Browse the repository at this point in the history
…o drain the compile queue.
  • Loading branch information
hrydgard committed May 3, 2023
1 parent 0e2fb13 commit c9b7c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Common/GPU/OpenGL/GLRenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ void GLPushBuffer::Defragment() {
_dbg_assert_msg_(!OnRenderThread(), "Defragment must not run on the render thread");

if (buffers_.size() <= 1) {
// Let's take this chance to jetison localMemory we don't need.
// Let's take this opportunity to jettison any localMemory we don't need.
for (auto &info : buffers_) {
if (info.deviceMemory) {
FreeAlignedMemory(info.localMemory);
Expand Down
6 changes: 4 additions & 2 deletions GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ void GPU_Vulkan::SaveCache(const Path &filename) {
}

GPU_Vulkan::~GPU_Vulkan() {
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
rm->DrainCompileQueue();
if (draw_) {
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
rm->DrainCompileQueue();
}

SaveCache(shaderCachePath_);
// Note: We save the cache in DeviceLost
Expand Down

0 comments on commit c9b7c81

Please sign in to comment.