PostProcessing: Fix abort on slow compile in big picture

This commit is contained in:
Stenzek 2025-02-14 18:59:39 +10:00
parent 5060e72b96
commit dc6d6b91d4
No known key found for this signature in database
3 changed files with 21 additions and 2 deletions

View File

@ -8513,6 +8513,11 @@ LoadingScreenProgressCallback::LoadingScreenProgressCallback()
} }
LoadingScreenProgressCallback::~LoadingScreenProgressCallback() LoadingScreenProgressCallback::~LoadingScreenProgressCallback()
{
Close();
}
void LoadingScreenProgressCallback::Close()
{ {
// Did we activate? // Did we activate?
if (m_last_progress_percent < 0) if (m_last_progress_percent < 0)
@ -8531,6 +8536,8 @@ LoadingScreenProgressCallback::~LoadingScreenProgressCallback()
// since this was pushing frames, we need to restore the context. do that by pushing a frame ourselves // since this was pushing frames, we need to restore the context. do that by pushing a frame ourselves
GPUThread::Internal::PresentFrameAndRestoreContext(); GPUThread::Internal::PresentFrameAndRestoreContext();
} }
m_last_progress_percent = -1;
} }
void LoadingScreenProgressCallback::PushState() void LoadingScreenProgressCallback::PushState()

View File

@ -60,6 +60,8 @@ public:
ALWAYS_INLINE void SetOpenDelay(float delay) { m_open_delay = delay; } ALWAYS_INLINE void SetOpenDelay(float delay) { m_open_delay = delay; }
void Close();
void PushState() override; void PushState() override;
void PopState() override; void PopState() override;

View File

@ -432,11 +432,11 @@ void PostProcessing::Chain::LoadStages(std::unique_lock<std::mutex>& settings_lo
return; return;
} }
progress.IncrementProgressValue();
settings_lock.lock(); settings_lock.lock();
shader->LoadOptions(si, GetStageConfigSection(m_section, i)); shader->LoadOptions(si, GetStageConfigSection(m_section, i));
m_stages.push_back(std::move(shader)); m_stages.push_back(std::move(shader));
progress.IncrementProgressValue();
} }
if (stage_count > 0) if (stage_count > 0)
@ -455,6 +455,11 @@ void PostProcessing::Chain::LoadStages(std::unique_lock<std::mutex>& settings_lo
m_needs_depth_buffer = m_enabled && m_wants_depth_buffer; m_needs_depth_buffer = m_enabled && m_wants_depth_buffer;
if (m_wants_depth_buffer) if (m_wants_depth_buffer)
DEV_LOG("Depth buffer is needed."); DEV_LOG("Depth buffer is needed.");
// can't close/redraw with settings lock held because big picture
settings_lock.unlock();
progress.Close();
settings_lock.lock();
} }
void PostProcessing::Chain::UpdateSettings(std::unique_lock<std::mutex>& settings_lock, const SettingsInterface& si) void PostProcessing::Chain::UpdateSettings(std::unique_lock<std::mutex>& settings_lock, const SettingsInterface& si)
@ -531,6 +536,11 @@ void PostProcessing::Chain::UpdateSettings(std::unique_lock<std::mutex>& setting
m_needs_depth_buffer = m_enabled && m_wants_depth_buffer; m_needs_depth_buffer = m_enabled && m_wants_depth_buffer;
if (m_wants_depth_buffer) if (m_wants_depth_buffer)
DEV_LOG("Depth buffer is needed."); DEV_LOG("Depth buffer is needed.");
// can't close/redraw with settings lock held because big picture
settings_lock.unlock();
progress.Close();
settings_lock.lock();
} }
void PostProcessing::Chain::Toggle() void PostProcessing::Chain::Toggle()