mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Also use events for config changed
This commit is contained in:
@ -16,6 +16,11 @@
|
||||
|
||||
std::unique_ptr<AbstractGfx> g_gfx;
|
||||
|
||||
AbstractGfx::AbstractGfx()
|
||||
{
|
||||
ConfigChangedEvent::Register([this](u32 bits) { OnConfigChanged(bits); }, "AbstractGfx");
|
||||
}
|
||||
|
||||
bool AbstractGfx::IsHeadless() const
|
||||
{
|
||||
return true;
|
||||
@ -132,6 +137,16 @@ std::unique_ptr<VideoCommon::AsyncShaderCompiler> AbstractGfx::CreateAsyncShader
|
||||
return std::make_unique<VideoCommon::AsyncShaderCompiler>();
|
||||
}
|
||||
|
||||
void AbstractGfx::OnConfigChanged(u32 changed_bits)
|
||||
{
|
||||
// If there's any shader changes, wait for the GPU to finish before destroying anything.
|
||||
if (changed_bits & (CONFIG_CHANGE_BIT_HOST_CONFIG | CONFIG_CHANGE_BIT_MULTISAMPLES))
|
||||
{
|
||||
WaitForGPUIdle();
|
||||
SetPipeline(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool AbstractGfx::UseGeometryShaderForUI() const
|
||||
{
|
||||
// OpenGL doesn't render to a 2-layer backbuffer like D3D/Vulkan for quad-buffered stereo,
|
||||
|
Reference in New Issue
Block a user