input: don't poll input on emu thread

fixes device reset errors with dx9 on Alt+Enter and other renderer
crashes
This commit is contained in:
Flyinghead 2021-09-27 11:51:39 +02:00
parent fb40bb22df
commit 1dc01314a1
4 changed files with 6 additions and 9 deletions

View File

@ -19,7 +19,6 @@ maple_device* MapleDevices[MAPLE_PORTS][6];
int maple_schid;
void UpdateInputState();
/*
Maple host controller
Direct processing, async interrupt handling
@ -147,8 +146,6 @@ static void maple_DoDma()
}
#endif
UpdateInputState();
const bool swap_msb = (SB_MMSEL == 0);
u32 xfer_count=0;
bool last = false;

View File

@ -41,7 +41,6 @@
#include "emulator.h"
#include "rend/mainui.h"
extern void UpdateInputState();
static bool game_started;
extern u8 kb_shift[MAPLE_PORTS]; // shift keys pressed (bitmask)
@ -310,8 +309,6 @@ static void ImGui_Impl_NewFrame()
ImGuiIO& io = ImGui::GetIO();
UpdateInputState();
// Read keyboard modifiers inputs
io.KeyCtrl = 0;
io.KeyShift = 0;

View File

@ -35,6 +35,7 @@ void UpdateInputState();
bool mainui_rend_frame()
{
os_DoEvents();
UpdateInputState();
if (gui_is_open() || gui_state == GuiState::VJoyEdit)
{
@ -48,7 +49,6 @@ bool mainui_rend_frame()
{
if (!rend_single_frame(mainui_enabled))
{
UpdateInputState();
if (!dc_is_running())
{
std::string error = dc_get_last_error();

View File

@ -173,6 +173,8 @@ static std::vector<std::string> disk_paths;
static std::vector<std::string> disk_labels;
static bool disc_tray_open = false;
void UpdateInputState();
void retro_set_video_refresh(retro_video_refresh_t cb)
{
video_cb = cb;
@ -827,6 +829,9 @@ void retro_run()
if (config::RendererType.isOpenGL())
glsm_ctl(GLSM_CTL_STATE_BIND, nullptr);
poll_cb();
UpdateInputState();
if (config::ThreadedRendering)
{
bool fastforward = false;
@ -840,8 +845,6 @@ void retro_run()
first_run = false;
}
poll_cb();
// Render
is_dupe = true;
for (int i = 0; i < 5 && is_dupe; i++)