Skip to content

Commit

Permalink
GPUThread: Fix input OSD with threaded rendering off
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jan 16, 2025
1 parent f6f709b commit 074a8a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/core/gpu_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,19 @@ std::pair<GPUThreadCommand*, void*> GPUThread::BeginASyncBufferCall(AsyncBufferC
return std::make_pair(static_cast<GPUThreadCommand*>(cmd), buffer);
}

void GPUThread::EndASyncBufferCall(GPUThreadCommand* cmd)
{
if (!s_state.use_gpu_thread) [[unlikely]]
{
GPUThreadAsyncCallCommand* const acmd = static_cast<GPUThreadAsyncCallCommand*>(cmd);
acmd->func();
acmd->~GPUThreadAsyncCallCommand();
return;
}

PushCommand(cmd);
}

void GPUThread::UpdateSettings(bool gpu_settings_changed, bool device_settings_changed)
{
if (device_settings_changed)
Expand Down
1 change: 1 addition & 0 deletions src/core/gpu_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ bool IsUsingThread();
void RunOnThread(AsyncCallType func);
void RunOnBackend(AsyncBackendCallType func, bool sync, bool spin_or_wake);
std::pair<GPUThreadCommand*, void*> BeginASyncBufferCall(AsyncBufferCallType func, u32 buffer_size);
void EndASyncBufferCall(GPUThreadCommand* cmd);
void SetVSync(GPUVSyncMode mode, bool allow_present_throttle);

// Should only be called on the GPU thread.
Expand Down
2 changes: 1 addition & 1 deletion src/core/imgui_overlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ void ImGuiManager::UpdateInputOverlay()
}
}

GPUThread::PushCommand(cmd);
GPUThread::EndASyncBufferCall(cmd);
}

void ImGuiManager::UpdateInputOverlay(void* buffer)
Expand Down

0 comments on commit 074a8a2

Please # to comment.