GS: Replace EmuConfig.GS with GSConfig.

EmuConfig isn't safe to run on the gs thread.
This commit is contained in:
lightningterror 2023-05-07 17:56:57 +02:00
parent f651d8e26a
commit ec0aaff8ac
4 changed files with 9 additions and 9 deletions

View File

@ -189,7 +189,7 @@ static bool OpenGSDevice(GSRendererType renderer, bool clear_state_on_fail, bool
return false;
}
GSConfig.OsdShowGPU = EmuConfig.GS.OsdShowGPU && g_gs_device->SetGPUTimingEnabled(true);
GSConfig.OsdShowGPU = GSConfig.OsdShowGPU && g_gs_device->SetGPUTimingEnabled(true);
Console.WriteLn(Color_StrongGreen, "%s Graphics Driver Info:", GSDevice::RenderAPIToString(new_api));
Console.Indent().WriteLn(g_gs_device->GetDriverInfo());
@ -348,7 +348,7 @@ bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* b
Host::ReportErrorAsync(
"Error", fmt::format("Failed to create render device. This may be due to your GPU not supporting the "
"chosen renderer ({}), or because your graphics drivers need to be updated.",
Pcsx2Config::GSOptions::GetRendererName(EmuConfig.GS.Renderer)));
Pcsx2Config::GSOptions::GetRendererName(GSConfig.Renderer)));
return false;
}

View File

@ -602,7 +602,7 @@ bool GSDevice11::CreateSwapChain()
m_is_exclusive_fullscreen = false;
}
m_using_flip_model_swap_chain = !EmuConfig.GS.UseBlitSwapChain || m_is_exclusive_fullscreen;
m_using_flip_model_swap_chain = !GSConfig.UseBlitSwapChain || m_is_exclusive_fullscreen;
DXGI_SWAP_CHAIN_DESC1 swap_chain_desc = {};
swap_chain_desc.Width = static_cast<u32>(client_rc.right - client_rc.left);

View File

@ -122,13 +122,13 @@ bool GSDevice12::Create()
if (!GSDevice::Create())
return false;
m_dxgi_factory = D3D::CreateFactory(EmuConfig.GS.UseDebugDevice);
m_dxgi_factory = D3D::CreateFactory(GSConfig.UseDebugDevice);
if (!m_dxgi_factory)
return false;
ComPtr<IDXGIAdapter1> dxgi_adapter = D3D::GetAdapterByName(m_dxgi_factory.get(), EmuConfig.GS.Adapter);
ComPtr<IDXGIAdapter1> dxgi_adapter = D3D::GetAdapterByName(m_dxgi_factory.get(), GSConfig.Adapter);
if (!D3D12Context::Create(m_dxgi_factory.get(), dxgi_adapter.get(), EmuConfig.GS.UseDebugDevice))
if (!D3D12Context::Create(m_dxgi_factory.get(), dxgi_adapter.get(), GSConfig.UseDebugDevice))
{
Console.Error("Failed to create D3D12 context");
return false;

View File

@ -773,7 +773,7 @@ bool GSDeviceMTL::Create()
if (!GSDevice::Create())
return false;
NSString* ns_adapter_name = [NSString stringWithUTF8String:EmuConfig.GS.Adapter.c_str()];
NSString* ns_adapter_name = [NSString stringWithUTF8String:GSConfig.Adapter.c_str()];
auto devs = MRCTransfer(MTLCopyAllDevices());
for (id<MTLDevice> dev in devs.Get())
{
@ -782,8 +782,8 @@ bool GSDeviceMTL::Create()
}
if (!m_dev.dev)
{
if (!EmuConfig.GS.Adapter.empty())
Console.Warning("Metal: Couldn't find adapter %s, using default", EmuConfig.GS.Adapter.c_str());
if (!GSConfig.Adapter.empty())
Console.Warning("Metal: Couldn't find adapter %s, using default", GSConfig.Adapter.c_str());
m_dev = GSMTLDevice(MRCTransfer(MTLCreateSystemDefaultDevice()));
if (!m_dev.dev)
Host::ReportErrorAsync("No Metal Devices Available", "No Metal-supporting GPUs were found. PCSX2 requires a Metal GPU (available on all macs from 2012 onwards).");