mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 14:25:38 +00:00
libretro: Disable context caching
It's completely broken in RetroArch, see https://github.com/libretro/RetroArch/issues/11623
This commit is contained in:
parent
f7a75941b5
commit
b2de5945c4
|
@ -21,7 +21,7 @@ void LibretroD3D11HostDisplay::SetVSync(bool enabled)
|
|||
|
||||
bool LibretroD3D11HostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb)
|
||||
{
|
||||
cb->cache_context = true;
|
||||
cb->cache_context = false;
|
||||
cb->bottom_left_origin = false;
|
||||
cb->context_type = RETRO_HW_CONTEXT_DIRECT3D;
|
||||
cb->version_major = 11;
|
||||
|
|
|
@ -865,16 +865,15 @@ void LibretroHostInterface::UpdateSettings()
|
|||
{
|
||||
ReportMessage("Resolution changed, updating system AV info...");
|
||||
|
||||
// this will probably recreate the device... so save the state first by switching to software
|
||||
if (m_using_hardware_renderer)
|
||||
SwitchToSoftwareRenderer();
|
||||
|
||||
UpdateSystemAVInfo(true);
|
||||
|
||||
if (!m_hw_render_callback_valid)
|
||||
RequestHardwareRendererContext();
|
||||
else if (!m_using_hardware_renderer)
|
||||
SwitchToHardwareRenderer();
|
||||
if (!g_settings.IsUsingSoftwareRenderer())
|
||||
{
|
||||
if (!m_hw_render_callback_valid)
|
||||
RequestHardwareRendererContext();
|
||||
else if (!m_using_hardware_renderer)
|
||||
SwitchToHardwareRenderer();
|
||||
}
|
||||
|
||||
// Don't let the base class mess with the GPU.
|
||||
old_settings.gpu_resolution_scale = g_settings.gpu_resolution_scale;
|
||||
|
@ -1215,12 +1214,11 @@ void LibretroHostInterface::SwitchToHardwareRenderer()
|
|||
|
||||
void LibretroHostInterface::HardwareRendererContextDestroy()
|
||||
{
|
||||
Log_InfoPrintf("Hardware context destroyed");
|
||||
|
||||
// switch back to software
|
||||
if (g_libretro_host_interface.m_using_hardware_renderer)
|
||||
{
|
||||
Log_InfoPrintf("Lost hardware renderer context, switching to software renderer");
|
||||
g_libretro_host_interface.SwitchToSoftwareRenderer();
|
||||
}
|
||||
|
||||
if (g_libretro_host_interface.m_hw_render_display)
|
||||
{
|
||||
|
@ -1233,6 +1231,8 @@ void LibretroHostInterface::HardwareRendererContextDestroy()
|
|||
|
||||
void LibretroHostInterface::SwitchToSoftwareRenderer()
|
||||
{
|
||||
Log_InfoPrintf("Switching to software renderer");
|
||||
|
||||
// keep the hw renderer around in case we need it later
|
||||
// but keep it active until we've recreated the GPU so we can save the state
|
||||
std::unique_ptr<HostDisplay> save_display;
|
||||
|
|
|
@ -79,7 +79,7 @@ static bool TryESVersions(retro_hw_render_callback* cb)
|
|||
bool LibretroOpenGLHostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb, bool prefer_gles)
|
||||
{
|
||||
// Prefer a desktop OpenGL context where possible. If we can't get this, try OpenGL ES.
|
||||
cb->cache_context = true;
|
||||
cb->cache_context = false;
|
||||
cb->bottom_left_origin = true;
|
||||
|
||||
if (!prefer_gles)
|
||||
|
|
|
@ -76,7 +76,7 @@ static retro_hw_render_context_negotiation_interface_vulkan s_vulkan_context_neg
|
|||
|
||||
bool LibretroVulkanHostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb)
|
||||
{
|
||||
cb->cache_context = true;
|
||||
cb->cache_context = false;
|
||||
cb->bottom_left_origin = false;
|
||||
cb->context_type = RETRO_HW_CONTEXT_VULKAN;
|
||||
return g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER, cb) &&
|
||||
|
|
Loading…
Reference in a new issue