VideoThread: Assert not on thread for async calls

pull/3744/head
Stenzek 5 months ago
parent 3fb89483b3
commit 730dcd9a93
No known key found for this signature in database

@ -1151,6 +1151,8 @@ void VideoThread::UpdateSettingsOnThread(GPUSettings&& new_settings)
void VideoThread::RunOnThread(AsyncCallType func)
{
DebugAssert(!VideoThread::IsOnThread());
if (!s_state.use_thread) [[unlikely]]
{
func();
@ -1164,6 +1166,8 @@ void VideoThread::RunOnThread(AsyncCallType func)
void VideoThread::RunOnThreadAndSync(AsyncCallType func)
{
DebugAssert(!VideoThread::IsOnThread());
if (!s_state.use_thread) [[unlikely]]
{
func();
@ -1177,6 +1181,8 @@ void VideoThread::RunOnThreadAndSync(AsyncCallType func)
std::pair<VideoThreadCommand*, void*> VideoThread::BeginASyncBufferCall(AsyncBufferCallType func, u32 buffer_size)
{
DebugAssert(!VideoThread::IsOnThread());
// this is less than optimal, but it's only used for input osd updates currently, so whatever
VideoThreadAsyncBufferCallCommand* const cmd = AllocateCommand<VideoThreadAsyncBufferCallCommand>(
sizeof(VideoThreadAsyncBufferCallCommand) + buffer_size, VideoThreadCommandType::AsyncBufferCall, func);
@ -1186,6 +1192,8 @@ std::pair<VideoThreadCommand*, void*> VideoThread::BeginASyncBufferCall(AsyncBuf
void VideoThread::EndASyncBufferCall(VideoThreadCommand* cmd)
{
DebugAssert(!VideoThread::IsOnThread());
if (!s_state.use_thread) [[unlikely]]
{
VideoThreadAsyncBufferCallCommand* const acmd = static_cast<VideoThreadAsyncBufferCallCommand*>(cmd);

Loading…
Cancel
Save