System: Fix bogus SW thread CPU in OSD

This commit is contained in:
Stenzek 2024-09-21 16:15:07 +10:00
parent e617f17294
commit ac8461a28b
No known key found for this signature in database
5 changed files with 15 additions and 8 deletions

View File

@ -5717,6 +5717,13 @@ void System::ToggleSoftwareRendering()
Settings::GetRendererDisplayName(new_renderer)), Settings::GetRendererDisplayName(new_renderer)),
Host::OSD_QUICK_DURATION); Host::OSD_QUICK_DURATION);
RecreateGPU(new_renderer); RecreateGPU(new_renderer);
// Might have a thread change.
if (const Threading::Thread* sw_thread = g_gpu->GetSWThread(); sw_thread)
s_last_sw_time = sw_thread->GetCPUTime();
else
s_last_sw_time = 0;
g_gpu->UpdateResolutionScale(); g_gpu->UpdateResolutionScale();
} }

View File

@ -1080,7 +1080,7 @@ void D3D11Device::UnbindTexture(D3D11Texture* tex)
{ {
if (m_current_render_targets[i] == tex) if (m_current_render_targets[i] == tex)
{ {
WARNING_LOG("Unbinding current RT"); DEV_LOG("Unbinding current RT");
SetRenderTargets(nullptr, 0, m_current_depth_target); SetRenderTargets(nullptr, 0, m_current_depth_target);
break; break;
} }
@ -1088,7 +1088,7 @@ void D3D11Device::UnbindTexture(D3D11Texture* tex)
} }
else if (tex->IsDepthStencil() && m_current_depth_target == tex) else if (tex->IsDepthStencil() && m_current_depth_target == tex)
{ {
WARNING_LOG("Unbinding current DS"); DEV_LOG("Unbinding current DS");
SetRenderTargets(nullptr, 0, nullptr); SetRenderTargets(nullptr, 0, nullptr);
} }
} }

View File

@ -2012,7 +2012,7 @@ void MetalDevice::UnbindTexture(MetalTexture* tex)
{ {
if (m_current_render_targets[i] == tex) if (m_current_render_targets[i] == tex)
{ {
WARNING_LOG("Unbinding current RT"); DEV_LOG("Unbinding current RT");
SetRenderTargets(nullptr, 0, m_current_depth_target, GPUPipeline::NoRenderPassFlags); // TODO: Wrong SetRenderTargets(nullptr, 0, m_current_depth_target, GPUPipeline::NoRenderPassFlags); // TODO: Wrong
break; break;
} }
@ -2022,7 +2022,7 @@ void MetalDevice::UnbindTexture(MetalTexture* tex)
{ {
if (m_current_depth_target == tex) if (m_current_depth_target == tex)
{ {
WARNING_LOG("Unbinding current DS"); DEV_LOG("Unbinding current DS");
SetRenderTargets(nullptr, 0, nullptr, GPUPipeline::NoRenderPassFlags); SetRenderTargets(nullptr, 0, nullptr, GPUPipeline::NoRenderPassFlags);
} }
} }

View File

@ -948,7 +948,7 @@ void OpenGLDevice::UnbindTexture(OpenGLTexture* tex)
{ {
if (m_current_render_targets[i] == tex) if (m_current_render_targets[i] == tex)
{ {
WARNING_LOG("Unbinding current RT"); DEV_LOG("Unbinding current RT");
SetRenderTargets(nullptr, 0, m_current_depth_target); SetRenderTargets(nullptr, 0, m_current_depth_target);
break; break;
} }
@ -960,7 +960,7 @@ void OpenGLDevice::UnbindTexture(OpenGLTexture* tex)
{ {
if (m_current_depth_target == tex) if (m_current_depth_target == tex)
{ {
WARNING_LOG("Unbinding current DS"); DEV_LOG("Unbinding current DS");
SetRenderTargets(nullptr, 0, nullptr); SetRenderTargets(nullptr, 0, nullptr);
} }

View File

@ -3692,7 +3692,7 @@ void VulkanDevice::UnbindTexture(VulkanTexture* tex)
{ {
if (m_current_render_targets[i] == tex) if (m_current_render_targets[i] == tex)
{ {
WARNING_LOG("Unbinding current RT"); DEV_LOG("Unbinding current RT");
SetRenderTargets(nullptr, 0, m_current_depth_target); SetRenderTargets(nullptr, 0, m_current_depth_target);
break; break;
} }
@ -3704,7 +3704,7 @@ void VulkanDevice::UnbindTexture(VulkanTexture* tex)
{ {
if (m_current_depth_target == tex) if (m_current_depth_target == tex)
{ {
WARNING_LOG("Unbinding current DS"); DEV_LOG("Unbinding current DS");
SetRenderTargets(nullptr, 0, nullptr); SetRenderTargets(nullptr, 0, nullptr);
} }